| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| linux_cheat_sheet [2026/08/13 08:36] – stephen | linux_cheat_sheet [2026/08/13 22:35] (current) – stephen |
|---|
| ====== Linux Cheat Sheet ====== | ====== Linux Cheat Sheet ====== |
| |
| {{topic>linux-archived}} | {{topic>linux -archived}} |
| | |
| | ===== Generate Notes ===== |
| | |
| | * Use ''apt-get'' in scripts, ''apt'' manually in interactive terminals. |
| |
| ===== Bash Commands ===== | ===== Bash Commands ===== |
| |
| | ''sudo apt-get update && sudo apt-get install -y dotnet-sdk-7.0'' | Install Dotnet on WSL. | | | ''sudo apt-get update'' \\ ''sudo apt-get install -y dotnet-sdk-7.0'' | Install Dotnet on WSL. | |
| | ''ll'' or ''ls -alF'' | List files properly. | | | ''ll'' or ''ls -alF'' | List files properly. | |
| | ''sudo apt update && sudo apt upgrade'' | Update the system. | | | ''sudo apt update && sudo apt upgrade'' | Update the system. | |
| | ''sudo -i'' | Make me root for the rest of the session. | | | ''sudo -i'' | Make me root for the rest of the session. | |
| | File System || | | File System || |
| | | ''lsblk -f'' | List block devices — all types of storage devices. | |
| | | ''sudo fsck -y /dev/sda2'' | File system check and repair. | |
| | | ''sudo apt install smartmontools'' \\ ''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 +x /usr/local/bin/sign-kernel'' | Make a file executable. | |
| | ''sudo chmod a+rwx /DirectoryName'' | Give everyone access. | | | ''sudo chmod a+rwx /DirectoryName'' | Give everyone access. | |
| | ''ln -s [target_file] [link_name]'' | Make a symbolic link. | | | ''ln -s [target_file] [link_name]'' | Make a symbolic link. | |
| | ''rm -r [directory_name]'' | Delete a directory and everything in it. | | |
| | Disk Mounting || | | Disk Mounting || |
| | ''df -hP'' | List mount points. | | | ''df -hP'' | List mount points. | |
| | Edit ''/etc/fstab'' | Make mount point permanent. | | | Edit ''/etc/fstab'' | Make mount point permanent. | |
| | Networking || | | Networking || |
| | ''sudo systemctl restart NetworkManager && sudo systemctl restart systemd-networkd'' | Restart the network. | | | ''sudo systemctl restart NetworkManager'' \\ ''sudo systemctl restart systemd-networkd'' | Restart the network. | |
| | Diagnostic Info || | | Diagnostic Info || |
| | ''mokutil --sb-state'' | SecureBoot status. | | | ''mokutil --sb-state'' | SecureBoot status. | |