Tip #11
Add commas to all numeric strings in a file, changing "1234567" to "1,234,567"Read more »
- TAGS:
- sed
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 #22 Grepping for processes
Grepping for a process will return the grep command, this can be avoided by adding '| grep -v grep' to a command or easier in some cases altering the regular expression by adding brackets around a character.Read more »
Tip #23
It can be useful to not only know what has gone to stdout and stderr but also where they occurred with respect to each other.Allow stderr to go to err.txt, stdout to out.txt and both to mix.txt
Read more »
- TAGS:
- redirection
- tee
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 #25
Instead of adding a prefix to the previous command with 'Up-arrow Home prefix Space' try 'prefix !!' to repeat the last command with 'prefix ' before it.You can also use '!-n' to use commands other than the most recent. Read more »
- TAGS:
- history
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 #27
Use awk to change the file extension for a group of files. For example to change all .htm files to .php:Read more »
- TAGS:
- awk
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