Posted in

Introduction to Linux and Types of Commands – System Commands Explained

Linux Introduction and System Commands

Linux Operating System

Linux is a free and open-source operating system known for its high security and stability. Due to its reliability, most production servers run on Linux. As a multi-user operating system, Linux can handle multiple users simultaneously without any performance issues.


Types of Linux Distributions

Linux distributions are categorized based on their package management systems:

Debian-based (Uses .deb packages)

Examples:

  • Ubuntu
  • Debian
  • Linux Mint
  • Kali Linux

RPM-based (Uses .rpm packages)

Examples:

  • Red Hat Enterprise Linux (RHEL)
  • Fedora
  • CentOS
  • openSUSE

Although there are many Linux distributions, most users primarily use Debian-based (.deb) and Red Hat-based (.rpm) package managers.


Different Types of Linux Commands

Linux commands are categorized into different types:

  • System Commands
  • File and Directory Commands
  • Network Commands
  • User and Group Commands
  • Process Management Commands
  • File Viewing and Editing Commands

System Commands

System commands in Linux are primarily used to check information about the operating system. These commands help users gather system details and monitor system resources, such as CPU, RAM, and memory.

Example Commands:

  • sudo -i : Switch to the root user.
  • uname : Get information about which operating system it is.
  • uname -r : Show kernel details.
  • uname -a : Show all details about the operating system.
  • hostname : Show the system hostname.
  • hostnamectl set-hostname "name" : Change the system hostname.
  • uptime : Show how long the system has been running.
  • uptime -p : Show how long the system has been running (time only).
  • who : List the number of users logged in.
  • whoami : Show the current logged-in user.
  • cat /etc/os-release : Show operating system details.
  • id username : Show user ID and group ID details.
  • lsb_release -a : Show Linux distribution details.
  • date : Show the date and time.
  • timedatectl : Show system timezone details.

Changing Timezone to IST

By default, the system time is in UTC format. To change it to IST:

  • timedatectl set-timezone Asia/Kolkata : Change the timezone to IST.
  • timedatectl : Verify the updated timezone.

Disk and Memory Usage Commands

  • df : Show disk usage of file systems (Memory).
  • df -h : Show disk usage of file systems in a human-readable format.
  • du -sh directory_name : Show disk usage of a particular folder.
  • ls cpu or cat /proc/cpuinfo : Show full information about the CPU.
  • free or cat /proc/meminfo : Show full RAM information.
  • free -m : Show RAM information in MB format.
  • free -g : Show RAM information in GB.
  • mount : List all mounted file systems.
  • lsblk : Show information about block storage attached to Linux.
  • fdisk -l : Show partition information of the system.

Shutdown and Restart Commands

  • shutdown -h now : Shut down the system immediately.
  • shutdown -r now : Restart the system immediately.
  • reboot : Reboot the system.
  • halt : Stop the system.
  • poweroff : Turn off the system.

Join Telegram

For more content like this, follow us on Telegram!

Leave a Reply

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