Commands tagged version (11)

  • Works for most distributions, tested on Ubuntu, Fedora, CentOS, Gentoo, SUSE, RedHat. Debian and Slackware: cat /etc/*version Show Sample Output


    11
    cat /etc/*-release
    sudopeople · 2009-02-26 08:22:01 6
  • Apart from an exact copy of your recent contents, also keep all earlier versions of files and folders that were modified or deleted. Inspired by the excellent EVACopy http://evacopy.sourceforge.net Show Sample Output


    5
    backup() { source=$1 ; rsync --relative --force --ignore-errors --no-perms --chmod=ugo=rwX --delete --backup --backup-dir=$(date +%Y%m%d-%H%M%S)_Backup --whole-file -a -v $source/ ~/Backup ; } ; backup /source_folder_to_backup
    pascalv · 2018-08-02 21:27:29 0
  • This command will give you the detailed information about the installed perl modules i.e. installed path, Link type, version, files etc. Show Sample Output


    3
    perldoc perllocal
    octopus · 2010-04-14 10:57:56 1

  • 2
    sw_vers
    theoj · 2009-08-29 21:27:18 0
  • This is for Debian, simply change the path if your Flash plugin is installed elsewhere. Show Sample Output


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

  • 0
    nslookup -q=txt -class=CHAOS version.bind NS.PHX5.NEARLYFREESPEECH.NET
    unixmonkey4063 · 2009-06-02 19:54:24 1
  • If you use new features of a certain Bash version in your shell script, make sure that it actually runs with the required version.


    0
    if [ -z "${BASH_VERSINFO}" ] || [ -z "${BASH_VERSINFO[0]}" ] || [ ${BASH_VERSINFO[0]} -lt 4 ]; then echo "This script requires Bash version >= 4"; exit 1; fi
    hfs · 2011-02-25 11:02:47 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. Show Sample Output


    0
    export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
    robinsonaarond · 2015-07-30 18:50:51 0
  • Cleaner than the top alternative Show Sample Output


    0
    test `uname` = Linux && lsb_release -a 2>/dev/null || ( test `uname` = SunOS && cat /etc/release || uname -rms )
    amhhhhhhh · 2017-04-25 13:35:40 0

  • -4
    lsb_release -d
    tebeka · 2009-05-07 16:19:04 6
  • Found in comments section works on most Linux flavors. Show Sample Output


    -8
    test `uname` = Linux && lsb_release -a || ( test `uname` = SunOS && cat /etc/release || uname -rms )
    virtualshock · 2009-07-07 20:51:30 0

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

Get notified when a job you run in a terminal is done, using NotifyOSD
This is an alias you can add to your .bashrc file to get notified when a job you run in a terminal is done. example of use sleep 20; alert Source:http://www.webupd8.org/2010/07/get-notified-when-job-you-run-in.html

clone a hard drive to a remote directory via ssh tunnel, and compressing the image

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Mount and umount iso files
Add the functions to the .bashrc to make it work Example: First go to the iso file directory and type: ---------------------------------------------------------------------------------------------------- user@box:~$ miso file.iso ---------------------------------------------------------------------------------------------------- It will put you into a temporary mounting point directory (ISO_CD) and will show the files You can umount the iso file whatever the directory you are ---------------------------------------------------------------------------------------------------- user@box:~/ISO_CD$ uiso ---------------------------------------------------------------------------------------------------- It wil umount the iso file and remove the temporary directory in your home

get stdout to variable and stdout at sametime
Sometimes you want to write the script output to stdout but you need to send it to email. If you use: $ var="$( ls / )"; $ echo -e "$var"; works but, you need to wait the script terminate to bufferize then print the output var; With this way, you can use/work/print the output before the variable receive all the output content, then after it you can use the variable for anything else, like send email.

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

GZip all files in a directory separately

Press a key automatically
Press a key automatically via xvkbd.

Remove git branches that do not have a remote tracking branch anymore

Change newline to space in a file just using echo
Changing newline to spaces using just echo


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: