Skip to main content

Appendix A - Essential Commands

This appendix serves as a comprehensive guide to essential terminal commands and shortcuts. Whether you're looking to manage processes, gather system information, or troubleshoot issues, this guide has you covered. Additionally, we've compiled a list of recommended readings to help you explore the world of command-line operations further.

A1 - Essential Terminal Shortcuts

ShortcutDescription
Ctrl + ALT + F1Access the terminal mode
Ctrl + ALT + F7Exit the terminal mode
Ctrl + CStop the current command
Ctrl + DLog out of current session
Ctrl + EscList running applications

A2 - Processes Commands

CommandDescription
htopMonitor processes & memory
psDisplay all active processes
topDisplay all running processes
ps -auxList all processes
sudo kill -9 -1Kill all processes for all users
sudo kill [Process-ID]Kill a process by ID
sudo xkillForce kill a certain program

A3 - Information Commands

CommandDescription
neofetchDisplay important system info
xdpyinfo | grep -B2 resolutionShow DPI information
sudo lsblk -aShow block device information
lshw -shortDisplay hardware info
lspciShow PCI buses info
sudo dmidecode -t baseboardShow motherboard info
sudo dmidecode -t biosShow BIOS info
sudo dmidecode -t memoryShow Memory / RAM info
yay -Qi package1 package2Displays info about an installed package
yay -Si package1 package2Displays info about any package

A4 - Update, Clean, Tune

CommandDescription
sudo pacman-mirrors --fasttrack && yay -SyyuTune mirrors and update system
sudo update-grubUpdate the boot loader (Grub)
update-mime-database ~/.local/share/mimeUpdate the mime database
yay -Sc; yay -YcClean system
history -i; rm $HISTFILEClean history of zsh terminal

A5 - Fixing Commands

CommandDescription
sudo rm /var/lib/pacman/db.lckRemove the Pacman lock
pacman-key --init && pacman-key --populate && pacman-key --refresh-keys && pacman -Sy archlinux-keyringRe-populate the keyring keys

CommandDescription
sudo /opt/lampp/manager-linux-x64.runLaunch XAMPP
sudo /opt/lampp/lampp startStart XAMPP
sudo /opt/lampp/lampp stopStop XAMPP
sudo /opt/lampp/lampp restartRestart XAMPP

A7 - Debug Commands

CommandDescription
sudo startxStart xsession / graphical interface
chown $USER:$USER .XauthorityResolve the boot loop problem
yay -Q | moreList installed packages
yay -Qe | moreList explicitly installed packages
yay -QmList manually installed packages
pacgraph -c | headGet all sizes of installed packages
find /var/cache/pacman/pkg/ -iname "*.part" -exec rm {} \;Resolve "Failed to commit transaction" error
rm /var/lib/pacman/db.lckResolve "Failed to init transaction" error
rfkill block wlanBlock Wifi
rfkill unblock wlanUnblock Wifi
rfkill block bluetoothBlock Bluetooth
rfkill unblock bluetoothUnblock Bluetooth

A8 - Other Commands

CommandDescription
yay -U <package_path>Install a package from a URL
yay -S package1 package2Install a program
yay -Rns package1 package2Remove a program
man [Command]View the reference manual of a command
sudo [Command]Execute a command with root permissions
sudo find ~/ -name "file"Search and find a specific file or folder
lsList all files and folders in a directory
ls -alFormatted listing with hidden files
whoamiShow the name of the current active user
pwdShow current directory
cdChange directory to the home directory
cd dirChange directory to dir
mkdir dirCreate a directory with a name dir
mv file1 file2Rename or move file1 to file2
cp file1 file2Copy file1 to file2
cp -r dir1 dir2Copy dir1 to dir2
rm fileDelete a file
rm -r dirDelete a directory
rm -f fileForce remove a file
rm -rf dirForce remove a directory

For those interested in diving deeper into the world of command-line operations, here are some recommended readings:

  • "The Linux Command Line" by William E. Shotts, Jr.
  • "Linux Pocket Guide" by Daniel J. Barrett
  • "Unix and Linux System Administration Handbook" by Evi Nemeth, Garth Snyder, Trent R. Hein, Ben Whaley, and Dan Mackin