This submit examines eight considerably uncommon Linux instructions which can be value realizing. However earlier than we get into the particular instructions, you may run the command beneath to see whether or not these eight instructions are put in in your system. For every command, you’ll see the file system location for the command executable or a line that begins with “no command in (PATH)” the place “PATH” can be a show of your search path – the locations the place the command seems to be for them.
[shs@fedora ~]$ for cmd in sure shuf column pv tldr stat namei rev
do
which $cmd
finished
The output ought to appear to be this if all of the instructions are put in:
usr/bin/sure
/usr/bin/shuf
/usr/bin/column
/usr/bin/pv
/usr/bin/tldr
/usr/bin/stat
/usr/bin/namei
/usr/bin/rev
Now let’s check out what every of those instructions can do for you.
1. The sure command
The sure command will repeat the phrase “sure” or no matter string you present time and again (e.g., with a command like “sure Whats up World”) till you’ve seen sufficient and use ^c to cease the output. Be forewarned that the output will fill your display screen extremely quick. The extra helpful facet of this command is that you should utilize it to reply “sure” to a script that asks plenty of questions. Simply run a command like this and also you gained’t should kind “sure” to no matter questions it should ask:
$ sure | scriptname
2. The shuf command
The shuf command will randomly shuffle the strains in a file as proven within the examples beneath.
$ shuf employees $ shuf employees
Sam Adams Sally Rose
Elaine Henry John Doe
Joanne Zahn Mary Berry
Mary Berry David Bloom
Lisa Stone Joanne Zahn
John Doe Sam Adams
Ben Matson Eric Docker
Eric Docker Lisa Stone
David Bloom Elaine Henry
Sally Rose Ben Matson
Shuffled output might be helpful while you want random textual content for some job or to check a script to make it possible for its output is what you anticipate to see.
3. The column command
The column command will show textual content in columns. Listed below are two examples of learn how to use it:
$ cat employees | column
John Doe Lisa Stone Joanne Zahn Eric Docker Ben Matson
Mary Berry Elaine Henry David Bloom Sam Adams Sally Rose
$ cat employees | column -t
John Doe
Mary Berry
Lisa Stone
Elaine Henry
Joanne Zahn
David Bloom
Eric Docker
Sam Adams
Ben Matson
Sally Rose
4. The pv command
The pv (pipe viewer) command offers a helpful solution to show the progress of information being despatched by a pipe. Right here’s an instance. Notice the output shows the progress and the pace of the command.
$ pv largefile.zip | tar xzf -
348KiB 0:00:00 [37.4MiB/s] [============> ] 18%
5. The tldr command
The tldr command offers a simplified man web page that shows a sequence of examples on learn how to use the command you’re asking about.
]$ tldr date
date
Set or show the system date.
Extra info: https://www.gnu.org/software program/coreutils/handbook/html_node/date-invocation.html.
- Show the present date utilizing the default locale's format:
date +%c
- Show the present date in UTC, utilizing the ISO 8601 format:
date --utc +%Y-%m-%dTpercentH:%M:%SpercentZ
- Show the present date as a Unix timestamp (seconds because the Unix epoch):
date +%s
- Convert a date specified as a Unix timestamp to the default format:
date --date @1473305798
- Convert a given date to the Unix timestamp format:
date --date "2018-09-01 00:00" +%s --utc
- Show the present date utilizing the RFC-3339 format (YYYY-MM-DD hh:mm:ss TZ):
date --rfc-3339 s
- Set the present date utilizing the format MMDDhhmmYYYY.ss (YYYY and .ss are elective):
date 093023592021.59
- Show the present ISO week quantity:
date +%V
6. The stat command
The stat command offers significantly extra particulars on a file than the lengthy file listings offered by the “ls -l” command. These embrace the dates and instances of the newest updates and accesses.
$ stat employees
File: employees
Dimension: 112 Blocks: 8 IO Block: 4096 common file
Gadget: 0,51 Inode: 4975 Hyperlinks: 1
Entry: (0644/-rw-r--r--) Uid: ( 1001/ shs) Gid: ( 1001/ shs)
Context: unconfined_u:object_r:user_home_t:s0
Entry: 2025-04-09 13:19:11.313070260 -0400
Modify: 2025-04-09 13:19:06.317039688 -0400
Change: 2025-04-09 13:19:06.317039688 -0400
Delivery: 2025-04-09 13:19:06.317039688 -0400
7. The namei command
The namei command breaks a pathname into listing ranges – displaying every listing on a separate line.
$ namei -lx /usr/bin
f: /usr/bin
Dr-xr-xr-x root root /
drwxr-xr-x root root usr
dr-xr-xr-x root root bin
$ namei `pwd`
f: /house/shs
d /
d house
d shs
8. The rev command
The rev command reverses strains whether or not handed to the command as customary in or saved in a file.
$ echo Whats up, World! | rev
!dlroW ,olleH
$ echo Whats up, World! | rev | rev
Whats up, World!
Each 10.0s: date fedora: Wed Apr 9 14:00:42 2025
Wed Apr 9 02:00:42 PM EDT 2025
Wrap-up
Engaged on the Linux command line might be each worthwhile and enjoyable, and there’s at all times one thing new to be taught.
