In this tutorial, we will learn about the most-used Linux Terminal commands for beginners with examples and syntax.
If you’re new to Ubuntu or Linux in general, mastering the terminal can significantly enhance your productivity and understanding of the operating system. In this blog, we will cover 30 fundamental commands, complete with syntax and examples, to help you get started.
What is the Linux Terminal?
The Linux terminal is a command-line interface that allows users to interact with the operating system by typing commands. It provides a powerful way to perform tasks quickly and efficiently. While it may seem daunting at first, with practice, you’ll find it to be an invaluable tool.
Linux Terminal Commands for Beginners With Examples
1. pwd
Syntax: pwd
The pwd command stands for “print working directory.” It displays the current directory you are in.
Example:
$ pwd
/home/username
2. ls
Syntax: ls [options] [directory]
The ls command lists files and directories in the current directory.
Example:
$ ls -l
3. cd
Syntax: cd [directory]
The cd command changes the current directory.
Example:
$ cd Documents
4. clear
Syntax: clear
The clear command clears the terminal screen.
Example:
$ clear
File and Directory Management
5. mkdir
Syntax: mkdir [directory_name]
The mkdir command creates a new directory.
Example:
$ mkdir new_folder
6. rmdir
Syntax: rmdir [directory_name]
The rmdir command removes an empty directory.
Example:
$ rmdir empty_folder
7. touch
Syntax: touch [file_name]
The touch command creates a new empty file or updates the timestamp of an existing file.
Example:
$ touch newfile.txt
8. cp
Syntax: cp [source] [destination]
The cp command copies files or directories.
Example:
$ cp file.txt backup_file.txt
9. mv
Syntax: mv [source] [destination]
The mv command moves or renames files or directories.
Example:
$ mv oldname.txt newname.txt
10. rm
Syntax: rm [file_name]
The rm command removes files or directories.
Example:
$ rm unwanted_file.txt
System Information
11. uname
Syntax: uname [options]
The uname command displays system information.
Example:
$ uname -a
12. top
Syntax: top
The top command shows real-time system processes and resource usage.
Example:
$ top
13. df
Syntax: df [options]
The df command displays disk space usage.
Example:
$ df -h
14. free
Syntax: free [options]
The free command shows memory usage.
Example:
$ free -h
Networking Commands
15. ping
Syntax: ping [hostname]
The ping command checks connectivity to a host.
Example:
$ ping google.com
16. ifconfig
Syntax: ifconfig
The ifconfig command displays network interface configuration.
Example:
$ ifconfig
17. wget
Syntax: wget [URL]
The wget command downloads files from the web.
Example:
$ wget http://example.com/file.zip
18. curl
Syntax: curl [options] [URL]
The curl command transfers data from or to a server.
Example:
$ curl -O http://example.com/file.zip
Process Management
19. ps
Syntax: ps [options]
The ps command displays currently running processes.
Example:
$ ps aux
20. kill
Syntax: kill [PID]
The kill command terminates a process by its process ID (PID).
Example:
$ kill 1234
21. htop
Syntax: htop
The htop command is an interactive process viewer (requires installation).
Example:
$ htop
Package Management
22. apt update
Syntax: sudo apt update
The apt update command updates the package index.
Example:
$ sudo apt update
23. apt upgrade
Syntax: sudo apt upgrade
The apt upgrade command upgrades installed packages.
Example:
$ sudo apt upgrade
24. apt install
Syntax: sudo apt install [package_name]
The apt install command installs a new package.
Example:
$ sudo apt install vim
25. apt remove
Syntax: sudo apt remove [package_name]
The apt remove command removes an installed package.
Example:
$ sudo apt remove vim
Congratulations! You’ve just learned 30 essential Linux terminal commands that will help you navigate and manage your Ubuntu system more effectively.
By mastering these commands, you’ll be well on your way to becoming proficient in using the Linux terminal. If you have any questions or need further assistance, feel free to ask!
