Introduction to Linux - Command line- 3 mins
I always encourage people they should use Linux 🐧 as it is an easy yet powerful environment as an operating system. For that reason, I am starting a series on the Linux operating system. although Linux dominates the server world, I hope one day it will go as a mainstream operating system. On this tutorial, I will write about the powerful command line tools of Linux.
In Linux, the shell interprets commands and script files. There are several shells out there, but most commonly used shell is Bourne-Again shell (sh or bash) and C Shell (csh). Each has its own features sets and way of interpretation but they all share same category of features.
Bourne-Again shell is the default shell for most Linux distributions.
Normally most people use operating system with a Graphical User Interface (GUI) for their daily works. GUI interpret its commands and talk to operating system. Terminal cut the GUI as middle translator and talk directly with OS kernel. So command is much faster, error free but a bit risky.
Some commonly used Linux terminal emulators are-
- KD konsole
To launch a terminal widely used command is + +
If you want the location of emulators you can find it within the directory /usr/share/applications
Commands and execution
When you open a terminal you will see a blinking vertical line. This is called Command Prompt. Default command looks like this-
The breakdown of the composition is-
nabil Username of the logged in user
pc Hostname or the computer name
~ tilde sign means root directory. Here it shows where the terminal is pointing at. If you change to another directory tilde will be replaced by that directory path.
$ prompt symbol. This indicates the end of prompt and start of command which will be typed by the user. If the user is logged is as root a # will replace this sign. Be careful with your commands when you see # in the prompt. Linux consider it an unrestricted super user and accepts all kind of dangerous commands without warning.
Now you should use some command to get the flavor. On your terminal type and press or
This will echo out the text on the command.
Next try following commands one by one-
pwd stands for Present working directory, that means current path of the directory.
ls stands for List. It shows list of files on the current directory. ls accept second arguments for extended use cases. Some of example are given below-
If you want command line history you can use them by pressing for previous commands or for next commands.
If the terminal is clogged up with lots of inputs use clear command to clear the terminal.
If you forget exact spelling of the command; use the built-in auto-complete command by pressing .
That’s all for an introduction. In next tutorial I will show how to search through file system.