ALB

Oct 27, 2020

2 min read

Linux Commands

Whether you are new to Linux or someone who is using Linux since ages, chances are, you keep coming across Linux commands that you didn’t know before. So here is our list of commands that we have compiled over a period of time that can make your life easier and make you more productive.

  • Find Command:
# sudo find / -name “filename”
  • Locate files using mlocate:
# locate “filename”
  • Repeat the previous Xrandr command:
# !xrandr
  • Set Xrandr resolution:
# xrandr -s “1920x1080”
  • Ubuntu upgrade command:
# sudo apt dist-upgrade
  • Pacman package list:
# pacman -Qqe
  • Pacman package list in numbers:
# pacman -Qqe | wc -l
  • Export the Pacman packages to a file:
# pacman -Qqe > packages.txt
  • Check what packages belong to a ‘group package’ (Like gnome):
# pacman -Sg “filename”
  • Check what packages belong to the AUR:
# pacman -Qm or -Qqm
  • Files installed by a package:
# pacman -Ql “filename”
  • Check package info:
# pacman -Qi “filename”
  • Check package size:
# pacman -Qi “filename” | grep -i size
  • Remove orphan packages:
# sudo pacman -Rns $(pacman -Qtdq)
  • Show IP address:
# ip a
  • Show long listing:
# ls -l
  • Unmount if target is busy:
# sudo umount -l
  • Show mounting points:
# mount -l
  • Show mounted partitions:
# df -h
  • Show full listing of drives:
# lsblk -f
  • TTY:
CTRL + ALT + F2/3/4
  • Move to different TTYs:
ALT + Left/Right
  • Check for system errors:
# sudo systemctl –failed# sudo journalctl -p 3 -xb
  • Check swap status:
# swapon –show
  • Check free memory:
# free -h
  • Check Systemd running services:
# systemctl — type=service
  • Check current Linux kernel:
# uname -r
  • Check bash type:
# echo $0
  • Check Awesome WM version:
# awesome — version