20 Useful Ubuntu Shell Commands with examples

20 Useful Ubuntu Shell Commands with examples, this article is all about Ubuntu commands. Since Ubuntu is based of Debian most of this commands will work on Debian based systems too. Also, some commands will work on other Linux based distros like Redhat, Arch etc. On a Linux environment, commands are the best ways to do or prefer over the graphic user interface. Because, Linux itself has an intention to teach the user, how an operating system works. There for commands are very important, here goes the most 20 Useful Ubuntu Shell Commands with examples.

20 Useful Ubuntu Shell Commands with examples

1. ls : list directory contents
The ls command will show you the list of files in your current directory.

# ls

2. cd : Change Directory
The cd command will allow you to change directories.

# cd

3. pwd : print the current/working directory The pwd command will allow you to know in which directory you are located

# pwd

4.  mkdir : make/create directory.
The mkdir command will allow you to create directories.

# mkdir

5. rmdir : remove the directory
The rmdir command will delete an empty directory.

# rmdir

6. rm : remove/delete file.
This command to remove or delete a file in your directory.

# rm

7.  mv : rename or move a file/directory The mv command will move a file to a different location or will rename a file.

# mv

8. man : Manual pages for shell commands.
The man command is used to show you the manual of other commands.

# man rm

9. cp : Copy Files
The cp command will make a copy of a file for you.

# cp r_test.txt r1_test.txt

10. shutdown : Shutdown the computer from terminal
This command shutdown the computer

# shutdown ­h or # init 0

11. adduser : Addition of new user
This command creating the new user in /home directory

# adduser ravi

12. passwd : Change password for user
This command change the password of specific user
# passwd ravi

13. tar :  Creates and extracts files from a tape or disk archive This command stores and extracts files from a tape or disk

# tar cvzf ravi.tar.gz *

14. tar :  Creates and extracts files from a tape or disk archive. This command stores and extracts files from a tape or disk

# tar xvzf ravi.tar.gz

15. find :  find searches the file located at / This command find searches the directory tree rooted at each given file
# find / ­name ravi.txt ­print

16. grep :  print lines matching a pattern
This command searches the named input files for lines containing  a   match to the given pattern.

# grep ravi losarwar *

17. chown :  change file owner and group This command  changes the user and/or group ownership of each given file.

# chown ravi ravi.tar.gz

18. chgrp :  change group ownership
This command  change the  group of each file to group

# chgrp ravi ravi.tar.gz

19. chmod :  change file mode bits
This command changes the file mode bits of each given file according to mode

# chmod 777 ravi.tar.gz

20. ifconfig :  configure a network interface
This command  is  used to configure the kernel­resident network interfaces

# ifconfig

“20 Useful Ubuntu Shell Commands with examples”, I hope you like this article and bookmark this page for future references. Thanks for reading.