Linux is a widely used operating system, but what is the language it follows? How do we pass arguments? How do we give commands? Let us find all these answers through this blog.
What Is A Command Line Interface?
Command-line interfaces are also called CLIs. CLIs take input commands that are entered by the keyboard and run them.
The command line interface in Linux systems is bash. It stands for Bourne again shell. The features of this shell include the characteristics of sh (the original Bourne shell), csh (the C shell), and ksh (the Korn shell).
Commands in Linux
Let us study each command one by one.
As the name signifies, it echoes or returns the input we give.
Note that If the parts in the text are separated by white space, it is read as a separate argument. The white space is removed.
Type command is used to determine whether the given command is an external one or a built-in command.
The touch command is used to make new files.
We use cat to create a file, display the file content, copy the content, etc.
The rm command removes a file.
The cp command has the task of copying.
cp old file new file
This command moves a file from one location to other.
mv file_name path of the directory
cat, when reversed, is called tac. It shows the content of the file in a reversed manner.
Use the date command to see the date, time, time zone, and more.
This command gives rest to the terminal for a few seconds.
Time command tells the time to run a command.
If you need to see the disk space used in the file system, use df.
Exit command takes you out of the shell
To exit the terminal, you must press the ENTER key on your keyboard.
Clear command empties the terminal
Press the ENTER key on the keyboard to clear the terminal screen.
Arguments in Linux
The primary feature of a shell is to scan the command line. When we enter an output, it generates an output for the same. It cuts the line in arguments. While the system does the task of scanning, it makes some changes to the typed arguments. We refer to this process as shell expansion.
White Space Elimination
White spaces occupy the space although they are not visible. They get removed while showing results.
Single and Double Quotes
In case you want to include the white spaces, you need to use single and double quotes. In that case, Linux echo will treat them as a single command.
echo 'text' echo "text"
Space and Line
In order to add a tab space or start a new line, use the ‘echo -e’ command. To add a new line use '\n' and '\t' to add a tab space. We can use both single or double quotes.
echo -e ‘text’ echo -e “text”
Frequently Asked Questions
What is the full form of BASH?
BASH stands for Bourne again shell.
State the difference between cat and tac commands.
The Cat command correctly displays the file's content, while the tac command displays it in reverse order.
Which command displays the disk space?
df command displays the disk space.
What is the difference between exit and clear commands?
exit command takes you out of the terminal while the clear command cleans the terminal.
How do we remove a file using some command in the terminal?
We can use the rm command to remove a file.
This article has discussed the commands and arguments in the Linux Operating System. We have studied each command one by one. We hope you got clarity on this topic. To read more about Linux, refer to the following articles-