Ubuntu is one of the most widely used Linux-based operating systems. Thanks to its open-source structure, security, and stability, it has become a preferred choice not only for individual users but also for businesses. However, in order to use Ubuntu effectively, it is essential to understand the basic command-line operations. In this guide, we will explore the most commonly used Ubuntu commands in detail.
pwd (Print Working Directory): Displays the full path of the current working directory. Usage: pwd
ls (List): Lists files and directories. Usage: ls, ls -l (detailed), ls -a (shows hidden files).
cd (Change Directory): Switches between directories. Example: cd /home, cd .. (go up one level), cd ~ (return to home directory).
mkdir: Creates a new directory. Example: mkdir project
rmdir: Removes an empty directory. Example: rmdir project
touch: Creates a new empty file. Example: touch test.txt
rm: Deletes files. Example: rm file.txt, rm -r folder (removes a folder and its contents)
cp: Copies files or directories. Example: cp source.txt target.txt, cp -r folder1 folder2
mv: Moves or renames files and directories. Example: mv old.txt new.txt, mv file.txt /home/user/
cat: Displays the entire content of a file. Example: cat file.txt
less: Views large files page by page. Example: less file.txt
head / tail: Shows the beginning or end of a file. Example: head -n 10 file.txt, tail -n 10 file.txt
uname: Displays system information. Example: uname -a
df: Shows disk usage. Example: df -h
free: Displays memory usage. Example: free -h
top / htop: Displays running processes and resource usage. Usage: top, htop (requires separate installation)
Ubuntu uses APT (Advanced Package Tool) for package management.
sudo apt update → Updates package lists
sudo apt upgrade → Upgrades installed packages
sudo apt install package-name → Installs a new package
sudo apt remove package-name → Removes a package
sudo apt autoremove → Removes unused dependencies
whoami: Displays the current logged-in user
adduser username: Adds a new user
passwd username: Changes a user password
sudo: Executes commands with administrative privileges
ping: Tests network connectivity. Example: ping google.com
ifconfig / ip a: Displays network interface information
wget / curl: Downloads files from the internet. Example: wget file-link, curl -O file-link
Mastering basic Ubuntu commands provides significant advantages for both individual users and businesses. From server management to daily operations, knowing how to use the command line increases efficiency, enhances security, and ensures smoother workflows. Especially for those managing VDS or dedicated servers on Ubuntu, these commands are essential tools for effective system administration.