Commands using file (166)

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

Google Spell Checker
I took matthewbauer's cool one-liner and rewrote it as a shell function that returns all the suggestions or outputs "OK" if it doesn't find anything wrong. It should work on ksh, zsh, and bash. Users that don't have tee can leave that part off like this: $spellcheck(){ typeset y=$@;curl -sd "$y" https://google.com/tbproxy/spell|sed -n '/s="[1-9]"/{s/]*>/ /g;s/\t/ /g;s/ *\(.*\)/Suggestions: \1\n/g;p}';}

Make shell (script) low priority. Use for non interactive tasks

Check availability of Websites based on HTTP_CODE

Print permanent subtitles on a video
It prints myvideo.srt subtitle files in myvideo.avi, saving it in myvideo_subtitled.avi

Print a list of all hardlinks in the working directory, recursively
libpurple likes to hardlink files repeatedly. To ignore libpurple, use sed: | sed '/\.\/\.purple/d'

Regex to remove HTML-Tags from a file
This regular expression removes all HTML-Tags from the file.

Find the package that installed a command

Calculate md5 sums for every file in a directory tree

create random numbers within range for conjob usage
if you need to install cron jobs in a given time range.

Download an entire ftp directory using wget
If the username includes an @ you can use this one: wget -r --user=username_here --password=pass_here ftp://ftp.example.com


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: