All commands (14,187)


  • 0
    openssl rsa -in privateKey.key -check
    aysadk · 2018-04-04 13:33:00 171

  • 0
    openssl req -text -noout -verify -in CSR.csr
    aysadk · 2018-04-04 13:32:43 172

  • 0
    openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt
    aysadk · 2018-04-04 13:32:20 175

  • 0
    openssl pkcs12 -in keyStore.pfx -out keyStore.pem -nodes
    aysadk · 2018-04-04 13:32:02 240

  • 0
    openssl x509 -outform der -in certificate.pem -out certificate.crt
    aysadk · 2018-04-04 13:31:43 172

  • 0
    openssl x509 -inform der -in certificate.cer -out certificate.pem
    aysadk · 2018-04-04 13:31:06 173

  • 0
    openssl s_client -connect www.paypal.com:443
    aysadk · 2018-04-04 13:30:39 172
  • openssl x509 -noout -modulus -in certificate.crt | openssl md5 openssl rsa -noout -modulus -in privateKey.key | openssl md5 openssl req -noout -modulus -in CSR.csr | openssl md5


    0
    openssl x509 -noout -modulus -in certificate.crt | openssl md5 openssl rsa -noout -modulus -in privateKey.key | openssl md5 openssl req -noout -modulus -in CSR.csr | openssl md5
    aysadk · 2018-04-04 13:29:59 164
  • Update method: 1) Find you current version and release in https://esxi-patches.v-front.de/ESXi-6.5.0.html (You can copy the Build number and Control+F in the page). 2) Run this command release per release, changing the with the name of Imageprofile. As example: esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION[168/1029] depot-index.xml -p ESXi-6.5.0-20180304001-standard This way is needed because updates arent cumulative, so need to do one by one. Show Sample Output


    0
    esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION[168/1029] depot-index.xml -p <Release>
    pqatsi · 2018-04-03 13:26:58 172
  • Proxy remote mysql with local port.


    0
    ssh -T -N -L 23306:localhost:3306 root@mysql.domain.com
    jackqt · 2018-04-02 05:34:28 172

  • 1
    echo "[{"Name": "bar"}]" | python -c 'import json,sys;obj=json.load(sys.stdin);print(obj[0]["Name"]);')
    moerin · 2018-03-31 21:31:53 168

  • 1
    genisoimage -o bastion-602-jpa.iso -b boot/syslinux/isolinux.bin -c boot/syslinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -r -R .
    leatherface · 2018-03-30 12:54:26 173

  • 0
    clear && sleep 5s && curl --silent "http://www.commandlinefu.com/commands/by/dunryc" | grep '<div class="command">'|sed 's/......$//'|sed 's/^.....................................//'|recode html..ascii|awk 'ORS="\n\n\n\n"'
    dunryc · 2018-03-28 20:17:40 181

  • 0
    clear && curl --silent http://www.commandlinefu.com/commands/by/dunryc | grep "div class" | grep command |tr '>' '\n' | grep -v command |sed 's/.....$//'
    dunryc · 2018-03-28 19:16:14 166

  • 0
    curl -s https://api.github.com/users/tuxcanfly/repos | jq -r 'map(select(.fork == false)) | map(.url) | map(sub("https://api.github.com/repos/"; "git clone git@github.com:")) | @sh' | xargs -n1 sh -c]
    tuxcanfly · 2018-03-23 01:05:29 176
  • bitbucket paginates at around 1360 characters, so if you have several pages of repos in git hub you can just add "?page={1..4}" the url used to get all the repos. you can also use -v for the deletion curl if you want to see the response from the server.


    1
    for repo in `curl -s -u 'USERNAME:PASSWORD' -X GET -H "Content-Type: application/json" 'https://api.bitbucket.org/2.0/repositories/USER|jq -r .values[].links.self.href`; do curl -s -u 'USERNAME:PASSWORD' -X DELETE $repo;done
    gargolito · 2018-03-21 22:34:28 170
  • curl inet-ip.info -> 113.33.232.62\n curl inet-ip.info/ip -> 113.33.232.62 curl inet-ip.info/json -> JSON print curl inet-ip.info/json/indent -> JSON pretty print curl inet-ip.info/yaml -> YAML format curl inet-ip.info/toml -> TOML format http://inet-ip.info Show Sample Output


    1
    curl inet-ip.info
    masahide · 2018-03-19 21:08:39 38
  • Here is an alternative that support unicodes, using echo: It is using the \c flag, meaning no new line for the echo option -e. You can replace the = with any unicode character. Or to do the same into a PHP bash script: shell = system("tput cols"); for( $i= 0 ; $i < $shell ; $i++ ){ echo "█"; } Show Sample Output


    0
    for ((i=0; i<$(tput cols); i++)); do echo -e "=\c" ;done
    K33st · 2018-03-19 19:37:02 28
  • To HUNT for all the important stuffs. TRUST EL TRAPPER Works every time!


    0
    ls -ltrapR
    K33st · 2018-03-19 18:15:51 26
  • In case you have a PSD file with CMYK attribute and you need a working image


    0
    convert <input.psd> -channel RGBA -alpha Set -colorspace rgb <output.png>
    ludenticus · 2018-03-19 14:30:30 27
  • Autossh maintains a Tunnel opened. This example adds connectivity through a HTTP Proxy


    0
    autossh -o "ProxyCommand nc --proxy <proxy_hostname_or_ip>:<proxy_port> %h %p" -M 20000 -f -N <hostname_or_ip> -p 443 -R 2222:localhost:22 -C
    imjoseangel · 2018-03-13 05:56:49 62

  • 0
    access wifi password through terminal (osx)
    ctcrnitv · 2018-03-12 06:40:38 25
  • This command renames the file 'filename' to 'filename.old' using shell expansion. Same as typing "mv filename filename.old".


    -1
    mv filename{,.old}
    BELzEBUB · 2018-03-08 12:41:18 27
  • This command builds upon some of the original commands posted here. Additions - The control sequence \x1b(B which selects the default character set ASCII. - Either the \x1B style escape sequence or the \033. - Case insensitivity by using 'I' to include \x1b, \x1B escapes and a-zA-Z in the latter part Tested extensively on makefile unbuffered output where the above additions proved necessary


    0
    sed -r "s/(\x1B|\033)(\(B|\[([0-9]{1,2}(;[0-9]{1,2})?)?[A-Z])//Ig"
    DMaxmatician · 2018-03-08 00:49:39 25

  • 0
    apt list --upgradable
    rschulze · 2018-03-06 17:45:01 25
  • ‹ First  < 29 30 31 32 33 >  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


Check These Out

Get the time from NIST.GOV
The format is JJJJJ YR-MO-DA HH:MM:SS TT L DUT1 msADV UTC(NIST) OTM and is explained more fully here: http://tf.nist.gov/service/acts.htm

Convert seconds to [DD:][HH:]MM:SS
Converts any number of seconds into days, hours, minutes and seconds. sec2dhms() { declare -i SS="$1" D=$(( SS / 86400 )) H=$(( SS % 86400 / 3600 )) M=$(( SS % 3600 / 60 )) S=$(( SS % 60 )) [ "$D" -gt 0 ] && echo -n "${D}:" [ "$H" -gt 0 ] && printf "%02g:" "$H" printf "%02g:%02g\n" "$M" "$S" }

Recursive search and replace (with bash only)
Replaces a string matching a pattern in one or several files found recursively in a particular folder.

Alias to securely run X from tty and close that tty afterwards.
There are different ways to run X, I prefer to run it without xdm/gdm. The problem is you can't lock X because one can press Ctrl+Alt+F1, press Ctrl+Z and kill you X locking process. Of course you can disable Ctrl+Alt* or Ctrl+Alt+Backspace keys, but it's inconvinient if you really need to switch into console.

All IP connected to my host
find all computer connected to my host through TCP connection.

Customer Friendly free
makes more sense to customers XD

Real time duplication of Apache app traffic to a second server
This takes the stream created by apache requests containing jsp and funnels them to another server. I'm using this for simulating real time traffic. The nice command gives ssh maximum CPU cycles, awk & grep strip out everything served by apache. Putting parallel on curl is important because curl is synchronous and waits for the response. Yes, I thought about using wget but it didn't seem any easier. Also, if you figure out how to run this in the background let me know. Every time I background it it stops. If you have multiple front end servers just run multiple instances of this.

Google URL shortener
(1) required: python-googl ( install by: pip install python-googl ) (2) get from google API console https://code.google.com/apis/console/

Get the SAN (subjectAltName) of a site's certificate.
Based on http://stackoverflow.com/questions/13127352/checking-alternative-names-for-a-san-ssl-cert Replace "facebook.com" with the desired hostname.

Create a video screencast (capture screen) of screen portion, with audio (the audio you hear, not your mic)
Errors in output don't matter. Stop recording: ctrl-c. Result playable with Flash too. IMPORTANT: Find a Pulse Audio device to capture from: pactl list | grep -A2 'Source #' | grep 'Name: ' | cut -d" " -f2


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: