Hide

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. 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.


If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/

Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

Universal configuration monitoring and system of record for IT.
Hide

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:

Hide

News

May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!
Hide

Top Tags

Hide

Functions

Hide

Credits

Commands tagged version from sorted by
Terminal - Commands tagged version - 9 results
export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
2015-07-30 18:50:51
Functions: export
Tags: version java
0

Useful if you have multiple versions of Java installed. The 1.7 pkg for Mac doesn't tell you anything about where it's putting stuff.

strings /usr/lib/flashplugin-nonfree/libflashplayer.so |grep ^LNX
2012-04-25 10:34:57
User: domicius
Functions: grep strings
1

This is for Debian, simply change the path if your Flash plugin is installed elsewhere.

if [ -z "${BASH_VERSINFO}" ] || [ -z "${BASH_VERSINFO[0]}" ] || [ ${BASH_VERSINFO[0]} -lt 4 ]; then echo "This script requires Bash version >= 4"; exit 1; fi
2011-02-25 11:02:47
User: hfs
Functions: echo exit
Tags: bash version
0

If you use new features of a certain Bash version in your shell script, make sure that it actually runs with the required version.

perldoc perllocal
2010-04-14 10:57:56
User: octopus
Tags: version perl
3

This command will give you the detailed information about the installed perl modules i.e. installed path, Link type, version, files etc.

sw_vers
test `uname` = Linux && lsb_release -a || ( test `uname` = SunOS && cat /etc/release || uname -rms )
2009-07-07 20:51:30
User: virtualshock
Functions: cat test uname
-7

Found in comments section works on most Linux flavors.

nslookup -q=txt -class=CHAOS version.bind NS.PHX5.NEARLYFREESPEECH.NET
lsb_release -d
cat /etc/*-release
2009-02-26 08:22:01
User: sudopeople
Functions: cat
11

Works for most distributions, tested on Ubuntu, Fedora, CentOS, Gentoo, SUSE, RedHat.

Debian and Slackware:

cat /etc/*version