Commands by wekoch (2)

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

Detect encoding of a text file
This command gives you the charset of a text file, which would be handy if you have no idea of the encoding.

Get information on your graphics card on linux (such as graphics memory size)
probably only works if you have one graphics card. used this: http://www.cyberciti.biz/faq/howto-find-linux-vga-video-card-ram/ as reference can be expanded, for example: $ lspci -v -s `lspci | awk '/VGA/{print $1}'` | sed -n '/Memory.*, prefetchable/s/.*\[size=\([^]]\+\)\]/\1/p' will just get the amount of prefetchable memory compare to: $ lshw -C display which does not give the size (it does give byte ranges and you could calculate the size from that, but that's a pain) Also uses a command which is not standard on linux; wheras lspci is a core utility provided by most systems

Explanation of system and MySQL error codes
perror should be installed if mysql-server package is installed

Switch to the previous branch used in git(1)
Very useful if you keep switching between the same two branches all the time.

sort through source to find most common authors

Stop or Start (Restart) a Windows service from a Linux machine
Control (stop, start, restart) a Windows Service from a Linux machine which has the `net` command (provided by samba).

Replace all tabs with spaces in an application
Note that this assumes the application is an SVN checkout and so we have to throw away all the .svn files before making the substitution.

Send a local file via email
if "mail -a" fail, try "mutt -a" or "nail -a"

Display formatted routes

Print only the odd lines of a file (GNU sed)
The tilde address operator is an extension of GNU sed. It won't work with POSIX sed.


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: