Linux - Commands to Know
Last verified: October 2026 against the current man pages (tar, touch, useradd, userdel, groupadd, groupdel) for RHEL / Rocky Linux.
This is a quick version of commands to be aware of.
System information
uname -a : Displays all system information.
hostnamectl : Shows current hostname and related details.
lscpu : Lists CPU architecture information.
timedatectl status : Shows system time.
System monitoring and management
top : Displays real-time system processes.
htop : An interactive process viewer (needs installation; on RHEL / Rocky Linux it comes from the EPEL repository).
df -h : Shows disk usage in a human-readable format.
free -m : Displays free and used memory in MB.
kill [PID] : Terminates a process (sends SIGTERM by default).
Running commands
<command> & : Runs command in the background.
jobs : Displays background commands.
fg %1 : Brings background job 1 (number from jobs) to the foreground.
Service management
sudo systemctl start [service] : Starts a service.
sudo systemctl stop [service] : Stops a service
sudo systemctl status [service] : Checks the status of a service.
sudo systemctl reload [service] : Reloads a service’s configuration without interrupting its operation.
journalctl -f : Follows the journal, showing new log messages in real time.
journalctl -u [unit] : Displays logs for a specific systemd unit.
Cron jobs and scheduling
crontab -e : Edits cron jobs for the current user.
crontab -l : Lists cron jobs for the current user.
File management
ls : Lists files and directories.
touch : Creates an empty file, or updates the access and modification times of an existing file.
cp : Copies files from source to destination.
mv : Moves files or renames them.
rm : Deletes a file.
Directory navigation
pwd : Displays the current directory path.
cd : Changes the current directory.
mkdir : Creates a new directory.
File permissions and ownership
chmod [who][+/-][permissions] : Changes file permissions.
chmod u+x : Makes a file executable by its owner.
chown [user]:[group] [file] : Changes file owner and group.
Searching and finding
find [directory] -name : Finds files and directories.
grep : Searches for a pattern in files.
Archiving and compression
tar -czvf [archive].tar.gz [files] : Compresses files into a tar.gz archive.
tar -xvf [archive].tar.gz -C [destination] : Extracts a compressed tar archive into the destination directory.
Text editing and processing
nano : Opens a file in the Nano text editor.
cat : Displays the contents of a file.
less : Displays the paginated content of a file.
head : Shows the first few lines of a file.
tail : Shows the last few lines of a file.
awk '{print}' [file] : Prints every line in a file.
User management
w : Shows which users are logged in.
sudo useradd [username] : Creates a new user (Debian / Ubuntu also have the adduser front end).
sudo userdel [username] : Deletes a user (add -r to also remove the home directory).
sudo passwd : Sets or changes the password for a user.
su : Switches user.
sudo passwd -l : Locks a user account.
sudo passwd -u : Unlocks a user password.
sudo chage : Sets user password expiration date.
Group management
id [username] : Displays user and group IDs.
groups [username] : Shows the groups a user belongs to.
sudo groupadd [group] : Creates a new group.
sudo groupdel [group] : Deletes a group.
Sources
- https://man7.org/linux/man-pages/man1/tar.1.html
- https://man7.org/linux/man-pages/man1/touch.1.html
- https://man7.org/linux/man-pages/man8/useradd.8.html
- https://man7.org/linux/man-pages/man8/userdel.8.html
- https://man7.org/linux/man-pages/man8/groupadd.8.html
- https://man7.org/linux/man-pages/man8/groupdel.8.html
- https://packages.fedoraproject.org/pkgs/htop/htop/