I. Coreutils -------------------------------------- BASH ==== keys: ^R - search backward in command history ^G - return to the normal state ^L - clear the screen ^D - logout ^S - scroll lock [sometimes, 4ex. on my laptop] - search forward in command history ^Q - unlock the screen [if ^S is scroll lock 4ex. on my laptop] utils: ls - list content of a directory ls -l - list content of a directory in more depth cd {DIR} - change directory. if DIR is not defined, change to $HOME cd - - change to previous directory file - identify the type of a file stat {File} - get informations all information about a file users - current users pwd - 'print working directory' find /directory -name file - search for a specific file chmod -R u-wx+rX ./ - change mode on user ['u', group 'g', others 'o'] to not write or execute, but give him a right to read files and change directories ['X'] + [-R] - recursive networking: ping -c X [host.domain.tld,IPAddress] - check if host.domain.tld or IP Address is active via 'X' number of ICMP packets netstat -t - print out active TCP connections netstat -lt - print out daemons waiting for TCP connections ssh-keygen - generate a RSA keypair for SSH key-based autentization. ~/.ssh/id_rsa.pub sould be then exported to destination server to ~/.ssh/autorizes_keys [do not confuse with ~/.ssh/known_hosts!] ssh-add - add newly generated keypair ~/.ssh/id_rsa to our key database ntpdate -s ntp.domain.tld - synchronize system clock with a server [4ex. tak.cesent.cz] via Network Time Protocol and log to syslog facility [-s] VIM === keys: i - insert R - replace Esc - quit editing mode [for commands], enter non-interactive mode. q'Key' - record a macro under the given key. end recording by pressing 'q' again in non-interactive mode. example: qq @'Key' - play a macro recorded under the given key. example: @q @@ - replay last used macro commands: :q! - force quit, do not save changes :!command - execute a given command in system shell :w - write [save the current document] :w file - write to a given file :wq - write and quit :e! - undo changes to the last write [save] :n - 'next' if editing multiple documents :wn - write the changes and continue on the next document if editing multiple files :%s/^hello/hi/g - use sed on whole document [%s] and replace 'hello' from the beginning of every line with 'hi'. vide man sed for wildcards :help - if lost, help is still available GPG === commands: gpg --list-keys {Key_ID} - list all keys in your key database. if Key_ID defined, list only this key. gpg --gen-key - generate new keypair gpg --export Key_ID -a -o ~/key.aa.pub - export Key_ID key to /home/$USER/key.aa.pub as an ASCII armored file [uuencode like] gpg -esa --for-your-eyes-only file - *E*ncrypt, *S*ign and *A*SCII armor the output - If 'For Your Eyes Only', GPG will refuse to save the file unless the --output option is given. gpg --decrypt --output result.file crypted.file - decrypt [and verify signature, if present] given file and save output to result.file. II. Debian-specific ------------------------------------- update-alternatives --set editor /usr/bin/vim.tiny will link /etc/alternatives/editor to /usr/bin/vim.tiny "The Debian Way"