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

Put readline into vi mode
This lets you use your favorite vi edit keys to navigate your term. To set it permanently, put "set editing-mode vi" in your ~/.inputrc or /etc/inputrc.

Shows how many percents of all avaliable packages are installed in your gentoo system

See how many % of your memory firefox is using

Run a command, redirecting output to a file, then edit the file with vim.
This is one of those 'nothing' shell functions ...which I use all the time. If the command contains spaces, it must be quoted, e.g. $ vimcmd 'svn diff' /tmp/svndiff.out If I want to keep the output of the command that I'm running, I use vimcmd. If I don't need to keep the output, I use this: $ vim

Join lines
awk version of 7210. Slightly longer, but expanding it to catch blank lines is easier: $ awk 'BEGIN{RS="\0"}{gsub(/\n+/,"");print}' file.txt

Live stream a remote desktop over ssh using only ffmpeg
Play with the framerate option '-r' to scale back bandwidth usage. The '-s' option is the captured screan area, not the rescaled size. If you want to rescale add a second '-s' option after '-i :0'. Rescaling smaller will also decrease bandwidth.

list block devices
Shows all block devices in a tree with descruptions of what they are.

continuously check size of files or directories
very handy if you copy or download a/some file(s) and want to know how big it is at the moment

for all who don't have the watch command

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


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: