S.N | Command | Description |
1 | $ pwd | Display present working directory. |
2 | $ cd $ cd dir_name $ cd .. | To change directory. To enter to the dir_name To return one step back to higher order directory |
3 | $ mkdir dir_name $ mkdir dir1/dir2/dir3 | To make a new directory named dir_name. To make a new directory within a directory. |
3 | $ ifconfig | To display all the active network interface details on the machine/server. |
4 | $ ls $ ls –a $ ls -R | To view the content in the directory. (Doesn’t show hidden files) Shows all the content in the directory. (Displays all the hidden files too) List all the contents inside the current directory and subdirectories. |
5 | $ cat > filename $ cat filename $ cat >> filename | To create a new file. To display content of a file. To add text to an existing file. |
6 | $cp src_file dest_file | To copy a file to a destination directory. |
7 | $mv src_file dest_file | To move a file to a destination directory |
8 | $ rm file_name $ rm file1 file2 file3 $ rm -r dir_name | To delete a file. To delete multiple file To delete a non empty directory |
9 | $rmdir dir_name | To delete an empty directory. |
10 | $grep search_word file_name | To search for a word i.e. “search_word” in a file. |
10 | $sudo | To perform tasks that require administrative or root permission. |
11 | $ clear | To clear the terminal window |
12 | $ history | To display all the commands typed in the terminal. |
13 | $ whoami | To print the username associated with the current effective user ID. |
14 | $ find | To find files in the current directory. |
15 | $ date | To display current time and date in set format. |
16 | $ cal | To display calendar of running month |
17 | $ chmod $ chmod 777 filename $ chmod 000 filename | To change the access permissions of each given file according to the mode. To give all read,write and execute permission to all the users. To deny all the permission to all the users. |
18 | $ chown | To change the user/group ownership of a file to a new owner/group. |
19 | $ ping ip_addr | To test the ability of source computer to reach a specified destination computer |
20 | $ echo Hello World $ echo Hello world > test.txt | To print the statement written after echo. To create a new file with the following text. |
21 | $ sort filename | To sort the content of the file numerically/alphabetically. |
22 | $ wget “download_url” | To download files from the internet directly. |
23 | $ apt | Package manager to automate the process of installing and removing applications |
24 | $ tar -cf newzip.tar file1 file2 | To create a zip file |
25 | $ touch new_file | To create a new file in the current directory. |
26 | $ reboot | To reboot, halt or shutdown the system |
NETWORKING COMMANDS
S.N | Command | Description |
1 | ifconfig |
|
2 | traceroute |
|
3 | tracepath | similar to traceroute but doesn’t require root privileges. |
4 | ping <domainName> |
|
5 | netstat |
|
6 | ss |
|
7 | nslookup <domainName> |
|
8 | ifplugstatus |
|
9 | ssh ssh username@hostid |
|
10 | $ whois <domainName> | displays a website's record like information of a website registration and owner’s information. |
11 | $ iwconfig | configures a wireless network interface. |
12 | $ arp |
|
13 | scp $ scpname_of_file yourusername@host_name : / path1/ path2/ directory_name |
|
These are the basic Linux Commands.
Hope this helps!