Top 100 Linux Commands for Beginners (With Examples)

Mastering Linux begins with the command line. For beginners, learning the most commonly used Linux commands is the first step toward becoming confident in system navigation, file management, user administration, and more.

This guide covers the top 100 Linux commands, grouped into practical categories, each explained with beginner-friendly examples. Bookmark this article and start practicing right from your terminal!

πŸ“ 1. File and Directory Management Commands

These commands help you navigate and manipulate files and directories.

  1. pwd – Prints the current working directory.
    Example: pwd
  2. ls – Lists files and directories.
    Example: ls -l
  3. cd – Changes the current directory.
    Example: cd /home/user/Documents
  4. mkdir – Creates a new directory.
    Example: mkdir myfolder
  5. rmdir – Removes an empty directory.
    Example: rmdir myfolder
  6. rm – Deletes a file or directory.
    Example: rm file.txt, rm -r folder/
  7. cp – Copies files or directories.
    Example: cp file1.txt file2.txt
  8. mv – Moves or renames files/directories.
    Example: mv old.txt new.txt
  9. touch – Creates an empty file.
    Example: touch notes.txt
  10. tree – Displays the directory structure in tree format.
    Example: tree

πŸ“„ 2. File Viewing and Text Handling

Use these commands to read or manipulate file content.

  1. cat – Displays the contents of a file.
    Example: cat file.txt
  2. less – Views file contents one page at a time.
    Example: less file.txt
  3. more – Similar to less, for paginated viewing.
    Example: more file.txt
  4. head – Shows the first few lines of a file.
    Example: head file.txt
  5. tail – Shows the last few lines of a file.
    Example: tail file.txt
  6. echo – Prints a message or writes to a file.
    Example: echo "Hello World" > hello.txt
  7. nano – Opens the nano text editor.
    Example: nano file.txt
  8. vi / vim – Opens the vi/vim editor.
    Example: vim file.txt
  9. cat > – Creates and writes to a file.
    Example: cat > new.txt then type content, press Ctrl+D
  10. cat >> – Appends content to a file.
    Example: cat >> new.txt then type content, press Ctrl+D

πŸ” 3. Search and Find

Quickly locate files or text within files.

  1. find – Finds files and directories.
    Example: find . -name "*.txt"
  2. locate – Fast file search using a database.
    Example: locate passwd
  3. grep – Searches text in files.
    Example: grep "search" file.txt
  4. which – Shows the path of an executable.
    Example: which python
  5. whereis – Locates source, binary, and man pages.
    Example: whereis ls
  6. type – Describes a command type.
    Example: type cd

βš™οΈ 4. File Permissions and Ownership

Manage access rights to files and directories.

  1. chmod – Changes file permissions.
    Example: chmod 755 script.sh
  2. chown – Changes file owner and group.
    Example: chown user:group file.txt
  3. chgrp – Changes group ownership.
    Example: chgrp staff file.txt
  4. umask – Displays or sets default permission mask.
    Example: umask
  5. stat – Displays detailed file info.
    Example: stat file.txt

πŸ“¦ 5. Package Management (Debian/Ubuntu)

Install and manage software packages.

  1. apt update – Updates the package list.
    Example: sudo apt update
  2. apt upgrade – Upgrades all upgradable packages.
    Example: sudo apt upgrade
  3. apt install – Installs a new package.
    Example: sudo apt install nginx
  4. apt remove – Removes a package.
    Example: sudo apt remove nginx
  5. dpkg -i – Installs a .deb package manually.
    Example: sudo dpkg -i package.deb

πŸ’» 6. System Monitoring and Info

Keep an eye on system performance and status.

  1. top – Displays running processes.
    Example: top
  2. htop – Interactive process viewer.
    Example: htop
  3. uptime – Shows how long the system has been running.
    Example: uptime
  4. free – Displays memory usage.
    Example: free -h
  5. df – Displays disk space usage.
    Example: df -h
  6. du – Estimates file or directory size.
    Example: du -sh *
  7. ps – Displays running processes.
    Example: ps aux
  8. uname -a – Shows kernel and system info.
    Example: uname -a
  9. whoami – Prints current username.
    Example: whoami
  10. id – Displays UID and GID.
    Example: id

🌐 7. Networking Commands

Check and troubleshoot network-related settings.

  1. ping – Checks connectivity to a host.
    Example: ping google.com
  2. curl – Sends HTTP requests.
    Example: curl example.com
  3. wget – Downloads files from the web.
    Example: wget http://example.com/file.zip
  4. ip a – Shows IP address details.
    Example: ip a
  5. netstat – Displays open ports and connections.
    Example: netstat -tuln
  6. ss – Modern alternative to netstat.
    Example: ss -tuln
  7. traceroute – Traces network path to a host.
    Example: traceroute google.com
  8. nslookup – DNS lookup tool.
    Example: nslookup github.com
  9. hostname – Displays or sets system hostname.
    Example: hostname

πŸ‘₯ 8. User and Group Management

Manage users, groups, and access control.

  1. adduser – Adds a new user.
    Example: sudo adduser testuser
  2. deluser – Deletes a user.
    Example: sudo deluser testuser
  3. passwd – Changes user password.
    Example: passwd
  4. usermod – Modifies a user account.
    Example: sudo usermod -aG sudo testuser
  5. groupadd – Creates a new group.
    Example: sudo groupadd developers
  6. groups – Shows groups of a user.
    Example: groups

πŸ“¦ 9. Archiving and Compression

Work with .tar, .zip, .gz files.

  1. tar -cvf – Archives files.
    Example: tar -cvf backup.tar folder/
  2. tar -xvf – Extracts tar files.
    Example: tar -xvf backup.tar
  3. gzip – Compresses a file.
    Example: gzip file.txt
  4. gunzip – Decompresses .gz files.
    Example: gunzip file.txt.gz
  5. zip – Creates a zip archive.
    Example: zip archive.zip file.txt
  6. unzip – Extracts zip files.
    Example: unzip archive.zip

🧰 10. Disk & Storage Management

Work with partitions and drives.

  1. mount – Mounts a device.
    Example: mount /dev/sdb1 /mnt
  2. umount – Unmounts a device.
    Example: umount /mnt
  3. lsblk – Lists block devices.
    Example: lsblk
  4. fdisk – Partition management tool.
    Example: fdisk -l
  5. mkfs – Creates a filesystem.
    Example: mkfs.ext4 /dev/sdb1
  6. fsck – Checks a filesystem for errors.
    Example: fsck /dev/sda1

⏲️ 11. Job Scheduling

Run commands at a scheduled time.

  1. crontab -e – Edits the cron jobs.
    Example: crontab -e
  2. at – Schedules a one-time task.
    Example: echo "shutdown -h now" | at 10pm

πŸ› οΈ 12. System Services

Start, stop, and manage system services.

  1. systemctl – Manages systemd services.
    Example: systemctl restart apache2
  2. service – Older method to manage services.
    Example: service ssh start
  3. journalctl – Views system logs.
    Example: journalctl -xe

🧠 13. Miscellaneous Useful Commands

  1. history – Shows your command history.
    Example: history
  2. alias – Creates a shortcut for a command.
    Example: alias ll='ls -la'
  3. clear – Clears the terminal screen.
    Example: clear
  4. man – Shows the manual for any command.
    Example: man ls
  5. help – Provides help for shell built-ins.
    Example: help cd
  6. date – Displays the current date and time.
    Example: date
  7. cal – Shows a calendar.
    Example: cal
  8. uptime – Shows system uptime.
    Example: uptime
  9. reboot – Restarts the system.
    Example: reboot
  10. shutdown – Shuts down the system.
    Example: shutdown now
  11. who – Shows who is logged in.
    Example: who
  12. w – Shows who is logged in and what they’re doing.
    Example: w

🎯 Conclusion

Learning these 100 Linux commands will give you a solid foundation to explore the system further, script efficiently, and troubleshoot problems with ease. Start by practicing 5–10 commands daily. Use tools like man and --help flags to dig deeper.

Stay curious, keep practicing, and happy learning!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top