Commands by fishdaemon (2)


  • 0
    word=$(shuf -n4 /usr/share/dict/words); for w in ${word[@]}; do w=${w^}; w=${w//\'/}; p+=$w; done; echo $p
    fishdaemon · 2013-08-22 08:21:41 9
  • Use meaningful exit codes change "source" to "cat" to view output instead of assigning Show Sample Output


    -1
    source <(egrep '^#define EX_.*' /usr/include/sysexits.h | sed -e 's/#define/declare -r/g' | sed 's/\//#/g' | sed -e 's/\s\{1,\}/ /g' | sed -e 's/ \([0-9]\)/\=\1/'g )
    fishdaemon · 2012-09-21 13:30:37 11

What's this?

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.

Share Your Commands


Check These Out

how many pages will my text files print on?
This gives a very rough estimate of how many pages your text files will print on. Assumes 60 lines per page, and does not take long lines into account.

get you public ip address

Simple Gumblar check command

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

list all executables in your path
If run in bash, this will display all executables that are in your current $PATH

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Print github url for the current url
Works for repos cloned via ssh or https.

Jump to a song in your XMMS2 playlist, based on song title/artist
Usage: Declare this function in your Shell, then use it like this: $> jumpTo foo The script will search for the 'foo' pattern in your current xmms2 playlist (artist or songname), and play the first occurence of it !

Recursive find and replace file extension / suffix (mass rename files)
Find recursively all files in ~/Notes with the extension '.md' and pipe that via xargs to rename command, which will replace every '.md' to '.txt' in this example (existing files will not be overwritten).

background a wget download


Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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: