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 454
  • 包括: 除夕(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

Look for English words in /dev/urandom
* to get the English dictionary: wget http://www.mavi1.org/web_security/wordlists/webster-dictionary.txt

Make Kali Linux look less suspicious by making the desktop look more like a windows machine
To revert back to Kali's original desktop. Just redo the same command with no options .

HTTP GET request on wireshark remotly

edit hex mode in vim
return to normal mode from hex mode :%!xxd -r

Check if it's your binary birthday!
Print out your age in days in binary. Today's my binary birthday, I'm 2^14 days old :-) . This command does bash arithmatic $(( )) on two dates: Today: $(date +%s) Date of birth: $(date +%s -d YYYY-MM-DD) The dates are expressed as the number of seconds since the Unix epoch (Jan 1970), so we devide the difference by 86400 (seconds per day). . Finally we pipe "obase=2; DAYS-OLD" into bc to convert to binary. (obase == output base)

diff the same file in two directories.
This is useful when you're diffing two files of the same name in radically different directory trees. For example: Set $ path1='/some/long/convoluted/path/to/all/of/your/source/from/a/long/dead/machine' then $ path2='/local/version/of/same/file' then run the command. Much easier on the eyes when you're looking back across your command history, especially if you're doing the same diff over and over again.

Belgian banking "structured communication"
Derived from current time down to minutes.

List detailed information about a ZIP archive
list zipfile info in long Unix ``ls -l'' format.

draw line separator (using knoppix5 idea)

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.


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: