Commands by jmcantrell (5)

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

ensure your ssh tunnel will always be up (add in crontab)
I find it ugly & sexy at the same time isn't it ?

How to trim a video using ffmpeg
Will trim the video to 4 seconds starting from the beginning. The -vcodec , -acodec options are required so that ffmpeg knows in what video/audio format you want for the new video.

faster version of ls *
I know its not much but is very useful in time consuming scripts (cron, rc.d, etc).

python - covert image to base64 string for data URI use
useful if you are using lots of data URI's in your css files

Create a quick back-up copy of a file
Uses shell expansion to create a back-up called file.txt.bak

shell function to make gnu info act like man.
I use this alias in my bashrc. The --vi-keys option makes info use vi-like and less-like key bindings.

create a temporary file in a command line call
Sometimes you have a script that needs and inputfile for execution. If you don't want to create one because it may contain only one line you can use the `

Delete recursively only empty folders on present dir

Change user, assume environment, stay in current dir
I've used this a number of times troubleshooting user permissions. Instead of just 'su - user' you can throw another hyphen and stay in the original directory.

Isolate file name from full path/find output
Quick method of isolating filenames from a full path using expansion. Much quicker than using "basename"


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: