User Tools

Site Tools


quickreference:unix

Differences

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

Link to this comparison view

Next revision
Previous revision
quickreference:unix [2019/01/29 01:18]
127.0.0.1 external edit
quickreference:unix [2019/09/24 21:32] (current)
rodolico
Line 2: Line 2:
  
 This is just a location where I store various commands I found handy for Unix. This is just a location where I store various commands I found handy for Unix.
 +
 +===== Disk Management =====
 +
 +==== Create Swap file ====
 +
 +I generally prefer a swap //file// as opposed to a swap //​partition//​. While swap partitions can be more efficient, swap files are easier to manage (grow/​shrink).
 +
 +<code bash>
 +fallocate -l 1G /swapfile
 +# if no fallocate on your system, use the following
 +# dd if=/​dev/​zero of=/​swapfile bs=1024 count=1048576
 +chmod 600 /swapfile
 +# use "​force"​ to use the entire "​device"​
 +mkswap -f /swapfile
 +# save, then modify fstab
 +mv /etc/fstab /​etc/​fstab.save
 +echo '/​swapfile swap swap defaults 0 0' >> /etc/fstab
 +# turn on swap for everything in fstab
 +swapon -a
 +# display the result
 +swapon --show
 +</​code>​
  
 ===== Shell (mainly BASH) ===== ===== Shell (mainly BASH) =====
Line 152: Line 174:
 ===== References ===== ===== References =====
   * https://​stackoverflow.com/​questions/​2419566/​best-way-to-use-multiple-ssh-private-keys-on-one-client#​2419609   * https://​stackoverflow.com/​questions/​2419566/​best-way-to-use-multiple-ssh-private-keys-on-one-client#​2419609
 +  * https://​linuxize.com/​post/​how-to-add-swap-space-on-debian-9/​
  
quickreference/unix.1548746317.txt.gz ยท Last modified: 2019/01/29 01:18 by 127.0.0.1