computer_science:linux:linux_cheatsheet

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
computer_science:linux:linux_cheatsheet [2021/03/07 17:27] – [Administration:] carlossousacomputer_science:linux:linux_cheatsheet [2023/12/01 12:07] (current) – external edit 127.0.0.1
Line 21: Line 21:
  
 </code>       |fg %2|<n> being the value from a job.| </code>       |fg %2|<n> being the value from a job.|
-|tmux|Opens a shell so the user can logout and the process keeps running in the background.|<code bash> 
-tmux 
  
 +\\
  
-</code>       |tmux →CTRL+B|tmux starts the shell, CTRL+B puts it in the background. This prevents that if a user logged in via SSH, a software (for example a game server) to terminate once the user logged out.+ 
-|tmux attach|Attachs the shell to the tmux shell in the background|<code bash>+===== tmux ===== 
 + 
 +^Command^Description^Syntax| 
 +|tmux list-sessions|Shows all live tmux sessions|<code> 
 +tmux list-sessions 
 + 
 +</code>  
 +|tmux attach| \\ Attaches to the last active tmux session. \\  \\ The session can be specified. \\ |<code>
 tmux attach tmux attach
  
 +</code><code>
 +tmux attach-session -t <sessionNumber>
 +
 +</code>  |
 +|CTRL+B - D|Dettachs to the current tmux session|<code>
 +CTRL+B - D
 +
 +</code>       |
 +|CTRL+B - %|Creates a New Horizontally Aligned Tab|<code>
 +CTRL+B - %
 +
 +</code>       |
 +|CTRL+B - "|Creates a New Vertically Aligned Tab|<code>
 +CTRL+B - "
 +
 +</code>       |
 +|CTRL+B - Arrows|Moves to existent Tabs|<code>
 +CTRL+B - Arrows
 +
 +</code>       |
 +
 +\\
  
-</code>       |tmux attach → D|Attachs the shell to the last used tmux.  | 
  
 ===== Disks and File Transfer: ===== ===== Disks and File Transfer: =====
  
-^Command^Description^Syntax^Example^Notes|+^Command^Description^Syntax^Notes|
 | \\ scp -r * remoteuser@remoteserver:/remote/folder/  |Copy all files and folders recursively from local to remote|<code> | \\ scp -r * remoteuser@remoteserver:/remote/folder/  |Copy all files and folders recursively from local to remote|<code>
 scp -r * remoteuser@remoteserver:/remote/folder/ scp -r * remoteuser@remoteserver:/remote/folder/
  
-</code>       |   |+</code>         |
 |du -sh /mnt/zebrabackup01/test  |Shows folder size|<code> |du -sh /mnt/zebrabackup01/test  |Shows folder size|<code>
 du -sh /mnt/zebrabackup01/test du -sh /mnt/zebrabackup01/test
  
-</code>       | |+</code>       | |
 |ls|Shows object cont in folder|<code bash> |ls|Shows object cont in folder|<code bash>
 ls | wc -l ls | wc -l
  
  
-</code>       | |+</code>       | |
 |<code bash> |<code bash>
 du -smh * | sort -nr | head -15 du -smh * | sort -nr | head -15
Line 56: Line 83:
  
  
-</code>       |   |+</code>         | 
 + 
 +\\ 
  
 ===== Administration: ===== ===== Administration: =====
  
-^Command^Description^Syntax^Example^Notes|+^Command^Description^Syntax^Notes|
 |ip a \\ **OR** \\ ifconfig|Check your machine IPs|<code bash> |ip a \\ **OR** \\ ifconfig|Check your machine IPs|<code bash>
 ip a ip a
Line 69: Line 99:
  
  
-</code>       | |+</code>       | |
 |dmidecode –type memory|Shows the installed memory on your system|<code bash> |dmidecode –type memory|Shows the installed memory on your system|<code bash>
 dmidecode --type memory dmidecode --type memory
  
  
-</code>       |   |+</code>         |
 |<code bash> |<code bash>
 find /var/log -type f -regex ".*\.gz$" find /var/log -type f -regex ".*\.gz$"
Line 85: Line 115:
  
  
-</code>       |Add '-delete' to actually delete the files found.  |+</code>       |Add '-delete' to actually delete the files found.  |
 |<code bash> |<code bash>
 for CLEAN in $(find /var/log/ -type f) for CLEAN in $(find /var/log/ -type f)
Line 100: Line 130:
  
  
-</code>       |Deleting the files can cause issues. Emptying them is safer and recommended.  |+</code>       |Deleting the files can cause issues. Emptying them is safer and recommended.  |
 |<code> |<code>
 sudo !! sudo !!
  
-</code>  |Re-run last command as root|<code>+</code>       |Re-run last command as root|<code>
 nano /etc/example.log nano /etc/example.log
 sudo !! sudo !!
  
-</code>  | |   |+</code>       |   | 
 +|CTRL+x+e  |Opens an editor, to create long / complex commands. Runs on saving|In Terminal: \\ CTRL+x+e \\ ls -l \\ CTRL+X \\ ENTER| | 
 +|fc  |Opens the last command in an editor to make it easier to fix it.|<code> 
 +fc 
 + 
 +</code>     | | 
 +|disown -a && exit  |Exit Terminal but leave all processes running|<code> 
 +disown -a && exit 
 + 
 +</code>     | |
  
 \\ \\
  
  
  • computer_science/linux/linux_cheatsheet.1615138049.txt.gz
  • Last modified: 2023/12/01 12:07
  • (external edit)