Interesting LINUX Commands
Are you a person fascinated by Linux and want to explore more?
Let’s look at a few interesting Linux commands that keep blowing my mind each time I look at them:
1. Diff
The diff command compares two text files and shows the differences between them. There are many options to tailor the display to your requirements.
The -y (side by side) option shows the line differences side by side. The -w(width) option lets you specify the maximum line width to use to avoid wraparound lines.
diff -y -W 70 file1 file2 --suppress-common-lines
The — suppress-common-lines prevents diff from listing the matching lines, letting you focus on the lines which have differences.
2. Finger
The finger command gives you a short dump of information about a user, including the time of the user’s last login, the user’s home directory, and the user account’s full name.
finger username
3. Factor
Time for some Mathematics, this command output all the possible factors of a given number.
factor
4. Yes
It is funny but useful as well, specially in scripts and for System Administrators where an automated predefined response can be passed to terminal or generated.
yes Linux commands are awesome!
This prints “Linux commands are awesome!” until you interrupt with ctrl+c.
5. Aview
How about viewing an image in ASCII format on the terminal? We must have a package ‘aview‘ installed, just apt or yum it.
$ sudo apt install aview [On Debian/Ubuntu & Mint]
$ sudo yum install aview [On CentOS/RHEL 7]
$ sudo dnf install aview [On CentOS/RHEL 8 & Fedora]
$ sudo yay -S aview [On Arch Linux]
$ sudo pkg_add -v aview [On FreeBSD]
I’ve got an image named ‘elephant.jpg‘ in my current working directory and I want to view it on the terminal in ASCII format.
asciiview elephant.jpg -driver curses
Hope you had fun with these commands because I for sure did!