Linux Commands
Linux Commands
1. pwd Command
The pwd command is used to display the location of the current working
directory.
Syntax:
1. pwd
Output:
2. mkdir Command
Syntax:
Output:
3. rmdir Command
Syntax:
Output:
4. ls Command
Syntax:
1. ls
Output:
5. cd Command
Syntax:
1. cd <directory name>
Output:
6. touch Command
The touch command is used to create empty files. We can create multiple
empty files by executing it once.
Syntax:
Output:
7. cat Command
The cat command is a multi-purpose utility in the Linux system. It can be
used to create a file, display content of the file, copy the content of one
file to another file, and more.
Syntax:
Press "CTRL+ D" keys to save the file. To display the content of the file,
execute it as follows:
Output:
8. rm Command
Syntax:
rm <file name>
Output:
9. cp Command
Output:
10. mv Command
Syntax:
Output:
Syntax:
For example, to convert all the text files into pdf files, execute the below
command:
Output:
Linux File Content Commands
12. head Command
The head command is used to display the content of a file. It displays the
first 10 lines of a file.
Syntax:
Output:
Syntax:
Output:
The tac command is the reverse of cat command, as its name specified. It
displays the file content in reverse order (from the last line).
Syntax:
In more command, the following keys are used to scroll the page:
Syntax:
Output:
The less command is similar to the more command. It also includes some
extra features such as 'adjustment in width and height of the terminal.'
Comparatively, the more command cuts the output in the width of the
terminal.
Syntax:
Output:
Linux Filter Commands
22. cat Command
The cat command is also used as a filter. To filter a file, it is used inside
pipes.
Syntax:
Output:
The cut command is used to select a specific column of a file. The '-d'
option is used as a delimiter, and it can be a space (' '), a slash (/), a
hyphen (-), or anything else. And, the '-f' option is used to specify a
column number.
Syntax:
Output:
The grep is the most powerful and used filter in a Linux system. The 'grep'
stands for "global regular expression print." It is useful for searching
the content from a file. Generally, it is used with the pipe.
Syntax:
Output:
25. comm Command
Syntax:
Output:
The find command is used to find a particular file within a directory. It also
supports various options to find a file such as byname, by type, by date,
and more.
Syntax:
Output:
Syntax:
Output:
The date command is used to display date, time, time zone, and more.
Syntax:
1. date
Output:
The cal command is used to display the current month's calendar with the
current date highlighted.
Syntax:
1. cal<
Output:
42. df Command
The df command is used to display the disk space used in the file system.
It displays the output as in the number of used blocks, available blocks,
and the mounted directory.
Syntax:
1. df
Output:
Syntax:
1. clear
Output: