If you have lots of subversion working copies in one directory and want to see in which repositories they are stored, this will do the trick. Can be convenient if you need to move to a new subversion server. Show Sample Output
Get the hour and greet the user! Make sure you add this to your bashrc, for a pleasant hacking experience! Show Sample Output
It can work for message queue, semaphore set or shared memory just changing the parameter.
Useful when upgrading my Linux distro and trying to copy only "settings" from the old home folder to the new one.
Useful to get info about the hard disk detail. Show Sample Output
Show the crontabs of all the users. Show Sample Output
Create a byobu (tmux) session and attach several windows to it.
This script can be used to download enclosed files from a RSS feed. For example, it can be used to download mp3 files from a podcasts RSS feed. Show Sample Output
Allows you to have a list of the domains on the server.
extract () { if [ -f $1 ] ; then case $1 in *.tar.bz2) tar xvjf $1 ;; *.tar.gz) tar xvzf $1 ;; *.tar.xz) tar Jxvf $1 ;; *.bz2) bunzip2 $1 ;; *.rar) unrar x $1 ;; *.gz) gunzip $1 ;; *.tar) tar xvf $1 ;; *.tbz2) tar xvjf $1 ;; *.tgz) tar xvzf $1 ;; *.zip) unzip $1 ;; *.Z) uncompress $1 ;; *.7z) 7z x $1 ;; *) echo "don't know how to extract '$1'..." ;; esac read -r -p "Delete the compressed file? [Y/N] " response response=${response,,} # tolower if [[ $response =~ ^([Yy]es|YES|[Yy])$ ]]; then echo "rm '$1'" rm $1 fi else echo "'$1' is not a valid file!" fi }
This will return a nice finish date and time when you're rebuilding a software raid array.
echo 'Current hour' hour=$(date +%H) if [ $hour -gt 9 -a $hour -lt 23 ]; then echo -n '*'; else echo -n '#'; fi; echo ' '$hour; echo 'Test around the clock:' for hour in {0..23} {0..23}; do if [ $hour -gt 9 -a $hour -lt 23 ]; then echo -n '*'; else echo -n '#'; fi; echo ' '$hour; done echo 'If you need to depend on UTC, just add `-u` flag to `date` command' Show Sample Output
Great for sites like Gigapedia.org that give away great free rar'd books. More similar commands here: http://www.howtogeek.com/howto/ubuntu/unzip-or-unrar-many-files-at-once-in-linux/ Show Sample Output
the command for the impatient sysadmin: simply checks every five secs, if a host or a specific service running on it is up. ideal for hosts that are configured not to respond on pings. Show Sample Output
The tcpdump arguments are just an example.
- The last sed expression ensures the unicast/multicast bit is set to zero - The greedy space replacements are for portability across UNIX seds (note there's TWO spaces and not just one, as this web shows, in s/^ */) Show Sample Output
Knoppix is Debian running in RAM, one of the best distros I've seen, but I had to left click the hardware button to use the system, because touchpad ignored taps. Not anymore
Easiest way to get the external IP address.
this comand open the default program for the file you want to open
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: