ADVERTISEMENTS
General Discussion

What is Your Favourite Command Line Trick?

Linux Favourite Command Line Trick
Written by Divine
ADVERTISEMENTS

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.

ADVERTISEMENTS

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!

  10 Reasons Why Your Business Is Better Off With A Linux Server

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.

ADVERTISEMENTS

About the author

Divine

Divine is a graduate student who loves the Open Source community. With 700+ articles under his belt, he continues to recommend the best software that the app market has to offer while tackling several topics in IT.