User Tools

Site Tools


linux_cheat_sheet

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux_cheat_sheet [2026/08/13 08:34] – created stephenlinux_cheat_sheet [2026/09/22 03:16] (current) – stephen
Line 1: Line 1:
 ====== Linux Cheat Sheet ====== ====== Linux Cheat Sheet ======
  
-{{topic>linux-archived}}+{{topic>linux -archived}} 
 + 
 +===== Generate Notes ===== 
 + 
 +  * Use ''apt-get'' in scripts, ''apt'' manually in interactive terminals. 
 + 
 +===== System Shortcuts ===== 
 + 
 +| Ctrl + Alt + Esc | Restart Cinnamon desktop (X11 only) | 
 + 
 +===== Bash Shortcuts ===== 
 + 
 +| Ctrl + l | Clear screen | 
 +| Ctrl + a | Move to start of line | 
 +| Ctrl + e | Move to end of line | 
 +| Ctrl + ← | Move backwards by a word | 
 +| Ctrl + → | Move forwards by a word | 
 +| Alt + Backspace | Delete a word (backwards) | 
 +| Ctrl + Delete | Delete a word (forwards) | 
 +| Ctrl + u | Delete from cursor to start of line | 
 +| Ctrl + k | Delete from cursor to end of line | 
 +| Ctrl + a, ctrl + k | Delete line | 
 +| Ctrl + u, ctrl + k | Delete line (alternative) | 
 +| Ctrl + p | Get previous command | 
 +| Ctrl + n | Get next command | 
 +| Ctrl + r | Search command history |
  
 ===== 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. |
 +| ''ln -s [target_file] [link_name]'' | Make a symbolic link. |
 +|  File System - Permissions  ||
 | ''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. | +| ''sudo chown -R stephen /DirectoryName'' | Change ownership recursively. | 
-| ''rm -r [directory_name]'' | Delete a directory and everything in it. |+| ''sudo chown -R stephen:stephen /DirectoryName'' | Change group recursively. | 
 +|  Groups  || 
 +| ''getent group'' or ''cat /etc/group'' | List groups and who is in them. | 
 +| ''groups'' or ''id -nG'' | List groups //I// am in. | 
 +| ''groups [user]'' | List groups //I// am in. | 
 +| ''sudo usermod -aG [group] [user]'' | Add user to a group (restart terminal to take effect). |
 |  Disk Mounting  || |  Disk Mounting  ||
 | ''df -hP'' | List mount points. | | ''df -hP'' | List mount points. |
Line 22: Line 58:
 | 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. |
  
-{{tag>reaper}}+===== 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. 
 + 
 +{{tag>linux}}
linux_cheat_sheet.1786610058.txt.gz · Last modified: 2026/08/13 08:34 by stephen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki