General Discussion

What is Your Favourite Command Line Trick?

Linux Favourite Command Line Trick
Written by Martins D. Okoi

The command line was the first method to interact with the computer in a friendly manner long before Graphical User Interfaces came along. Till date, many tech-savvy computer users, especially Linux users, prefer working with the command line for many reasons, some of which were discussed in Why Do So Many Linux Users Prefer the Command Line to a GUI?

If you make use of the terminal more often than the typical computer user then odds are that you have one or more nifty ways of getting things done with it. It could be the way you concatenate commands together in scripts, the shortcuts you have thought your terminal app, or the hacks you have discovered online.

A fan favourite is sudo !!

Nifty when you ran a command that requires higher permission but did not include the sudo keyword. Sudo !! runs the last run command with sudo credentials; thereby, freeing you of the need to retype the command.

I stumbled upon entries by users online and some of them went as far as customizing their profile, creating automation scripts, aliases, and shortcuts for complex commands.
aa
For example, one user who uses ‘less -FsXR‘ a lot set it to a two-letter alias and to prevent Less from complaining when he tries to read a directory instead of a file, he went further to add the command in his shell rc-file as:

LESSOPEN='|dir=%s;test -d "$dir" && ls -lah --color "$dir"';export LESSOPEN

Definitely, a smart way to get work done!

  Why is Arch Linux So Challenging and What are Its Pros & Cons?

I’m positive that you have either learnt or created ways to work faster with the command line. Or at least, you have learnt shorthand methods for completing tasks that you didn’t know when you just started using the CLI. Share your experience with us by penning them in the comments section below.

Your Unwavering Support Matters a Lot:

The cost of maintenance is skyrocketing as more readers are coming on board and the ad service that we employ in order to generate revenue is unfortunately no longer sufficient and this is especially due to the increased use of ad-blockers.

We humbly request that you consider disabling your ad-blockers to support us financially or by donating as anything from $1. Your donation(s) will go a long way in supporting FossMint and sister site, TecMint, in running efficiently. Thank you.

Make a Contribution via PayPal


Top Deals

About the author

Martins D. Okoi

Martins Divine Okoi is a graduate of Computer Science with a passion for Linux and the Open Source community. He works as a Graphic Designer, Web Developer, and programmer.