Essential Red Hat Linux Commands for Beginners

Essential Red Hat Linux Commands for Beginners

 Essential Red Hat Linux Commands

Red Hat Enterprise Linux (RHEL) is widely used in enterprise environments, offering robust performance, stability, and security. Here’s a quick reference guide to the most commonly used commands in RHEL:

1. System Information Commands

  • uname -r: Display the kernel version.

    uname -r
  • hostnamectl: View or modify system hostname and basic system information.

    hostnamectl
  • uptime: Show how long the system has been running.

    uptime
  • whoami: Display the currently logged-in user.

    whoami
  • id: Show user ID (UID) and group ID (GID).

    id

2. File Management Commands

  • ls: List files and directories.

    ls -l
  • pwd: Print the current working directory.

    pwd
  • cp: Copy files or directories.

    cp source_file target_directory
  • mv: Move or rename files.

    mv old_name new_name
  • rm: Remove files or directories.

    rm file_name
  • mkdir: Create directories.

    mkdir directory_name

3. User Management Commands

  • who: Display logged-in users.

    who
  • adduser: Add a new user.

    sudo adduser username
  • passwd: Change a user's password.

    passwd username
  • usermod: Modify user accounts.

    sudo usermod -aG groupname username
  • deluser: Delete a user.

    sudo deluser username

4. Process Management Commands

  • ps: Display currently running processes.

    ps -aux
  • top: Monitor system processes in real time.

    top
  • kill: Terminate a process by PID.

    kill PID
  • htop: Interactive process manager (requires installation).

    htop

5. Package Management Commands (YUM/DNF)

  • dnf update: Update all packages.

    sudo dnf update
  • dnf install: Install a package.

    sudo dnf install package_name
  • dnf remove: Remove a package.

    sudo dnf remove package_name
  • dnf search: Search for a package.

    dnf search package_name

6. Networking Commands

  • ip a: Display network interfaces and IP addresses.

    ip a
  • ping: Test network connectivity.

    ping example.com
  • curl: Transfer data from or to a server.

    curl http://example.com
  • wget: Download files from the web.

    wget http://example.com/file

7. Disk Management Commands

  • df -h: Display disk usage in human-readable format.

    df -h
  • du -sh: Show the size of a directory.

    du -sh /path/to/directory
  • mount: Mount a filesystem.

    sudo mount /dev/sdX /mnt
  • umount: Unmount a filesystem.

    sudo umount /mnt
  • lsblk: List information about block devices.

    lsblk

8. System Monitoring and Logs

  • journalctl: View system logs.

    sudo journalctl
  • dmesg: Display kernel ring buffer messages.

    dmesg
  • free -h: Show memory usage.

    free -h

9. Permissions and Ownership Commands

  • chmod: Change file permissions.

    chmod 755 file_name
  • chown: Change file ownership.

    sudo chown user:group file_name

10. Shutdown and Reboot

  • shutdown: Shut down the system.

    sudo shutdown now
  • reboot: Restart the system.

    sudo reboot

Conclusion

These commands form the foundation for managing a Red Hat Enterprise Linux system. Whether you are an administrator or a curious learner, mastering these basics is essential for navigating the RHEL environment.

Let me know if you'd like further customization!

Souy Soeng

Souy Soeng

Our website teaches and reads PHP, Framework Laravel, and how to download Admin template sample source code free. Thank you for being so supportive!

Github

Post a Comment

CAN FEEDBACK
close