Linux Command Reference

13 May 2023 15 minutes Author: Lady Liberty

Linux commands

Linux (or GNU/Linux) is a family of Unix-like operating systems based on the Linux kernel, including one or another set of utilities and programs of the GNU project. Linux systems are distributed in the form of various distributions that have their own set of system and application components (both free and proprietary). In Linux, you can manage files, run programs, and get things done. A huge number of servers, smartphones and computers around the world run on different versions of Linux. For example, according to various estimates, from 70 to 90% of servers in the world run on Linux. Linux is loved for its flexibility, speed, and depth of customization. In all operating systems, including Linux, the term “command” refers to either a command line utility or a feature built into the system’s command shell.

Nevertheless, for the users themselves, this difference is not of particular importance. After all, both those and other Linux terminal commands are invoked in the same way. You type a word in your terminal emulator and get the result of the command. If you’ve ever used Linux, you’ve probably heard the word “terminal” – a command line with a much wider set of functions compared to Windows. Almost any action can be performed by a command from the terminal, but not every action can be performed through the user’s environment.
In this article, we’ll take a look at 475 Linux commands with a brief description of what each one does. In fact, there are more than 475 Linux commands, but it is not necessary to know them. Here are the basic commands used in basic Linux courses and Linux administration courses that don’t delve too deeply into specific software. So, the article contains those commands that are used often, there are also special commands for the used graphic environments, and there are also some utilities of domestic Alt and AstraLinux distributions.

Markings

🔵 – custom
⚫- administrative
🟣 – built into bash

🔲 – TUI application
🔳 – GUI application
…| – filter commands

  • 🔘 – specific ALT
  • 💫 – AstraLinux specific
  • ⚪ – not quite up to the mark

🔵 custom

🔵 dirname (1) – conversion of the path to the file into the name of the parent directory

🔵 dmesg (1) – output of the kernel message buffer

🔵 du (1) – viewing the disk space occupied by the file [-s – directory]

🔵 epm🔹 (1) – wrapper for package managers, also able to install proprietary programs such as zoom, anydesk, telegram, etc. [🔘ALT]

🔵 env (1) – “view exported variables”

🔵 espeak (1) – speech synthesizer

🔵 expr (1) – calculates the value of an expression with numbers and strings

🔵 factor (1) – decomposition of a number into factors

🔵 fallocate (1) – Create files of a certain size. Takes blocks immediately

🔵 false (1) – does nothing – with error code “1(not successful)”

🔵 ffmpeg (1) – converting a video file from one format to another, extracting a sound track, creating animated gifs, rotating a video, cutting a fragment.

🔵 file (1) – determine the file type by content

🔵 find (1) – search for files in the directory according to various parameters

🔵 fish (1) – “Friendly Interactive SHell” command interpreter

🔵 flatpak (1) – installation of flat packages (cross distribution format) [flathub repository]

🔵 free (1) – display of RAM size [-m – in MiB]

🔵 fuser (1) – [-mv MNT] displays processes that prevent the device from being unmounted

🔵 gdbus (1) – DBUS requests

🔵 getent (1) – viewing lists of [passwd – users] from the name service manager

🔵 getfacl (1) – view ACL file

🔵 gostsum🔹▪️ (1) – calculation of the checksum of the file according to GOST standards [🔘ALT][💫AstraSE]

🔵 gpg (1) – a utility for encrypting and signing files, managing gpg keys

🔵 groups (1) – displays the groups in which the user is a member

🔵 gzip (1) – compress or decompress files using the GNU-zip algorithm

🔵 host (1) – DNS queries [Analog: nslookup, dig]

🔵 hostname (1) – definition of the host name

🔵 hostnamectl (1) – [systemd] view-change hostname

🔵 id (1) – information about the user: UID and GIDs

🔵 identify (1) – determines the type and size of the image [ImageMagick]

🔵 ionice … (1) – starts the program with the given IO priority

🔵 iostat (1) – disk device operation statistics [-x 1 /dev/sda – extended statistics]

🔵 iozone (1) – Benchmark analysis of disks (iozone-graphs)

🔵 iperf3 (1) – Testing the speed of data transmission over the network

🔵 join (1) – joining lines of two ordered text files based on a common field

🔵 journalctl (1) – [systemd] view system log

🔵 kill (1) – sends a signal to the process [-l – list of signals, -9 – “kill” the process]

🔵 killall (1) – send a signal to all processes launched by a certain command (similar to pkill)

🔵 last (1) – a list of the last user terminal sessions and system reboots

🔵 ldd (1) – gives a list of dependencies of the executable binary file on libraries

🔵 ln (1) – creating a link to the file [-s – symbolic]

🔵 locale (1) – list of available regional settings [-av – detailed]

🔵 localectl (1) – [systemd] view-change locales

🔵 locate (1) – accelerated file search by name

🔵 logger (1) – sending a message through the logging system

🔵 lpq (1) – viewing the printer queue [-P PRINTER]

🔵 lpr(1) – sending a document to the printer queue [-P PRINTER]

🔵 lprm (1) – remove the job from the printer queue [-P PRINTER]

🔵 ls (1) – displays the contents of the directory [-l – displays file metadata]

🔵 lsattr (1) – displays additional file attributes of a file

🔵 lsb_release (1) – displays information about the distribution and its version

🔵 lscpu (1) – information about the processor (CPU)

🔵 lshw (1) – List of devices

🔵 make-initrd🔹 (1) – creating an InitRD image [🔘ALT]

🔵 md5sum (1) – output MD5 hash of the file

🔵 mkdir (1) – creates directories [-p – with parents]

🔵 mkfifo (1) – creation of a file of special type “named channel” – for interprocess interaction

🔵 mknod (1) – creation of files of special type “block device” and “character device”

🔵 mktemp (1) – creation of a temporary directory or file

🔵 mpstat (1) – conclusion of statistics about processors

🔵 mv (1) – moves and renames files

🔵 namei (1) – display the file path and all parent directories [-l – with rights and owner]

🔵 nc (1) – connection to the TCP and UDP port, transmission and reception of data over the network

🔵 netcat (1) – Connect to port [-l – listen port]

🔵 netlist (1) – list of open ports [similar to ss, socklist and netstat(set)]

🔵 newgrp (1) – start a shell from another group [same as sg]

🔵 nice … (1) – starts the program with the specified “priority”[nice-value]

🔵 nmap (1) – scan of ip networks, ports

🔵 nmcli (1) – network settings using NetworkManager

🔵 nohup … (1) – start the program with SIGHUP ignored – to continue executing when the session ends

🔵 nproc (1) – displays the number of available processors

🔵 nslookup (1) – DNS queries [Analogue: host, dig]

🔵 ocrad (1) – optical character recognition

🔵 openssl (1) – cryptographic operations [passwd -6 – generate SHA512 password hash]

🔵 pactl (1) – sound control [PulseAudio]

🔵 pandoc (1) – universal utility

and conversion from/to various text formats (txt, html, doc, json, markdown,…)

🔵 passwd (1) – changing the user’s password

🔵 paste (1) – connects lines of files

🔵 patch (1) – application of changes (obtained by the diff command) between versions of a text file

🔵 pdftk (1) – converting PDF documents (gluing, extracting pages, rotating, …)

🔵 pdp-id▪️ (1) – find out the current mandated security context of the user [💫AstraSE]

🔵 perl(1) – interpreter of the perl programming language

🔵 pgrep (1) – attribute search [-x – command name]

🔵 pkill (1) – sending a signal to processes found by a certain attribute [-x – command name]

🔵 potrace (1) – conversion of bitmap images into vector graphics

🔵 printf(1) – text output in the given format

🔵 ps (1) – information about processes [-A – all processes]

⚫ – administrative

⚫ adduser (8) – [⊚Debian] interactive user addition, with addition to a group

⚫ apt▪️ (8) – [⊚Debian] advanced package manager – installing packages from repositories.

⚫ apt-cache▪️ (8) – [⊚Debian] advanced package manager – information about packages in repositories

⚫ apt-cdrom▪️ (8) – [⊚Debian] adding CD-ROM repository to apt

⚫ apt-get🔹 (8) – package package manager – installation of packages from repositories [🔘ALT]

⚫ apt-repo🔹 (8) – repositories for apt [🔘ALT]

⚫ astra-update▪️ (8) – installation of updates [💫AstraSE]

⚫ badblocks (8) – search for “broken blocks” on the disk

⚫ blkid (8) – viewing the UUID of a disk partition

⚫ blockdev (8) – viewing and changing disk IO settings

⚫ btrfs (8) – viewing and changing parameters of FS btrfs

⚫ chattr (8) – changes additional file attributes of a file

⚫ chroot (8) – start a process with a replaced root directory – restricts access to other directories

⚫ control🔹 (8) – a unified interface for managing system components [🔘ALT]

⚫ cryptsetup (8) – control and connection of an encrypted (dm-crypt, LUKS) partition

⚫ debugfs (8) – debugging of the ext3/ext4 file system [-R ‘stat ‘ – viewing the contents of the inode; -R ‘cat ‘ – the directory file]

⚫ dhclient (8) – configuration of the DHCP network interface

⚫ dmsetup (8) – management of virtual block devices

⚫ dnf▪️ (8) – [⊚RedHat] advanced package manager – installing packages from repositories [rewritten version of yum]

⚫ dpkg▪️ (8) – [⊚Debian] DEB package manager: information about installed packages [-l, -s, -L, -S]

⚫ edquota (8) – setting user quotas for the number and volume of files

⚫ ethtool (8) – viewing and editing network card parameters [duplex, speed, mtu,…]

⚫ fdisk (8) – editing [-l DISK – viewing] disk partition table

⚫ findfs (8) – search for a disk device by LABEL or UUID

⚫ findmnt (8) – tree display of mounted FS

⚫ fsck(8) – checking the file system for errors [e2fsck, btrfsck, fsck.vfat, fsck.xfs. …]

⚫ fsfreeze (8) – blocks writing to FS (Ext3/4, JFS, XFS) until unlocking

⚫ groupadd (8) – creation of a group of users

⚫ groupdel (8) – delete a user group

⚫ groupmod (8) – renaming and changing the GID of a group account

⚫ grub-mkconfig (8) – creation of GRUB configuration file templates

⚫ halt (8) – turning off the system

⚫ hdparm (8) – viewing and changing hard disk parameters

⚫ ifdown (8) – [~]script to “disable” the network interface

⚫ ifup (8) – [~]script “raising” the network interface

⚫ ip (8) – network settings

⚫ iw (8) – wireless card settings

⚫ iwconfig (8) – wireless card settings (set replaced by iw)

⚫ lastlog (8) – displays information about the last terminal session of each user in the system

⚫ ldconfig (8) – indexes [-p – displays] system libraries

⚫ losetup (8) – setup of loop devices

⚫ lsblk (8) – List of block devices and their partitions

⚫ lslocks (8) – a list of lock files

⚫ lsmod (8) – list of loaded kernel modules

⚫ lsof (8) – a list of files currently open by processes

⚫ lspci (8) – list of connected PCI devices [-k – kernel module]

⚫ lvs (8) – information about LVM logical volumes

⚫ lvscan (8) – list of LVM logical volumes

⚫ lynis (8) – security audit

⚫ mdadm (8) – creating and managing a software RAID array

⚫ mke2fs (8) – formatting in ext4/ext3 file system

⚫ mkfs.ext4 (8) – formatting in ext4/ext3 file system

⚫ mkswap (8) – mark the swap partition (or file)

⚫ modinfo (8) – information about the kernel module

⚫ modprobe (8) – connect kernel module [-r – disable]

⚫ mount (8) – mounts the file system

⚫ openvpn (8) – VPN connection

⚫ pacman (8) – [⊚Arch] package package manager – installing packages from repositories

⚫ parted (8) – Disk partitioning

⚫ ping (8) – “checking the presence of the machine in the network” [sends ICMP packet ECHO_REQUEST]

⚫ poweroff (8) – system shutdown/reboot

⚫ powertop (8) – analysis of energy consumption by processes

⚫ pvs (8) – information about LVM physical volumes

⚫ quotacheck (8) – collection of disk space usage statistics by users (for setting quotas)

⚫ reboot (8) – system reboot

⚫ repquota (8) – viewing user quotas for the number and volume of files

⚫ rpm▪️ (8) – [⊚RedHat] RPM package manager: information about installed packages [-qa, -qi, -ql, -qf]

⚫ rpm2cpio (8) – extraction of files (cpio file archive) from the rpm package

⚫ sfdisk (8) – non-interactive disk partition table fix [–dump – view/save]

⚫ shutdown (8) – [-h] shutdown/[-r] system reboot at the specified time [now]

⚫ smartctl (8) – a SMART monitoring and tests utility for disks

⚫ socklist (8) – list of open ports [similar to netlist, ss and netstat(set)]

⚫ ss (8) – network statistics [-lntup – list of open ports][similar to netlist, socklist and netstat(set)]

⚫ sudo … (8) – execute the command on behalf of the root user [-i – start the shell, -u USER – from the user]

⚫ swapoff (8) – disconnection of the partition (or file) of swapping

⚫ swapon (8) – trans

view-mount partition (or file) swap

⚫ sysctl (8) – viewing and changing kernel parameters

⚫ tasksel▪️ (8) – [⊚Debian] Browse package sets [–list-tasks – list,–task-packages Multimedia – content]

⚫ tcpdump (8) – capture and analysis of network traffic passing through the computer

⚫ tune2fs (8) – viewing and changing the parameters of the ext3/ext4 file system

⚫ udevadm (8) – [monitor, info] view of connected devices

⚫ umount (8) – unmounts the file system

⚫ update-kernel (8) – will update the kernel [🔘ALT]

⚫ useradd (8) – creation of a user account

⚫ usermod (8) – change account settings [-aG GRP – add to group]

⚫ vgs (8) – information about the LVM volume group

⚫ vmstat (8) – memory usage statistics

⚫ yum▪️ (8) – [⊚RedHat] advanced package manager – installing packages from repositories [replaced by dnf]

⚫ zypper▪️ (8) – [⊚SUSE] advanced package manager – installing packages from repositories

🟣 – built into bash

🟣 alias (b) – view and assign command aliases

🟣 bg (b) – continue execution in the background of the process of the current session

🟣 cd (b) – move to the directory [.. – to a higher level]

🟣 command (b) – command call (not functions and alias)

🟣 declare (b) – sets the value and type of the variable [-i – number; -a – array; -A – associative array; -r – read only]

🟣 disown (b) – detach the latest tasks from the current terminal

🟣 echo (b) – outputs the text. “view variable values”

🟣 enable (b) – enables/disables the use of built-in bash commands

🟣 exec (b) – execute command in current pid, redirect output for current process

🟣 exit (b) – exit the shell [with the specified error code]

🟣 export (b) – setting the value of the variable marked “exported”

🟣 fg (b) – switching to the “foreground” of the process of the current session

🟣 for (b) – loop for [for i in 1 2 3; do echo $i; done]

🟣 function (b) – define a function in bash

🟣 help (b) – help on built-in bash commands

🟣 history (b) – history of teams

🟣 if…(b) – command launch upon successful execution of another command (often, checking the expression through the “[“) command [if COM1; then COM1; else COM3; fi]

🟣 jobs (b) – list of processes of the current bash session

🟣 let (b) – calculates the value of an expression with numbers

🟣 read (b) – the simplest utility for requesting data from the user in the terminal (-p MSG – message, -t SEC – timeout, -n NUM – number of characters) […| while read … – term parsing]

🟣 select (b) – the simplest bash selection menu [select Name in WORDS … ; do COMMANDS; done]

🟣 set (b) – viewing environment variables and function. switch bash modes

🟣 source (b) – run the script in the current bash [analog .]

🟣 test (b) – checking the truth of the expression [-f – file existence, -lt – less than]

🟣 trap (b) – settings for starting the command when receiving a signal

🟣 type (b) – defines the type of command [built-in, alias, function]

🟣 ulimit (b) – set [-a – output] resource limits for the current bash session

🟣 umask (b) – viewing and setting rights that will not be set when creating files/directories

🟣 unset (b) – deletes a variable (or function)

🟣 wait (b) – waits for the completion of the process

🟣 while … (b) – loop while [while COMM1; to COMM2; done]

🟣 (b) – run the script in the current bash [analog source]

🟣 [(b) – checking the truth of the expression [-f – existence of the file, -lt – less than] – analogue of “test”

🔲 – TUI-application

🔲 aptitude▪️ (8) – [⊚Debian][TUI] interface over apt

🔲 atop (1) – [TUI] interactive list of processes sorted by CPU time usage [h – key link] [extended top]

🔲 cfdisk (8) – [TUI] Disk partitioning

🔲 dua (1) – [TUI] viewing the disk space occupied by a directory

🔲 htop (1) – [TUI] “tinted” interactive list of processes sorted by CPU time usage

🔲 iftop (8) – [TUI] network statistics from src/dest

🔲 info (1) – [TUI] viewing info-documentation [H – help by keys]

🔲 iotop (8) – [TUI] top processes using disk

🔲 joe (1) – [TUI] text editor [Ctrl-k h – help, Ctrl-k x – exit with save]

🔲 …| less (1) – [TUI] pagination of text files [h – help by keys]

🔲 links (1) – [TUI] console web browser

🔲 lynx (1) – [TUI] console web browser

🔲 man (1) – [TUI] help view [h – help by keys]

🔲 mc(1) – [TUI] file manager [F1 – help]

🔲 mcdiff (1) – [TUI] shows the difference between two files [with MC]

🔲 mcedit (1) – [TUI] text editor [with MC]

🔲 mcview (1) – [TUI] view text files [with MC]

🔲 micro (1) – [TUI] text editor [Ctrl-q – exit]

🔲 mtr (8) – [TUI] traceroute + ping

🔲 nano (1) – [TUI] Text editor [Ctrl-x – exit]

🔲 ncdu (1) – [TUI] viewing the disk space occupied by a directory [Analogues: dua, gdu]

🔲 nethogs (8) – [TUI] network statistics by processes

🔲 nload (1) – [TUI] monitors bandwidth in real time

🔲 nmtui (1) – [TUI] network settings (via NetworkManager)

🔲 …| peco (1) – [TUI] interactive filter

🔲 pico (1) – [TUI] Text editor [Ctrl-x – exit] [analogue, nano]

🔲 top (1) – [TUI] interactive list of processes sorted by CPU time usage [h – key help]

🔲 vi (1) – [TUI] programmable text editor Vi [Esc:q!Enter – exit without saving]

🔲 view (1) – [TUI] view text files through VIM

🔲 vim (1) – [TUI] programmable text editor Vi-enhanced [Esc:q!Enter – exit without saving]

🔲 vimdiff (1) – [TUI] shows the difference between two files [with Vim]

🔲 w3m (1) – [TUI] console web browser

🔲 whdd (1) – [TUI] testing of drives for reading and writing

🔳 – GUI-application

🔳 acc🔹 (8) – [GUI] system control center [🔘ALT]

🔳 atril (1) – [GUI, MATE] viewing pdf files

🔳 d-feet (1) – [GUI] DBUS requests

🔳 dia (1) – [GUI, GNOME] drawing diagrams

🔳 eog (1) – [GUI,GNOME] image viewer

🔳 eom (1) – [GUI,MATE] image viewer

🔳 evince (1) – [GUI, GNOME] viewing pdf files

🔳 firefox (1) – [GUI] web browser

🔳 fly-admin-cron▪️ (8) – [GUI] Configuring cron tasks [💫AstraSE]

🔳 fly-admin-device-manager▪️ (1) – [GUI] “Device Manager” [💫AstraSE]

🔳 fly-admin-grub2▪️ (8) – [GUI] Configuring the GRUB bootloader [💫AstraSE]

🔳 fly-admin-smc▪️ (8) – [GUI] Security Settings Center [Users, Mandate Labels, Delimiting Access to Flash Drives] [💫AstraSE]

🔳 fly-admin-viewaudit▪️ (8) – [GUI] Audit log view (parsec-log) [💫AstraSE]

🔳 fly-dialog (1) – [GUI] different dialogs for scripts (options like in whiptail) [💫AstraSE]

🔳 fly-fm▪️ (1) – [GUI] File manager [💫AstraSE]

🔳 gnome-calculator (1) – [GUI, GNOME] calculator

🔳 gparted (8) – [GUI,GNOME] Disk partitioning and formatting

🔳 gwenview (1) – [GUI,KDE] program for viewing images

🔳 hardinfo (1) – [GUI] System and device information

🔳 hp-setup (1) – [GUI] Printer setup[hplip]

🔳 hp-systray (1) – [GUI] Printer configuration tray applet [hplip]

🔳 kate (1) – [GUI,KDE] Text editor

🔳 ksysguard (1) – [GUI,KDE] “task manager” – viewing and managing processes

🔳 lowriter (1) – [GUI] Office text editor [Analogue of “MS Word”]

🔳 meld (1) – [GUI,GNOME] Visual diff – comparing the contents of text files

🔳 nm-applet (1) – [GUI] network configuration applet (via NetworkManager) in the tray

🔳 nm-connection-editor (1) – [GUI] network settings (via NetworkManager)

🔳 notify-send (1) – [GUI] sending a message via the notify service

🔳 okular (1) – [GUI,KDE] viewing pdf files

🔳 qdbusviewer (1) – [GUI] DBUS requests

🔳 …| rofi (1) – [GUI] list menu for scripts, application launcher

🔳 synaptic🔹 (8) – [GUI] Graphical interface for managing packages and repositories [🔘ALT]

🔳 system-config-printer (1) – [GUI] Printer settings

🔳 systemdgenie (8) – [GUI,systemd] Configuring the start of services using systemd

🔳 vlc (1) – [GUI] video player

🔳 wine (1) – [GUI] running Windows applications in Linux

🔳 winecfg (1) – [GUI] wine settings

🔳 winetricks (1) – [GUI] script for loading standard DLLs for use in wine

🔳 xcalc (1) – [GUI,X] calculator (the simplest X-utility, used in examples with graphics and process control)

🔳 xclock (1) – [GUI,X] just a clock (the simplest X-utility, I use it in examples with graphics and process control)

🔳 xdg-open (1) – [GUI] “universal browser” – opens a file in the user’s default browser for given file types

🔳 xeyes (1) – [GUI,X] just “eyes” (the simplest X-utility, I use it in examples with graphics and process control)

🔳 xterm (1) – [GUI,X] graphical terminal

🔳 zenity (1) – [GUI,GNOME] various dialog boxes for scripts

Other related articles
Found an error?
If you find an error, take a screenshot and send it to the bot.