Infrequent Linux commands

Jul 15, 2011
Tested with mainly Ubuntu-based distributions. List of Linux commands which are useful but not frequently used. See online or local man pages for details.

System Information

uname -a # Details of kernel, processor, machine, OS cat /proc/version # Detailed kernel version. More details about /proc. cat /etc/*-release # See details of distribution lsb_release -a # See details of distribution service --status-all # status of init services; [+] Running, [-] Not running, [?] Unknown sudo initctl list # List & status of upstart jobs. More at UbuntuBootupHowto.

Hardware Information

cat /proc/cpuinfo # Shows CPU details free -mt # Shows details of memory usage sudo dmidecode -t memory # Shows details of RAM slots df -hT # Report disk type, space usage, mount points sudo fdisk -l # Lists partition table of all disks blkid # Lists UUID and type of all disks ls -l /dev/disk/by-uuid # Lists drives by UUID

Users and Groups

groups <username> # Lists group memberships of the user id -u <username> # Prints user-id of user id -g <username> # Prints group-id of user id <username> # Print user and group information of user sudo passwd <username> # Change user password sudo usermod -d /new/home/dir <username> # Change user home directory
  • Disk usage (size) of directories: du -ach du -sch du -ch /home/user
  • List USB Devices lsusb -t
  • apt installed packages:less /var/log/apt/history.log zless /var/log/apt/history.log.1.gz dpkg --get-selections | sed -n 's/\t\+install$//p' Automatically installed packages </var/lib/apt/extended_states awk -v RS= '/\nAuto-Installed: *1/{print$2}'
  • Image to pdf:convert *.png out.pdf convert -compress jpeg *.png out.pdf

Last edited: June 11, 2014