Command Line Interface is a bonus under GNU/Linux systems. With commands you can perform virtually any task & that too in a jiffy. If you dream of administering Linux system then having a strong grip over commands will help you a long way in your endeavor. In this article, I will walk through some basic commands which will come handy. Treat these commands as your foundation of Command Line Interface under Linux. Let’s begin!
Where to enter the commands?
Commands are entered into what goes by the name Shell, Terminal, Konsole or Console. Don’t ponder much for now, all the above refer basically to one & the same thing. There are numerous types of shell but the one which you will use most of the times will be sh.(As you learn Linux in depth, you will get a more clear understanding of Shell).If you are on an KDE desktop then you will have Konsole. If you’re on GNOME desktop then you will have Terminal. Console is yet another generic term. Whenever you encounter a command open Konsole(Right click on KDE desktop) or Terminal(Application>System Tools>Terminal under GNOME desktop) & start entering command as you would enter any normal text. Hit ‘Enter’ or ‘Return’ key to execute the entered command.
How to use Commands?
Before dabbling into commands you must know exactly how to use them. Here I will give you some pointers which you must engrave in your brain, once & for all.
1) Commands are case sensitive. E.G. ‘DATE’ is not the same as ‘date’. Be careful while typing them under console. Verify whether Caps Lock is disabled on your keyboard.
2) Spaces between commands too hold significance. If you omit them the output will most likely be ‘Unknown’ or ‘Bad’ command.
3) Enter the commands exactly as you read or were told to. A minor spelling/typing error is enough to make you pull out your hair in despair.
4) Some commands require root privileges (permissions) to be obtained before they can be executed. Do so by prefixing ‘su’ before the command.
5) A $ symbol represents a normal user login and a # symbol represents root login under the shell.
1) To know the current Time & Date enter;
2) To know the directory under which you are currently working enter;
3) To get a list of files & sub-directories under a directory enter;
4) To jump from your current directory to another directory e.g. /var/log enter;
5) To copy a file (Linux.doc) from one directory (/home/Gaurav) to another directory (/home/Gaurav/Documents);
cp /home/Gaurav/Linux.doc /home/Gaurav/Documents
7) To move a file (Linux.doc) from one directory (/home/Gaurav) to another directory (/home/Gaurav/Documents);
mv /home/Gaurav/Linux.doc /home/Gaurav/Documents
8 ) To delete file (Linux.doc) present under the directory (/home/Gaurav) enter;
9) To delete a directory (/home/Gaurav/Documents) which contains files & sub directories;
rm –rf /home/Gaurav/Documents
10) To change the password of the user currently logged in;
Now get going & try out the above commands. It would be of great help if you print out the above & paste it near your computer desk for a quick reference in your early days with Linux. To tell you, these commands do not even constitute even one percent of the GNU/Linux commands. These commands are building blocks to learn the Linux command system in great detail. Don’t get intimidated, its fun to use commands when you get familiar with them. 🙂