Basic Linux Commands

1) pwd command

‘pwd’ comma
nd prints the absolute path to current working directory.

2) cal command
Displays the calendar of the current month.

3) echo command

This command will echo whatever you provide it.

4) date command

Displays current time and date.

5) tty command

Displays current terminal.

6) whoami command

This command reveals the user who is currently logged in.

7) id command

This command prints user and groups (UID and GID) of the current user.

8) clear command

This command clears the screen.

9) help option

With almost every command, ‘--help’ option shows usage summary for that command.

10) whatis command

This command gives a one line description about the command. It can be used as a quick reference for any command.

11) Manual Pages

‘--help’ option and ‘whatis’ command do not provide thorough information about the command. For more detailed information, Linux provides man pages and info pages. To see a command's manual page, man command is used.

12) mkdir command

To create a directory, the ‘mkdir’ command is used.

13) touch command

For creating an empty file, use the touch command.

14) copy command

Copy files and directories. If the source is a file, and the destination (file) name does not exit, then source is copied with new name i.e. with the name provided as the destination.

15) To remove or Delete

'rmdir' command removes any empty directories, but cannot delete a directory if a file is present in it. To use ‘rmdir’ command, you must first remove all the files present in the directory you wish to remove (and possibly directories if any).

16) cat command

The 'cat' command is actually a concatenator but can be used to view the contents of a file.

17) pagers

The cat command lists file as a whole. But if the file is big enough to fit into one screen, then we will be able to see only the last page of the file. The commands 'less' and 'more' display files one page at a time. So they are also called pagers. You can navigate through a file using arrow keys. To quit from a pager, hit 'q'.

18) head command

Displays the first few lines of a file. By default, the ‘head’ command displays the first 10 lines of a file. But with -n option, the number of lines to be viewed can be specified.

19) tail command

Similar to ‘head’; the ‘tail’ command shows the last 10 lines by default, and -n option is available as well.

20) wc command

Word count
This command counts lines, words and letters of the input given to it.

21) grep command

The ‘grep’ command searches for a pattern in a file (or standard input). It supports regular expressions. It returns a line if it matches the pattern in that line. So, if we wish to find the lines containing the word ‘nologin’, we use ‘grep’ as follows:

22) ln command

The ln command is used in linux to create links. Links are a kind of shortcuts to other files. The general form of command is:

23) w command

w command is used to check which users are logged in to the system, and what command they are executing at that particular time:

24) netstat command

The ‘netstat’ is a command used to check the network statistics of the system. It will list the current network connections, routing table information, interface statistics, masquerade connections and a lot more information. 

25) history command

History command shows the commands you have entered on your terminal so far.

26) passwd command

To change your password with passwd command.

27) Shutdown Command

In Linux, you can use shutdown command to gracefully halt your system. Most commonly used command is shutdown -h now.



Popular posts from this blog

What is spamming?

shortcut key laptop window 10

Denial-of-service attack