Commands tagged cli (6)

  • See the flight information from the CLI Use as a SH file or function, like: `./flight.sh os 336` Show Sample Output


    2
    flight_status() { curl --silent --stderr - "https://mobile.flightview.com/TrackByRoute.aspx?view=detail&al=$1&fn=$2&dpdat=$(date +%Y%m%d)" | html2text | grep -A19 "Status" ; } ; flight_status $1 $2
    sxiii · 2022-07-26 12:09:17 455
  • 包括: 除夕(Chinese New Year?s Day)、清明(Tomb-Sweeping Day)、端午(Dragon Boat Festival)、中秋(Mid-Autumn Festival)等传统节日,以及元旦、五一、十一、儿童节、教师节等。 Show Sample Output


    0
    gcal -i -s1 -qcn --chinese-months -cezk .
    s5unty · 2010-12-17 10:07:43 3
  • Lauching an app including jars in an adjacent lib folder to its classpath


    0
    java -jar app.jar -cp $(echo lib/*.jar | tr ' ' ':')
    xymor · 2012-10-29 12:51:46 16
  • Following in the steps of a few other scripts on here, I thought I'd mix in the ability to add in an instance tag output into this. This can be super useful if you are using the "Name" tag as a hostname tag and feeding that into, say Route53 for DNS to reach the machine. Helps for scripting against later. Show Sample Output


    0
    aws ec2 describe-instances --filters "Name=vpc-id,Values=<replace_with_id>" --query 'Reservations[].Instances[].[ [Tags[?Key==`Name`].Value][0][0],PrivateIpAddress,InstanceId,State.Name,Placement.AvailabilityZone ]' --output table
    fydgit · 2015-08-27 21:52:58 10
  • This command will shutdown all VMs on an VMWare ESX host. First it tries to gracefully shutdown the VM. If that fails it will hard shutdown and the power off.


    -1
    for vm in `/usr/bin/vmware-cmd -l`; do /usr/bin/vmware-cmd "${vm}" stop trysoft; done
    maxheadroom · 2011-09-15 06:56:49 3
  • The rsstail is the python version (python-rsstail). The final command pipe it on every new line to gammu and a connected phone rsstail -o -n 1 --f 'RedditQuote: {title}' http://www.reddit.com/r/quotes/new/.rss | while read line; do /usr/bin/gammu --sendsms TEXT +*yournumber* -text "$line"; done Show Sample Output


    -1
    rsstail -o -n 1 --f 'RedditQuote: {title}' http://www.reddit.com/r/quotes/new/.rss
    Youpfu · 2014-01-08 15:33:48 8

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

set wallpaper on windowmaker in one line
set directly the wallpaper on windowmaker , use this command with display of imagemagick :)

Give to anyone a command to immediatly find a particular part of a man.
Example : $ LC_ALL=C man less | less +/ppattern

Unlock your KDE4 session remotely (for boxes locked by KDE lock utility)
Do the unlock KDE screen saver locked session with lightdm display manager used in Kubuntu 12.10 +

Decrypt passwords from Google Chrome and Chromium.
Read this before you down voting and comment that it is not working -> Wont work on latest versions ~75> since database file is locked and has to be decrypted. This is useful if you have an old hdd with a chrome installation and want to decrypt your old passwords fast.

Simultaneously running different Firefox profiles
After running $ firefox -ProfileManager and creating several different profiles, use this command to run multiple Firefox profiles simultaneously.

Prints new content of files
Useful to e.g. keep an eye on several logfiles.

Shorten any Url using bit.ly API, using your API Key which enables you to Track Clicks
Shorten any Url using bit.ly API, using your API Key which enables you to Track Clicks I have it as a Function in my .bash_aliases [code] shorten () { longUrl=$1; curl "http://api.bit.ly/shorten?version=2.0.1&longUrl=LONG_URL_YOU_WANT_SHORTENED&login=rungss&apiKey=" } [/code] Here is an Output showing the Function Detail.. [konsole] bijay@bijay:$ type shorten shorten is a function shorten () { longUrl=$1; curl "http://api.bit.ly/shorten?version=2.0.1&longUrl=$longUrl&login=rungss&apiKey=R_48d7e0b40835b09e3861bd455f7abec7" } [/konsole]

scping files with streamlines compression (tar gzip)
it compresses the files and folders to stdout, secure copies it to the server's stdin and runs tar there to extract the input and output to whatever destination using -C. if you emit "-C /destination", it will extract it to the home folder of the user, much like `scp file user@server:`. the "v" in the tar command can be removed for no verbosity.

cd up a number of levels
Instead of typing "cd ../../.." you can type ".. 3". For extremely lazy typists, you can add this alias: alias ...=".. 2" ....=".. 3" - so now you can write just .... !!! NB the .. function needs to be "source"d or included in your startup scripts, perhaps .bashrc.

Get your external IP address ( 10 characters long )
Shortest url to a external IP-service, 10 characters.


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: