Skip to content

Linux Commands: Users, Processes and System

Users and groups, processes and jobs, disks, hardware info, kernel modules, power, logs and time.

Part of the Linux commands cheat sheet.

User Management Commands

chage — Change user password expiry information:

chage -l username

chfn — Change real user name and information:

chfn username

chsh — Change login shell:

chsh -s /bin/zsh username

chpasswd — Update passwords in batch mode:

echo "user:newpass" | chpasswd

finger — User information lookup program:

finger username

id — Print real and effective user and group IDs:

id username

passwd — Change user password:

passwd username

pinky — Lightweight finger program:

pinky -l username

useradd — Create a new user or update default new user information:

useradd -m newuser

userdel — Delete a user account and related files:

userdel -r olduser

usermod — Modify a user account:

usermod -aG wheel username

users — Print the user names of users currently logged in:

users

who — Show who is logged on:

who

whoami — Print effective userid:

whoami

Group Management Commands

groupadd — Create a new group:

groupadd developers

groupdel — Delete a group:

groupdel developers

groupmod — Modify a group definition:

groupmod -n devs developers

groups — Print the groups a user is in:

groups username

gpasswd — Administer /etc/group and /etc/gshadow:

gpasswd -a username developers

grpck — Verify integrity of group files:

grpck

grpconv — Create shadow group file from group file:

grpconv

Process Management Commands

accton — Turn process accounting on or off:

accton /var/account/pacct

bg — Put a job in the background:

bg %1

chrt — Manipulate the real-time attributes of a process:

chrt -p 1234

fg — Bring a job to the foreground:

fg %1

kill — Send a signal to a process:

kill -9 1234

mpstat — Report processors related statistics:

mpstat -P ALL 1

pidof — Find the process ID of a running program:

pidof sshd

pmap — Report memory map of a process:

pmap 1234

ps — Report a snapshot of the current processes:

ps aux

top — Display Linux processes dynamically:

top

htop — Interactive process viewer:

htop

strace — Trace system calls and signals:

strace -p 1234

time — Run programs and summarize system resource usage:

time ls -l

watch — Execute a program periodically, showing output fullscreen:

watch -n 1 free -m

vmstat — Report virtual memory statistics:

vmstat 1 5

uptime — Tell how long the system has been running:

uptime

w — Show who is logged on and what they are doing:

w

Job Scheduling Commands

atd — Job spooling daemon:

systemctl status atd

atrm — Remove jobs spooled by at:

atrm 1

atq — Lists the user's pending jobs:

atq

batch — Execute commands when system load levels permit:

echo "sh ./script.sh" | batch

cron — Daemon to execute scheduled commands:

systemctl status crond

crontab — Maintain crontab files for individual users:

crontab -e

Disk and File System Commands

cfdisk — Display or manipulate disk partition table:

cfdisk /dev/sda

df — Report file system disk space usage:

df -h

dosfsck — Check and repair MS-DOS file systems:

dosfsck /dev/sdb1

dump — ext⅔/4 filesystem backup:

dump -0u -f /tmp/backup.dump /dev/sda1

dumpe2fs — Dump ext⅔/4 filesystem information:

dumpe2fs /dev/sda1

fdisk — Manipulate disk partition table:

fdisk -l

mount — Mount a filesystem:

mount /dev/sda1 /mnt

restore — Restore files or file systems from backups made with dump:

restore -r -f /tmp/backup.dump

sync — Synchronize cached writes to persistent storage:

sync

Hardware and System Information Commands

acpi — Show battery status and other ACPI information:

acpi -V

acpi_available — Test whether ACPI subsystem is available:

acpi_available

acpid — Advanced Configuration and Power Interface event daemon:

systemctl restart acpid

arch — Print machine hardware name:

arch

dmesg — Print or control the kernel ring buffer:

dmesg -T

dmidecode — DMI table decoder:

dmidecode -t memory

dstat — Versatile resource statistics tool:

dstat

free — Display amount of free and used memory in the system:

free -m

hdparm — Get/set SATA/IDE device parameters:

hdparm -tT /dev/sda

hwclock — Query or set the hardware clock:

hwclock --show

iostat — Report CPU and input/output statistics for devices:

iostat -x 1

iotop — Simple top-like I/O monitor:

iotop

lsusb — List USB devices:

lsusb

lshw — Extract detailed information on the hardware configuration:

lshw -short

uname — Print system information:

uname -a

Kernel and Module Management Commands

depmod — Generate modules.dep and map files:

depmod -a

insmod — Insert a module into the Linux Kernel:

insmod module.ko

lsmod — Show the status of modules in the Linux Kernel:

lsmod

modinfo — Show information about a Linux Kernel module:

modinfo e1000e

rmmod — Remove a module from the Linux Kernel:

rmmod module_name

systemctl — Control the systemd system and service manager:

systemctl status network

System Control and Power Commands

halt — Instruct the hardware to stop all CPU functions:

halt

poweroff — Power off the system:

poweroff

reboot — Reboot the system:

reboot

shutdown — Halt, power-off or reboot the machine:

shutdown -h now

Logging and Monitoring Commands

journalctl — Query the systemd journal:

journalctl -u sshd -f

last — Show listing of last logged in users:

last username

history — GNU History Library (show previous commands):

history | grep command

sar — Collect, report, or save system activity information:

sar -u 1 3

script — Make typescript of terminal session:

script session.log

scriptreplay — Play back typescripts, using timing information:

scriptreplay timing.log session.log

Date and Time Commands

cal — Displays a calendar:

cal 2026

date — Print or set the system date and time:

date "+%Y-%m-%d %H:%M:%S"

uptime — Tell how long the system has been running:

uptime