Topics Map > IT Operations
Terminal Commands on Ubuntu
Understanding the Terminal
On an Ubuntu system you can find a launcher for the terminal by clicking on the Activities item at the top left of the screen or pressing the windows key, then typing the first few letters of “terminal”, “command”, “prompt” or “shell”. You can also simply use the keyboard shortcut Ctrl + Alt + T to open a new terminal window.
Basic Terminal Commands
Terminal commands to perform basic functions and troubleshooting on Ubuntu
Command |
Explanation |
Example |
---|---|---|
sudo |
Used before a command to run as root or an administrator. |
|
ls |
This command stands for list, it lIsts down all the directories and files inside the present working directory or specified directory |
|
ls -l |
This command stands for Long listing, this allows you to see additional details about files like file size, permission, modified time, etc. |
|
cd |
This command stands for change directory; with this, you can change your location and move to another directory. |
|
rm |
This command stands for remove, this is used to delete files. |
|
mv |
This command stands for move, it allows you move a file to a different location. |
|
dir |
This command is used to display the list of all directories or folders in the current directory. |
|
mkdir |
This command stands for make directory, this allows you to make directories/folders. |
|
pwd |
This command shows the current working directory's path |
|
hostname |
This command shows the hostname of the computer |
|
chown |
This command is used to change the ownership of a file or directory |
|
apt |
The apt command is used for installing, removing and managing packages in Ubuntu. It has to be used with sudo because these are administrative tasks. |
|
sudo apt-get update |
This command fetches the latest version of each package but will not actually download or install any of those updates. |
|
sudo apt-get upgrade |
This command downloads and installs the updates for each outdated package and dependency on your system |
|
ip a |
This command is used to find the ip address of a computer |
|
ifconfig |
This command is used to display networking information about a computer |
|
clear |
This command allows you to clear the terminal. It is useful if your terminal screen is flooded and you want to do something new. |
|
exit |
This command is used to exit the terminal |
|
shutdown -now |
This command is used to shutdown a computer immediately. |
|