Tip #46
Using expansion to move a file aside without having to type the file name twiceRead more »
- TAGS:
- bash
Tip #26
Running a second command with the same arguments as the previous command, use '!*' to repeat all arguments or '!:2' to use the second argument. '!$' uses the final argument.Read more »
- TAGS:
- history
Tip #107 Use history to SUDO last command
Forget that your running as underprivileged? No need to retype the command.> command_with_insufficient_permissions
Permission denied
> sudo !! Read more »
- TAGS:
- history
Tip #77 Bash fork bomb
Don't forget the bash fork bomb. DO NOT TRY THIS AT HOME... Posted here so that you don't see this in a forum or a mailing list and use it without knowing:Read more »
- TAGS:
- bash
- redirection
Tip #24
Don't search history by grepping ~/.bash_history, or repeatedly hitting the up arrow, instead use CTRL+r (or '/' in vi-mode) for search-as-you type. You can immediately run the command by pressing Enter. Read more »- TAGS:
- history
Tip #21
Place a filename at the beginning of the line to make it easier to edit the search at the end of the command.Read more »
- TAGS:
- grep
- redirection
Tip #185 CDPATH
This is a little known and very underrated shell variable. CDPATH does for the cd built-in what PATH does for executables. By setting this wisely, you can cut down on the number of key-strokes you enter per day.For example:
Read more »
- TAGS:
- bash
Tip #275 Get an ordered list of subdirectory sizes
This piece of code lists the size of every file and subdirectory of the current directory, much like du -sch ./* except the output is sorted by size, with larger files and directories at the end of the list. Useful to find where all that space goes.Read more »
Tip #45
multiple command output into a single program:diff -u <(ls -c1 dir_1) <(ls -c1 dir_2)
Will show you a diff of files in the root of dir_1 and dir_2 Read more »
alias aptitude at awk bash bc cal cat cd colrm comm cp csh curl cut date dd df dialog diff dirname dpkg du fc find fuser grep gs gzip history iconv kill ksh last less ln ls lsof lynx m4 md5sum mkdir mkfifo mkisofs mv mysql nc netstat openssl OSX perl ping popd ps pushd python read redirection rm scp screen sed sort ssh stat sudo svn tail tar tee test top tr uniq vim wc wget xargs