Check These Out
add the command either in /etc/profile or ~/.bash_profile so that this is available to your shell.
Bash history commands are those that begin with the character !
(eg. the most popular 'sudo !!' Explained here => http://www.commandlinefu.com/commands/view/13).
By default bash immediately executes the history command.
Setting this shell option will make bash first allow you to verify/edit an
history command before executing it.
To set this option permanently, put this command in ~/.profile or ~/.bashrc file.
To unset this option issue following command.
$shopt -u histverify
In this example we search for 'vim' but vim doesn't have a project on github right now. That's ok, this command still searches for every project that has 'vim' in their description (forks, plugins, etc). To get XML or JSON output just replace 'yaml' in the url with 'xml' or 'json'.
In addition to a swap partition, Linux can also use a swap file. Some programs, like g++, can use huge amounts of virtual memory, requiring the temporary creation of extra space.
I wanted to create a copy of my whole laptop disk on an lvm disk of the same size.
First I created the logical volume: lvcreate -L120G -nlaptop mylvms
SOURCE: dd if=/dev/sda bs=16065b | netcat ip-target 1234
TARGET: nc -l -p 1234 | dd of=/dev/mapper/mylvms-laptop bs=16065b
to follow its process you issue the following command in a different terminal
STATS: on target in a different terminal: watch -n60 -- kill -USR1 $(pgrep dd)
(see http://www.commandlinefu.com/commands/view/4356/output-stats-from-a-running-dd-command-to-see-its-progress)
Usage:
$ mydir=/very/long/path/to/a/dir
$ cd mydir
I often need to cd where no man wants to go (i.e. long path). by enabling the shell option cdable_vars, I can tell cd to assume the destination is the name of a variable.
Sometimes you need to use a port that is already opened by some program , and you don't know who to "kill" for it to release - so, now you do !
in case you run some command in CLI and would like to take read strerr little bit better, you can use the following command. It's also possible to grep it if necessary....
Shows all block devices in a tree with descruptions of what they are.
Create a exact mirror of the local folder "/root/files", on remote server 'remote_server' using SSH command (listening on port 22)
(all files & folders on destination server/folder will be deleted)