Linux Commands List with Usage Examples
Linux commands are typed in a terminal to work with files, directories, processes, packages, users, networking, disk space, and system information. This page gives a practical Linux commands list for beginners and system administrators, with short descriptions and command-line examples.
To learn the full options for any command on your system, use man, info, or the command’s built-in help option. Manual pages are usually the most reliable reference because command behavior can vary slightly by Linux distribution and installed version.
man ls
info coreutils 'ls invocation'
ls --help
How to Read Linux Command Syntax
A Linux command usually has a command name, options, and arguments. Options change the behavior of the command, while arguments tell the command what file, directory, user, host, or pattern to work on.
command -option argument
command --long-option argument
For example, in the command below, ls is the command, -l is an option, and /var/log is the directory argument.
ls -l /var/log
Linux File and Directory Commands
These Linux terminal commands are used for moving around the file system, listing files, creating directories, copying files, renaming files, and removing files.
Linux Text Viewing and Text Processing Commands
Use these Linux commands to view text files, search inside files, sort lines, compare files, count text, and transform text streams.
Linux Permission, Ownership, and User Commands
Linux permissions control who can read, write, or execute a file. These commands are important when managing scripts, shared directories, web files, and administrative tasks.
| Command | Description | Usage |
chmod | Changes file or directory permissions. | chmod 755 content.txt |
chown | Changes the owner and group of files or directories. | sudo chown user:www-data index.html |
groups | Shows the groups for a user. | groups arjun |
id | Prints user ID, group ID, and group membership information. | id |
passwd | Changes a user’s password. | passwd |
su | Switches to another user account or starts a root shell when allowed. | su - |
sudo | Runs a command as another user, commonly as the superuser, according to system policy. | sudo rm textfile.txt |
umask | Shows or sets default permission masks for newly created files and directories. | umask |
useradd | Adds a new user account. Options may vary by distribution. | sudo useradd demo |
usermod | Modifies an existing user account, such as adding the user to a group. | sudo usermod -aG sudo demo |
whoami | Prints the current effective user name. | whoami |
Linux Disk Space and Storage Commands
These Linux commands help you check disk usage, mounted file systems, block devices, and storage-related information.
Linux Process and System Monitoring Commands
Use these commands to inspect running processes, memory usage, logged-in users, uptime, and system status.
| Command | Description | Usage |
free | Displays memory usage and swap usage. | free -h |
htop | Interactive process viewer when installed. It is commonly used as a more readable alternative to top. | htop |
kill | Sends a signal to a process, commonly to terminate it. | kill 1234 |
killall | Sends a signal to processes by command name. | killall firefox |
ps | Displays information about running processes. | ps aux |
systemctl | Controls and inspects systemd services on distributions that use systemd. | sudo systemctl status nginx |
top | Displays an interactive real-time view of running processes and resource usage. | top |
uptime | Shows how long the system has been running and the load average. | uptime |
w | Shows logged-in users and what they are doing. | w |
Linux Networking Commands
Networking commands help you test connectivity, inspect IP addresses, download files, connect to remote systems, and troubleshoot ports.
Linux Package Management Commands
Package commands depend on the Linux distribution. Debian and Ubuntu systems commonly use APT, Red Hat-based systems commonly use DNF or YUM, Arch Linux uses pacman, and SUSE uses zypper.
Linux Archive and Compression Commands
These Linux commands are used to create archives, extract files, and compress or decompress data.
Linux Editors and Help Commands
Linux systems usually include text editors and help tools. Availability may differ by distribution and installation profile.
Linux System Information and Shutdown Commands
These commands show operating system details, kernel information, date and time, and system power actions.
Common Linux Command Examples for Daily Use
The examples below combine common Linux commands in realistic terminal tasks.
# Show the current directory and list files
pwd
ls -la
# Create a directory and copy a file into it
mkdir backups
cp notes.txt backups/
# Find large log files under /var/log
sudo find /var/log -type f -size +100M
# Check disk space in human-readable format
df -h
# Follow a log file as new lines are written
tail -f /var/log/syslog
Linux Command Safety Tips for Beginners
Some Linux commands can permanently change files or system settings. Be careful with commands that remove files, overwrite data, change permissions, or run with sudo.
- Run
pwdbefore destructive file commands so you know your current directory. - Use
lsto confirm file names before usingrm,mv, orcp. - Avoid using
sudounless administrative permission is really required. - Be careful with recursive commands such as
rm -r,chmod -R, andchown -R. - Prefer testing commands on sample files before running them on important directories.
Linux Commands FAQ
What is the most useful Linux command for beginners?
The most useful beginner Linux commands are pwd, ls, cd, cat, cp, mv, rm, mkdir, man, and sudo. These commands cover navigation, file handling, help, and administrative execution.
How do I get help for a Linux command in the terminal?
Use man command_name, info command_name, or command_name --help. For example, run man grep to read the manual page for grep.
What is the difference between apt and apt-get?
apt is a user-friendly command-line package tool commonly used interactively on Debian-based systems. apt-get is an older command-line package tool that is still widely used, especially in scripts and documentation.
Which Linux command shows disk space?
Use df -h to show available and used disk space on mounted file systems. Use du -sh directory_name to check how much space a specific directory uses.
Which Linux command is used to search inside files?
Use grep to search inside files. For example, grep -r "error" /var/log searches recursively for the word error inside files under /var/log.
Editorial QA Checklist for This Linux Commands Reference
- Verify that each command example uses a valid Linux terminal syntax.
- Check distribution-specific commands such as
apt,dnf,yum,pacman, andzypperbefore applying them on a real system. - Confirm that commands requiring administrative permission are clearly shown with
sudo. - Review destructive examples involving
rm,chmod,chown,shutdown, andrebootfor safe wording. - Keep command descriptions short enough for quick scanning while still explaining the practical use.
Conclusion on Linux Commands
This Linux commands list covers the terminal commands most users need for file handling, text processing, permissions, storage, networking, packages, system monitoring, archives, editors, and system information. For exact options and distribution-specific behavior, check the manual page with man or the help output available on your Linux system.
TutorialKart.com