Rocky Linux is a popular Linux distribution based on Red Hat Enterprise Linux (RHEL). As a community-driven project, it has become a popular choice for system administrators and developers seeking a stable, secure, and reliable operating system. In this guide, we will cover some essential Rocky Linux commands list that will help you manage your system efficiently.
Applicability to Other RHEL-based Linux Systems
While this guide focuses on Rocky Linux, it’s important to note that the commands listed here also apply to other RHEL-based Linux distributions. Rocky Linux is just one of many distributions derived from RHEL, each with its own unique features and use cases. Some popular RHEL-based distributions include:
A community-driven distribution was created as a CentOS alternative after its shift to a rolling release model. AlmaLinux is designed for stability and long-term support, making it a suitable choice for enterprise environments.
A popular, community-driven distribution aimed at providing a free and open-source alternative to RHEL. CentOS recently transitioned to a rolling release model (CentOS Stream) that serves as an upstream development platform for RHEL.
A distribution developed by Oracle and optimized for running Oracle products, such as databases and middleware. Oracle Linux offers compatibility with RHEL while providing additional features and support options.
These distributions share a common base with RHEL, which means that most commands and concepts mentioned in this guide are transferable across these systems. This compatibility makes it easier for system administrators to transition between RHEL-based distributions and apply their skills across various environments.
In summary, the commands and concepts covered in this guide are not exclusive to Rocky Linux. As a system administrator or user of RHEL-based distributions, you can leverage this knowledge to efficiently manage and maintain a variety of Linux systems. Familiarizing yourself with these commands will help you become more proficient in managing RHEL-based distributions, whether you’re working with Rocky Linux, AlmaLinux, CentOS, or any other related system.
Table of Contents
- System Information Commands
- File Management Commands
- Package Management Commands
- User Management Commands
- Networking Commands
- System Administration Commands
Rocky Linux Commands List
System Information Commands
Understanding your system is crucial when working with any Linux distribution. The following commands will provide you with essential information about your Rocky Linux system.
uname -a: Displays kernel information, including the operating system, hostname, kernel version, and build date.
lscpu: Lists detailed information about the CPU architecture.
free -m: Shows memory usage statistics in megabytes.
df -h: Displays disk space usage in a human-readable format.
lsblk: Lists information about block devices, such as hard drives and partitions.
File Management Commands
Working with files and directories is a fundamental aspect of Linux system administration. The following commands will help you manage files and directories on your Rocky Linux system.
ls: Lists files and directories in the current directory.
mkdir: Creates a new directory.
rm: Removes files or directories.
cp: Copies files or directories.
mv: Moves or renames files or directories.
find: Searches for files and directories based on specified criteria.
grep: Searches for text patterns within files.
chmod: Changes file permissions.
unzip: Compresses and decompresses files using the ZIP format.
Package Management Commands
Managing software packages is an essential part of maintaining a Linux system. Rocky Linux uses the DNF package manager for this purpose. The following commands will help you manage software packages on your Rocky Linux system.
dnf update: Updates all installed packages to their latest versions.
dnf install: Installs a new package. For example, use
dnf install nanoto install the Nano text editor.
dnf remove: Removes an installed package.
dnf search: Searches for packages in the repositories.
dnf list: Lists all available packages in the repositories.
User Management Commands
Managing users and groups is an important part of securing your Rocky Linux system. The following commands will help you manage users and groups on your system.
useradd: Creates a new user account.
usermod: Modifies an existing user account.
userdel: Removes a user account.
passwd: Sets or changes a user’s password.
groupadd: Creates a new group.
groupmod: Modifies an existing group.
groupdel: Removes a group.
Networking is a critical aspect of any modern Linux system
. The following commands will help you manage and troubleshoot networking issues on your Rocky Linux system.
ip: Displays and configures network interfaces and routing tables.
ifconfig: Displays and configures network interfaces (deprecated, use
ping: Sends ICMP echo requests to a specified host to check network connectivity.
traceroute: Shows the network route taken by packets to reach a specified host.
netstat: Displays active network connections, routing tables, and network statistics.
ss: Displays socket statistics and is a modern replacement for
nslookup: Queries DNS servers to resolve domain names to IP addresses.
dig: Performs DNS queries and provides detailed information about the DNS records.
wget: Downloads files from the internet using HTTP, HTTPS, or FTP protocols.
curl: Downloads files or interacts with APIs using various protocols, including HTTP, HTTPS, FTP, and more.
System Administration Commands
Maintaining and administering your Rocky Linux system requires a set of commands for various tasks. The following commands will help you with system administration tasks on your Rocky Linux system.
systemctl: Controls and manages the systemd system and service manager.
journalctl: Displays log messages from the systemd journal.
top: Displays real-time information about running processes and system resource usage.
htop: An enhanced version of
topthat provides a more user-friendly and interactive interface.
crontab: Schedules and manages
cron jobs, which are tasks that run at specified intervals.
firewall-cmd: Manages the firewalld firewall on your Rocky Linux system.
chmod: Modifies file permissions to control access to files and directories.
chown: Changes the ownership of files and directories.
reboot: Reboots the system.
shutdown: Shuts down the system.
This comprehensive list of Rocky Linux commands should help you manage your system efficiently. Remember that there are many more commands available, and this list only scratches the surface. As you gain experience with Rocky Linux, you’ll discover additional commands tailored to your specific needs.
If you are interested in expanding your knowledge of Rocky Linux, consider exploring our tutorials on how to install software, set up services, and configure your system. Additionally, you can learn more about other Linux distributions like AlmaLinux and CentOS to broaden your Linux administration skills.