Ubuntu is one of the most popular distributions of Linux, known for its user-friendly interface and robust features. Whether you're a beginner or an experienced user, understanding basic Ubuntu commands is essential for navigating and managing your system efficiently. In this article, we'll explore 25 fundamental Ubuntu commands along with detailed descriptions, syntax, examples, and explanations.
1. ls - List Directory Contents
The ls command is used to list directory contents.
Syntax:
ls [options] [directory]
Example:
ls Desktop/
Listing content inside Desktop directory
This command lists the contents of the Desktop directory.
2. cd - Change Directory
The cd command is used to change the current working directory.
Syntax:
cd [directory]
The cd command is used to change the current working directory.
Example:
cd Desktop/
changing directory
This command changes the current directory to Desktop/. Here we have used pwd command to display the current directory.
3. pwd - Print Working Directory
The pwd command displays the current working directory.
Syntax:
pwd
Example:
pwd
displaying the current directory
This command prints the current working directory.
4. mkdir - Make Directory
The mkdir command is used to create a new directory.
Syntax:
mkdir [directory_name]
Example:
mkdir new_folder
creaking directory
This command creates a new directory named new_folder. Here we have used ls command to display the files in the current directory.
5. rm - Remove
The rm command is used to remove files or directories.
Syntax:
rm [options] [file/directory]
Example:
rm new_file
removing file
This command removes the file named new_file. Here we have used ls command to display the files in the current directory.
6. cp - Copy
The cp command is used to copy files or directories.
Syntax:
cp [options] [source] [destination]
Example:
cp file1.txt file2.txt
This command copies file1.txt to file2.txt.
7. mv - Move
The mv command is used to move files or directories.
Syntax:
mv [options] [source] [destination]
Example:
mv file1.txt /path/to/new/location
This command moves file1.txt to /path/to/new/location.
8. touch - Create Empty File
The touch command is used to create an empty file.
Syntax:
touch [file_name]
Example:
touch newfile.txt
creating text file
This command creates an empty file named newfile.txt. Here we have used ls command to display the files in the current directory.
9. cat - Concatenate and Display
The cat command is used to display the contents of a file.
Syntax:
cat [file]
Example:
cat newfile.txt
displaying text inside text fileThis command displays the contents of newfile.txt.
10. nano - Text Editor
The nano command launches the Nano text editor.
Syntax:
nano [file_name]
Example:
nano newfile.txt
editing text file
This command opens newfile.txt in the Nano text editor.
11. grep - Search
The grep command is used to search for patterns in files.
Syntax:
grep [options] [pattern] [file]
Example:
grep "pattern" file.txt
searching pattern inside the text file
This command searches for the specified pattern in file.txt.
12. sudo - Superuser Do
The sudo command allows users to execute commands with superuser privileges.
Syntax:
sudo [command]
Example:
sudo apt-get update
updating package manager
This command updates the package lists using apt-get with superuser privileges.
13. apt-get - Package Manager
The apt-get command is used to manage software packages.
Syntax:
sudo apt-get [options] [command]
Example:
sudo apt-get install package_name
This command installs a package named package_name.
14. dpkg - Package Manager
The dpkg command is used to install, remove, and manage Debian packages.
Syntax:
sudo dpkg [options] [command]
Example:
sudo dpkg -i package.deb
This command installs a Debian package named package.deb.
15. wget - Download
The wget command is used to download files from the internet.
Syntax:
wget [URL]
Example:
wget http://example.com/file.zip
This command downloads a file named file.zip from the specified URL.
16. chmod - Change Mode
The chmod command is used to change file permissions.
Syntax:
chmod [options] [mode] [file]
Example:
chmod 755 file.sh
This command changes the permissions of file.sh to 755.
17. chown - Change Owner
The chown command is used to change file ownership.
Syntax:
chown [options] [owner:group] [file]
Example:
chown user:group file.txt
This command changes the owner and group of file.txt.
18. tar - Tape Archive
The tar command is used to create and extract tar archives.
Syntax:
tar [options] [archive_name.tar.gz] [files/directories]
Example:
tar -cvzf archive.tar.gz directory
This command creates a compressed tar archive named archive.tar.gz from the directory
The uname command prints system information such as kernel version and architecture.
Syntax:
uname [options]
Example:
uname -a
This command displays all available system information.
20. date - Display Date and Time
The date command displays the current date and time.
Syntax:
date [options]
Example:
date
displaying date This command prints the current date and time.
21. shutdown - Shutdown or Restart System
The shutdown command is used to shut down or restart the system.
Syntax:
sudo shutdown [options]
Example:
sudo shutdown -h now
This command shuts down the system immediately.
22. ps - Process Status
The ps command displays information about active processes.
Syntax:
ps [options]
Example:
ps aux
list all running process
This command lists all running processes.
23. top - Display System Activity
The top command displays real-time information about system activity.
Syntax:
top
Example:
top
displaying dynamic information
This command displays dynamic information about system processes.
24. du - Disk Usage
The du command is used to estimate file and directory space usage.
Syntax:
du [options] [directory]
Example:
du -sh /path/to/directory
This command displays the disk usage of the specified directory.
25. df - Disk Free
The df command displays disk space usage for filesystems.
Syntax:
df [options]
Example:
df -h
display disk space
This command displays disk space usage in a human-readable format.
Conclusion
These 25 basic Ubuntu commands provide a solid foundation for navigating and managing your Linux system effectively. As you continue to explore Ubuntu and Linux, you'll discover more commands and techniques to streamline your workflow and enhance your productivity. Experiment with these commands in your terminal to become more proficient in using Ubuntu.
Similar Reads
25 basic Ubuntu Commands
Ubuntu is one of the most popular distributions of Linux, known for its user-friendly interface and robust features. Whether you're a beginner or an experienced user, understanding basic Ubuntu commands is essential for navigating and managing your system efficiently. In this article, we'll explore
5 min read
Basic vi Commands
Text editors are essential tools for any programmer or computer enthusiast. One popular text editor that has been around for decades and is still widely used is vi (pronounced "vee-eye"). vi is a terminal-based text editor that offers powerful editing capabilities once you understand its basic comma
7 min read
Basic Vim Commands
In this article, we will cover some basic commands in the Vim editor. First, we look at what Linux and VIM editors are and why we use them, followed by basic commands in Vim editor starting from creating/editing a file, different modes, quitting the editor, saving the changes to the file, navigation
5 min read
Basic Shell Commands in Linux
A shell is a special user program that provides an interface to the user to use operating system services. Shell accepts human-readable commands from the user and converts them into something which the kernel can understand. It is a command language interpreter that executes commands read from input
3 min read
25 Basic Linux Commands For Beginners [2025]
While performing a task, we all need shortcuts. Shortcuts help us to complete a task quickly. Linux comes with such commands which are one to two words, using that commands, you can perform several operations in no time. As a beginner, you must be aware of those basic Linux commands to complete an o
13 min read
Basic CentOS Linux Commands in linux
CentOS is a free and open-source operating system that aims to provide a stable reliable, and community-supported platform for servers and other enterprise applications. In this article, we will be covering CentOS Linux basics commands and functions of CentOS and also we will look into the advanced
3 min read
Ansible - Ad hoc Commands
Ansible ad hoc commands are simple, one-time tasks you can do on other computers. They use a tool called /usr/bin/ansible. These commands are quick and easy, but you can't save them for later use. Why learn about ad hoc commands? They show how easy and powerful Ansible is. What you learn here will h
9 min read
What is a Command?
A command typically refers to an order given to a computer program or operating system to perform a specific task. It's usually entered via a command line interface or a terminal. Commands can vary widely depending on the context, the operating system being used, and the specific program or utility
5 min read
Linux Commands
Linux is an operating system that is similar to Unix. In Linux, all commands are executed in a terminal that is provided by the system. This terminal is similar to the command prompt in Windows. It's important to note that Linux/Unix commands are case-sensitive. A Linux command can be a program or a
15+ min read
Chaining Commands in Linux
Chaining commands in Linux is a powerful technique that allows you to execute multiple commands sequentially or simultaneously through the terminal. This approach resembles writing short shell scripts that can be directly executed in the terminal, enhancing the efficiency of your workflow. By using
7 min read
Mininet Commands
Mininet is a network emulator used to create virtual network topologies. It allows you to simulate complex networks on a single machine by creating virtual hosts, switches, routers, and links. This is useful for testing before deploying them in real-world scenarios. Running sudo mn in your terminal
4 min read
Batch Script - Echo Command
Batch script is a type of scripting language used in Windows operating systems to automate repetitive tasks, perform system administration functions, and execute a series of commands. The echo command is one of the most commonly used commands in batch scripting, used to display text or messages on t
8 min read
What is a Command Key?
A Command Key, often referred to as the "Cmd" key, is a modifier key found on Apple keyboards. It is used to perform various commands, often in conjunction with other keys. The Command Key can be compared to the Control (Ctrl) key on Windows keyboards. Alternatively called the Beanie key, Cloverleaf
10 min read
Fun Commands in Linux
Linux isn't just for coding and administration—it can also be a lot of fun. With a variety of terminal commands, you can add some entertainment to your Linux experience. Below is a list of some cool and fun commands you can use in Linux to enhance your terminal experience. We’ll also cover how to in
4 min read
Linux Commands Cheat Sheet
Linux, often associated with being a complex operating system primarily used by developers, may not necessarily fit that description entirely. While it can initially appear challenging for beginners, once you immerse yourself in the Linux world, you may find it difficult to return to your previous W
13 min read
Useful and time saving bash commands in Linux
There are many useful bash scripts that can make things easier. Many things can be done just using the terminal. Here is a list of some of such useful bash scripts through which we can do things that cannot be done manually. 1. Counting the number of files(or directory) in a given directory: Go to t
3 min read
dos2unix and unix2dos commands
Sometimes, you will need to move files between windows and unix systems. Window files use the same format as Dos, where the end of line is signified by two characters, Carriage Return or CR or \r followed by Line Feed or LF or \n. Unix files, on the other hand, use only Line Feed (\n). unix2dos is a
4 min read
MATLAB Commands
MATLAB is an interactive multi-programming language and numeric computing environment developed by MathWorks. MATLAB provides the Commands that will be used when the user wants to interact with any application using the command line interface. Following are the lists of commands used in MATLAB. Comm
3 min read
How to Build Your Own Commands in Linux?
Linux is one of the most widely used open-source operating systems which supports both GUI as well as CLI. It has been widely used all over the world since its first distribution launched on September 17, 1991, by Linus Torvalds. It is widely known for its command-line operations. We have been using
6 min read