User Tools

Site Tools


linux_cheat_sheet

This is an old revision of the document!


Linux Cheat Sheet

2026/08/13 08:34Stephen Heise
2025/12/08 06:03Stephen Heise
2024/07/30 00:20Stephen Heise

Generate Notes

  • Use apt-get in scripts, apt manually in interactive terminals.

Bash Commands

sudo apt-get update
sudo apt-get install -y dotnet-sdk-7.0
Install Dotnet on WSL.
ll or ls -alF List files properly.
sudo apt update && sudo apt upgrade Update the system.
sudo -i Make me root for the rest of the session.
File System
lsblk -f List block devices — all types of storage devices.
sudo fsck -y /dev/sda2 File system check and repair.
sudo smartctl -a /dev/sda Check disk SMART status.
rm -r [directory_name] Delete a directory and everything in it.
sudo chmod +x /usr/local/bin/sign-kernel Make a file executable.
sudo chmod a+rwx /DirectoryName Give everyone access.
ln -s [target_file] [link_name] Make a symbolic link.
Disk Mounting
df -hP List mount points.
fuser -cu /dev/sda3 List processes using mount point.
fuser -k /backup Kill all process using mount point.
umount /dev/sda3 or umount /media/stephen Unmount.
mount /dev/vdb1 /new_backup Mount.
Edit /etc/fstab Make mount point permanent.
Networking
sudo systemctl restart NetworkManager
sudo systemctl restart systemd-networkd
Restart the network.
Diagnostic Info
mokutil –sb-state SecureBoot status.

Run commands on Bash start up

Edit your .bashrc file, it will be \\wsl.localhost\Ubuntu\home\<you>\.bashrc, append whatever you want to the bottom.

linux_cheat_sheet.1786612214.txt.gz · Last modified: 2026/08/13 09:10 by stephen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki