All commands (12,707)

  • This command will open the AVD Manager in Mac OS X.


    0
    /usr/bin/java -Xmx256M -XstartOnFirstThread -Dcom.android.sdkmanager.toolsdir=android-sdk/tools -classpath android-sdk/tools/lib/sdkmanager.jar:android-sdk/tools/lib/swtmenubar.jar:android-sdk/tools/lib/x86_64/swt.jar com.android.sdkmanager.Main avd
    99RedBalloons · 2013-10-04 02:39:00 0
  • This will check all .HTML file contents for the word "Hacked" and dump it to hacklog.txt. This is great for located all those files affected by nasty Joomla exploits. Change the .HTML to any other extension you wish to check, and of course the word "HACKED" for other searches.


    0
    find . -type f -name '*.html' -exec grep -H HACKED {} \; > hacklog.txt
    nullrouter · 2009-02-16 08:57:25 0

  • 0
    cal -y | tr '\n' '|' | sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed 's/./#/g') /$(date +%m | sed s/^0//)" | tr '|' '\n'
    luishka · 2009-05-26 20:31:26 3
  • Empties all files in /var/log over 5000k. Useful if /var goes crazy or if you just haven't cleaned up in a while.


    0
    for file in `find /var/log/ -type f -size +5000k`; do echo " " > $file; done
    jemmille · 2009-07-03 16:26:36 1
  • For example: check the APT security keys to make sure the Google digital signature was imported correctly Show Sample Output


    0
    apt-key list
    0disse0 · 2009-09-03 19:32:11 0
  • If you want all the URLs from all the sessions, you can use : perl -lne 'print for /url":"\K[^"]+/g' ~/.mozilla/firefox/*/sessionstore.js Thanks to tybalt89 ( idea of the "for" statement ). For perl purists, there's JSON and File::Slurp modules, buts that's not installed by default.


    0
    perl -lne 'print for /url":"\K[^"]+/g' $(ls -t ~/.mozilla/firefox/*/sessionstore.js | sed q)
    sputnick · 2009-12-14 00:51:54 0
  • 8.8.8.8 and 8.8.4.4 are two Google public DNS. As their address is really simple, it's easy to use this command to test if Internet is reachable. Beware of large corporate networks however, that may use this address on router's loopbacks interfaces.


    0
    ping 8.8.8.8
    petrus · 2011-02-18 19:51:36 0
  • Among other things, this allows the sorting of comment descriptions and command lines retrieved as text from CommandLineFu.com. Show Sample Output


    0
    gawk 'BEGIN {RS="\n\n"; if (ARGV[1]=="-i"){IGNORECASE=1; ARGC=1}};{Text[NR]=$0};END {asort(Text);for (i=1;i<=NR;i++) printf "%s\n\n",Text[i] }' -i<Zip.txt
    IF_Rock · 2011-05-10 19:08:27 0
  • Another way to create temp files in your scripts, if tempfile fails, it will create a hidden local file in the current directory, don't forget to delete $FILE


    0
    FILE=$(tempfile 2>/dev/null || echo .$RANDOM)
    h3nr1x · 2011-06-22 15:12:21 0
  • No need to install additional packages eg: say hello For multiword say how+are+you


    0
    say() { wget -q -U Mozilla -O output.mp3 "http://translate.google.com/translate_tts?tl=en&q=$1"; gnome-terminal -x bash -c "totem output.mp3"; sleep 4; totem --quit;}
    totti · 2011-09-07 19:48:53 0
  • This will get all links from a given URL, remove any duplicates, and output the result.


    0
    lynx -dump http://example.com/ | awk '/http/{print $2}' | sort -u
    mathias · 2011-10-13 09:49:36 3
  • Show external IP and geolocation information. Primary feature is the use of tee to echo IP _and_ send to geoiplookup command...Use IP as input for as many commands as you want with more >( [command] ) Thanks to http://www.commandlinefu.com/commands/view/6334/ Requires MaxMind DB and geoiplookup tool. Sample output has IP obfuscated on first line, lines 2-4 from having MaxMind Country && MaxMind City DBs installed Show Sample Output


    0
    curl -s ifconfig.me|tee >(xargs geoiplookup)
    MeanderingCode · 2012-02-09 20:30:26 0
  • ofxGui ofxFX


    0
    grep -hor ofx[a-zA-Z]*.h src/ | grep -o ofx[^\.]* >> addons.make
    egeoffray · 2013-03-15 11:29:50 0
  • If you need to hop on a wifi fast, perhaps you're fixing a system and it's read-only this command pipes the output of wpa_passphrase used to generate a .conf file and instead reads it from the standard input stream. The -i switch for interface may not be wlan0, as udev will change it. A quick "ifconfig" or "dmesg | grep wlan0" will show you the wireless interface name.


    0
    wpa_passphrase "ESSID" "Password" | wpa_supplicant -Dwext -iwlan0 -c/dev/stdin&
    adamrights · 2013-05-07 11:05:50 0
  • adjusts the 'Master' channel's volume up by 1dB. Can use command 'amixer' to see other channels : Simple mixer control 'Master',0 or Simple mixer control 'Capture',0 Show Sample Output


    0
    amixer -c 0 set Master 1dB+
    chrisp6825 · 2013-07-25 15:28:45 0
  • Ruby Version Manager (RVM) - https://rvm.io/ Show Sample Output


    0
    rvm --default use ruby-1.9.3
    99RedBalloons · 2013-10-04 02:43:59 0
  • Opens a window with $1 attached and ready to send.


    0
    thunderbird -compose "attachment='file://`pwd`/$*'"
    tobi · 2014-01-08 12:22:50 0
  • Pipe serialized data into the command.


    0
    php -r 'echo json_encode( unserialize( file_get_contents( "php://stdin" ) ) );'
    westonruter · 2014-07-14 17:09:21 0

  • 0
    bash -x /etc/init.d/asterisk start
    nomikos · 2014-11-05 23:18:45 0
  • you don't need to echo, just a plain redirect is enough to empty the file


    0
    for file in `find /var/log/ -type f -size +5000k`; do > $file; done
    svg · 2009-07-03 17:38:21 2
  • Uses mime-type of files rather than relying on file extensions to find files of a certain type. This can obviously be extended to finding files of any other type as well.. like plain text files, audio, etc.. In reference to displaying the total hours of video (which was earlier posted in command line fu, but relied on the user having to supply all possible video file formats) we can now do better: find ./ -type f -print0 | xargs -0 file -iNf - | grep video | cut -d: -f1 | xargs -d'\n' /usr/share/doc/mplayer/examples/midentify | grep ID_LENGTH | awk -F "=" '{sum += $2} END {print sum/60/60; print "hours"}'


    0
    find ./ -type f -print0 | xargs -0 file -iNf - | grep video | cut -d: -f1
    jnash · 2009-11-19 06:05:36 3
  • This command will automate the creation of ESSIDs and batch processing in pyrit. Give it a list of WPA/WPA2 access points you're targeting and it'll import those ESSIDs and pre-compute the potential password hashes for you, assuming you've got a list of passwords already imported using: pyrit -i dictionary import_passwords Once the command finishes, point pyrit to your packet capture containing a handshake with the attack_db module. Game over. Show Sample Output


    0
    gopyrit () { if [ $# -lt 1 ]; then echo $0 '< list of ESSIDs >'; return -1; fi; for i in "$@"; do pyrit -e $i create_essid && pyrit batch; done; pyrit eval }
    meathive · 2010-06-19 01:11:00 0

  • 0
    perl -e "tr/[A-Z]/[a-z]/;" -pi.save $(find . -type f)
    miccaman · 2010-11-25 12:48:39 0

  • 0
    perl -e 'printf join ".", map int rand 256, 1 .. 4;'
    gml · 2011-01-16 02:15:29 3
  • Defines a function to geolocate a given IP address; if none supplied, will default to your external IP address. Show Sample Output


    0
    geoip() { lynx -dump "http://api.hostip.info/get_html.php?ip=$1&position=true"; }
    unixmonkey7753 · 2011-05-10 21:44:07 0
  • ‹ First  < 400 401 402 403 404 >  Last ›

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



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: