
$ fortune | rev
!ti deteled dna ,ti daer resu-repus eht tub ,liam dah uoY
The shuf command allows you to randomize the lines in a file. Here’s a sample file and the results of shuffling its contents.
$ cat names
Bill
Danny
Dorothy
Jim
Joanne
John
Marty
Nancy
Sandra
Stewart$ shuf names
Jim
Nancy
Joanne
Marty
Sandra
Dorothy
Stewart
Bill
Danny
John
Each time you run shuf, the output should be different.
When you just need some random text for testing a script, these commands can help you out.
6. Using the watch command to monitor changes
The watch command allows you to run a command repeatedly and watch for the output changes you might be expecting to see. By default, it runs every 2 seconds, but you can change the interval by using the -n option. The command below uses the -d option to highlight changes in the command output.
$ watch -d free -m
Every 2.0s: free -m fedora: Fri Feb 14 15:52:23 2025total used free shared buff/cache available
Mem: 3784 1121 819 135 1844 2190
Swap: 3783 77 3706
7. Using the tree command to view directory contents in an user-friendly way
The tree command provides a file listing that displays directories and files in a tree-like display, giving you a quick but useful view of what’s inside some particular directory. Notice how the indentation makes the structure of the directory easy to understand.
$ tree bin
|----- backup
|----- FindFiles
|----- NOTES
| |----- report_formats
| |----- meeting notes
|----- scripts
Wrap-up
Some commands can make seeing what you’re looking for on the command line a lot easier. Just don’t forget to turn the more complex commands into aliases to make them easier to use.