Commands by Moltke (0)

  • bash: commands not found

What's this? 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

Convert seconds to human-readable format
This example, for example, produces the output, "Fri Feb 13 15:26:30 EST 2009"

recursively change file name from uppercase to lowercase (or viceversa)
Example of zsh globing, glob qualifier, and substitution: -Q state that the parameter will contain a glob qualifier. (**/)(*) is recursive (.) is our glob qualifier, with states the match is a file "." The first parameter $1, is then substituted with $2 but with lowercasing '(L)' ... a (U) would of course be from lower to upper.

GIT: list unpushed commits

clean up memory on linux
where proc filesystem mounted under /proc

List the URLs of tabs of the frontmost Chrome window in OS X
This also works with Safari if you just change the application name. Replace $ window 1 with $ windows to list the URLs of tabs in all windows instead of only the frontmost window. This also includes titles: $ osascript -e{'set o to""','tell app"google chrome"','repeat with t in tabs of window 1','set o to o&url of t&"\n"&" "&title of t&"\n"',end,end}|sed \$d .

Send a local file via email
Send it the easy way, with MIME and everything handled for you by an app that knows best.

Show contents of all git objects in a git repo
This script finds all git objects and `git cat-file`'s their content. This is really just a helper function to play around with the internals of git repositories. See of more info.

Setup an ssh tunnel
Uses ssh as tunnel tunnel for an other connection. -f runs ssh in the background -N tell that there is no command to run -L deals with the forwarding aspect where the first number is the local port number, the second is parameter is the name of the server to forward to and the third parameter is the port number on that server. The last part of the command is the usual ssh form consisting of the user name and remote server name

Rename files in batch

Replace space in filename
This commands removes space from all the files with specific extension. I've specifed *.jpg as an example.

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.


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: