> dd [if=input] [of=output] [bs=blksize] [count=#-blks] [conv=opts]
> dd
if=
of=
bs=
count=
conv=
/dev/zero
man 4 null zero random urandom full
/dev/null Reads return EOF (End Of File), writes are discarded. /dev/zero Reads return null characters ('\0'), writes are discarded. /dev/random Returns random data, sourced from an entropy pool -- can be very slow and block when the pool is empty. Writes update the entropy pool. /dev/urandom A source of pseudo-random data, not sourced from a pool. Writes update the PRNG (seed) /dev/full Writes fail with the error "no space left", reads return null bytes. Used for error-testing programs.
/dev/null
'\0'
/dev/random
/dev/urandom
/dev/full
Swap files or page files are used by the virtual memory system of the OS to augment the amount of available memory by using the hard drive as a secondary level of memory. When additional memory is needed, unused memory is "swapped" to disk, freeing up main memory to be used in a different area.
# mkswap [options] device
# mkswap
# swapon [-a] [device]
# swapon
-a
# swapoff [-a] [device]
# swapoff
# swaplabel [-L label] device
# swaplabel
-L
> free
/proc/swaps
0600
# dd if=/dev/zero of=/swap bs=1M count=1k
# mkswap /swap
# chmod 0600 /swap
# swapon /swap
Enables swapping in the new swap file. Should be added to /etc/fstab to make the system start swapping on it on boot-up.
/etc/fstab
Example /etc/fstab entry: /swap none swap defaults 0 0
/swap none swap defaults 0 0
# mount [-o options] [-t type] device dir
# mount
-o
-t
Option What it does * defaults Mount with default options (mostly used in /etc/fstab) implies: rw, suid, dev, exec, auto, nouser, and async. * noatime Don't update atime records on files * noauto Don't mount it explicitly (mostly used in /etc/fstab) nodev Don't interpret device files on the file-system * noexec Don't execute binaries on the file-system nosuid Don't allow setuid binaries on this file-system * remount Remounts the file-system with the new options * ro Mount file-system in read-only mode rw Mount FS in read-write mode (default) * = remember these (may be useful in the future)
* = remember these (may be useful in the future)
Example: # mount -o ro,remount /dev/sda1 /mnt
# mount -o ro,remount /dev/sda1 /mnt
/dev/sda1
/mnt
# umount dir | device`
# umount
un-mounts a filesystem.
Examples: # umount /dev/sda1
# umount /dev/sda1
# umount /mnt
# fuser [-uv] [-m filesystem] [-n tcp|udp port] [file]
# fuser
-uv
-m
-n
tcp
udp
Display processes (& users -u) using files, filesystems (-m) or sockets (-n).
-u
Example: # fuser -uvm /net
# fuser -uvm /net
/net
# lsof