An Introduction to Linux Shell Commands
By Erick M Aqqa
The Linux system often intimidates beginners, what with the need to type in a command or two every now and then. However, Linux commands (or shell commands, to put it more accurately) follow a rather logical and sensible pattern and all you need to do is get used to it! Most shell commands are roughly 3, or at most 4 letters long. The more frequently needed commands are shortened further usually.
The man command is a reference to ‘manual’, i.e. the documentation that comes preloaded in Linux systems to help you with common problems faced by a user. These man(ual) pages are certainly not meant to be standalone guides for beginners, but instead, they need to be used as reference material to corroborate what you’ve learnt/tried elsewhere.
The info command is another way to look up reference material for GNU information and troubleshooting suggestions. It isn’t completely the same as the man pages, as there is a scope for using ‘hyperlinks’, to make it easier to browse through the material you need. There are shortcuts for scrolling through pages too.
The date command is self-explanatory. It will tell you about the current time and date on the system. On those lines, the cal command will display a neat calendar of the current month (or that of any particular one you choose).
The ls command is meant to help you list the contents of the directory you choose. This means that you will get to see all the files and directories inside your current directory.This command also has switches to modify its behavior and functionality. For example, adding -l after ls will give you a more detailed description of the contents of the directory you’re in. you’ll get to see details about file permissions, modification dates, groups, sizes and owners. The -a switch helps you see all the files in your current directory, including the hidden ones. (Hidden files in Linux have their filenames starting with a ‘.’ i.e. a period)
In case you lose track of the current directory you are in, type pwd, which prints the current directory you are working in. Once you’ve got to know that, you can navigate around the Linux file system using the cd command, where ‘cd’ stands for ‘change directory’. This can work on both relative and absolute terms, i.e., you can work by specifying the entire directory, starting from ‘/’ (the home directory) to the directory/file you want to go to. Otherwise, you can also use the ‘.’ or ‘..’ system. The latter tells the compiler that you want to go to the parent directory of your current one, making it an easy alternative to typing the entire path every time.
When you start working with simple files, like text files, the cat command will come in handy. It ‘concatenates’ the content of one or more text files, letting you see all of the text they contain.
The ps command lists all the processes currently running on your system in your current terminal.
The shell commands in this article are a good way to start off in the Linux environment. They are simple enough for you to get an idea of how the entire system works, and will probably help you to try out more advanced steps later!
To know more about Linux shell commands, click here
Linux2Aix is an upbeat Linux blog containing all the latest and the newest Linus news and how-to’s for both amateur and professional Linux lovers