Topics Map > IT Operations
Topics Map > Instructional Technology

Terminal Commands on Ubuntu

Essential terminal commands to perform basic functions and troubleshooting 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.

“sudo apt-get update”

ls

This command stands for list, it lIsts down all the directories and files inside the present working directory or specified directory

“ls”, “ls desktop” 

ls -l

This command stands for Long listing, this allows you to see additional details about files like file size, permission, modified time, etc.

“ls -l” “ls -l Desktop”

cd

This command stands for change directory; with this, you can change your location and move to another directory.

“cd”, “cd Downloads”

rm

This command stands for remove, this is used to delete files.

“rm [useless_file]”

mv

This command stands for move, it allows you move a file to a different location. 

“mv ”

dir

This command is used to display the list of all directories or folders in the current directory. 

“dir”, “dir Downloads”

mkdir

This command stands for make directory, this allows you to make directories/folders.

“mk dir new_folder”

pwd

This command shows the current working directory's path

"pwd"

hostname

This command shows the hostname of the computer

''hostname"

chown

This command is used to change the ownership of a file or directory

"sudo chown  [user] [filename]"

"sudo chown ojieok read.txt"

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.

Install: “sudo apt install new_file ”

Remove: ”sudo apt remove daniel_sharpiro”

Update System: “sudo apt update && sudo apt upgrade”

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 update” 

sudo apt-get upgrade

This command downloads and installs the updates for each outdated package and dependency on your system

“sudo apt-get upgrade”

ip a

This command is used to find the ip address of a computer

“ip a”

ifconfig 

This command is used to display networking information about a computer

“ifconfig ”

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.

“clear”

exit

This command is used to exit the terminal

“exit”

shutdown -now

This command is used to shutdown a computer immediately.

“shutdown -now”





Keywordsterminal commands cmd sudo ls cd Ubuntu   Doc ID128540
OwnerOjie O.GroupUMD Engineering IT
Created2023-05-24 14:55:56Updated2024-01-11 15:44:40
SitesUniversity of Maryland Engineering IT
Feedback  6   0