All files in the directory will be renamed replacing every space in the filename by "_" (underline) and converting upper case characters to lower case characters. e.g. Foo Bar.txt --> foo_bar.txt
Translates first set into second set Show Sample Output
Convert long list of ' ' to a single space. Compress space and other characters. Show Sample Output
If there are spaces won't work.
Copying and pasting from Office documents open in Office:mac can dirty your files with Windows CRLF and (inexplicably) Classic Mac OS LF newlines, which can break some tools. This snippet replaces them with good ol' Unix LF newlines.
Lauching an app including jars in an adjacent lib folder to its classpath
Used in OS X. tr "\n" ";" may be replaced by echo ";" with linux versions of date. I reused ping -q -c 1 www.google.com|tail -1|cut -d/ -f5 Show Sample Output
This line unbuffers the interactive output of rsync's --progress flag creating a new line for every update. This output can now be used within a script to make actions (or possibly piped into a GUI generator for a progress bar)
Replace $USER with the username of the Reddit user in question. To get comment karma instead run...
curl -s http://www.reddit.com/user/$USER/about.json | tr "," "\n" | grep "comment_karma" | tr ": " "\n" | grep -E "[0-9]+" | sed s/"^"/"Comment Karma: "/
Show Sample Output
Counts of messages by recipient, with frozen messages excluded. Show Sample Output
Took one of the samples, added capitalization and removes in between spaces. The final "echo" is just for readability. Cheers Show Sample Output
My first command :) I made this command to log public addresses of a virtual interface who connects random VPN servers around the world. Show Sample Output
I did not come up with this one myself, but found this somewhere else several months ago. Show Sample Output
Uses urandom and tr to generate a random password. Change the value of head -c## for the lenght of the password. Show Sample Output
This lists the number of ogg/mp3/wav/flac files in each subdirectory of the current directory. The output can be sorted by piping it into "sort -n". Show Sample Output
This snippet will produce an alpha-numeric 16 character password Show Sample Output
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: