Some more obscure Linux commands that are very useful.

Posted: December 8, 2015. At: 12:42 PM. This was 2 years ago. Post ID: 8541
Page permalink.
WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters. These cookies expire two weeks after they are set.

The logsave command will print the output of a command to a file. This will also add a timestamp to the logfile telling the system administrator when the command was run.

logsave /var/log/partsize df –h

This is an example, the output of the command is also printed to STDOUT.

[email protected]:~$ logsave partsize /bin/df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        19G  5.0G   13G  29% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev            984M  4.0K  984M   1% /dev
tmpfs           199M  1.1M  198M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            995M   72K  995M   1% /run/shm
none            100M   24K  100M   1% /run/user

ldd. List all of the library dependencies required by a certain executable.

[email protected]:~$ ldd /bin/ls =>  (0x00007ffd7bddc000) => /lib/x86_64-linux-gnu/ (0x00007f961ba59000) => /lib/x86_64-linux-gnu/ (0x00007f961b851000) => /lib/x86_64-linux-gnu/ (0x00007f961b48c000) => /lib/x86_64-linux-gnu/ (0x00007f961b24e000) => /lib/x86_64-linux-gnu/ (0x00007f961b04a000)
	/lib64/ (0x00007f961bc7c000) => /lib/x86_64-linux-gnu/ (0x00007f961ae45000)

lsblk. List all block devices/partitions on the system.

[email protected]:~$ lsblk 
sda      8:0    0    20G  0 disk 
├─sda1   8:1    0    19G  0 part /
├─sda2   8:2    0     1K  0 part 
└─sda5   8:5    0  1022M  0 part [SWAP]
sr0     11:0    1  1024M  0 rom

rev. This command will simply reverse all input. Here is an example.

[email protected]:~$ date | rev
5102 TSP 02:93:71 7  ceD noM

Another example.

[email protected]:~$ echo "Another Example" | rev
elpmaxE rehtonA

Even more obscure and useful Linux commands:

No comments have been made. Use this form to start the conversation :)

Leave a Reply