Tip #173 Count files by type
To find out the number of files of each type in your current directory try the following:Read more »
Tip #177 Copy and paste from the command line
Add the following alias and function to your profile to be able to copy and paste files at the command line:Read more »
Tip #376 Change prompt color dynamically
I'm frequently logged into multiple different boxes concurrently. To help me keep track of which box I'm working on at the moment, I have this in my .bashrc file, which I keep rsynced across the various boxes.Read more »
- TAGS:
- bash
Tip #181 Remove empty directories
To remove empty directories (even if filenames or dirnames contain spaces or weird characters) from a tree you can do:Read more »
Tip #180 Permanent bash history
Often I find myself using Ctrl-R in Bash to get an old command, only to find that too many days have passed and it's no longer in the .bash_history file.It is possible to increase the number of lines in the history file, but there can always be a moment when you'll need a long command from many months ago. The solution below uses the PROMPT_COMMAND variable, a command that bash executes before showing each prompt. Here are the two lines to add to your profile:
Read more »
- TAGS:
- history
- bash
- redirection
Tip #872 Reverse geocode with bash
The following bash script, which depends on lynx web browser, uses Google's reverse geocode service to find a nearby address given a latitude and longitude pair:Read more »
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
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