Even for us fast typists, our hands start to complain after a few hours or more of banging on our keyboards. Sometimes the best thing to do is what is really the only apparent chance of survival—shorten all these abbreviations even more.Please note, this guide is intended to be used by Linux and Unix users. Yes, Mac users… if you can believe it, Mac is all Unix on the inside.
I recommend viewing the Feedback section of this article; it contains a different and probably better method of carrying this out.
So, let’s get started! It won’t take too long to abbreviate some of the most commonly-used commands. All we have to do is make symbolic links for all these commands, most of which live in our executable directory of /usr/bin. We’re going to take advantage of the fact that most programs never use one-letter commands. So, open up a new terminal, and let’s soothe those tired hands!
Type a quick
su command to prevent the need of constantly temporarily running a super-user command. You’ll probably be asked for the root password.
Change to the executable directory, /usr/bin, by typing
One of the most popular commands in the Linux terminal is the sudo command, so let’s get that one shortened first. Note that this is already an abbreviation for super user—but what the heck, sudo is still three letters longer than we need it to be.
To prevent any crashing, corruption, or explosion of your system, I strongly recommend not to just rename the file! That would probably cause major problems in the future. Instead, we’re going to use the symbolic link method which I mentioned earlier. Type:
ln -s sudo s
This is creating a link, noting that it is symbolic (with the
-s switch) and giving our input and output files.
Now, whenever you would like to execute a file as a super user, you only need to type two keystrokes instead of five (counting the space between commands). For example:
s apt-get autoremove
Much easier, right? But not easy enough! Let’s keep going! Exemplified in the command above, apt-get is another popular—but unfortunately long—command. We’re going to fix that right now, and shorten the command by 6 characters. Simply type this:
ln -s apt-get g
Now our earlier example is abbreviated to this short line:
s g autoremove
Unfortunately, I will not go into abbreviating parameters like autoremove, as that is much more difficult and probably too scary for the new Linux/Unix/Mac terminal user.
However, there are still a plethora of commonly-used commands that are just waiting to be shortened. I will publish a list of recommended abbreviations later on.
Scary-reasoner made a good point about how creating symbolic links in /usr/bin is not the best idea for your system. Instead, you can create shell aliases, which were made for this very reason (and others). Here’s a quick example of creating an alias instead of a symlink for the sudo command:
That will do it for you. The sudo command now has an alias of s. Let’s do one more, to ensure understanding.. I’ll show the apt-get shortening command:
Did you find this article useful? Please leave a comment to let me know. Don’t worry, you don’t need to register for a simple comment.