Commands by ene2002 (9)

  • see the partition Show Sample Output


    -4
    fdisk -l
    ene2002 · 2014-02-16 12:54:38 0

  • -2
    nmap -sS -O -v -oS - 192.168.2.0/24
    ene2002 · 2014-01-31 18:04:06 0
  • Watch a dig in progress Show Sample Output


    1
    watch -n1 dig google.com
    ene2002 · 2013-12-26 19:23:27 3
  • I wanted an easy way to list out the sizes of directories and all of the contents of those directories recursively. Show Sample Output


    1
    du -h --max-depth=1 /path/folder/
    ene2002 · 2013-07-09 19:56:13 0
  • UBNT iwlist command Show Sample Output


    -2
    iwlist ath0 scanning |egrep '(ESSID|Signal|Address)'| \sed -e 's/Cell - Address:*//g' -e 's/ESSID://g' \-e 's/Noise level=-//g' -e 's/dBm//g' \-e 's/Quality=*//g' -e 's/Signal level=-//g' \-e 's/"//g'
    ene2002 · 2013-05-04 08:48:45 2
  • This works just as well for SMTP. You could run this on your mail server to watch e-mail senders and recipients: tcpdump -l -s0 -w - tcp dst port 25 | strings | grep -i 'MAIL FROM\|RCPT TO' Show Sample Output


    4
    tcpdump -l -s0 -w - tcp dst port 25 | strings | grep -i 'MAIL FROM\|RCPT TO'
    ene2002 · 2013-03-18 18:55:20 0

  • 1
    nmap -T4 --script broadcast-pppoe-discover 192.168.122.0/24
    ene2002 · 2013-02-18 13:26:48 0

  • 0
    tcpdump -i eth0 -s 65535 -w test_capture
    ene2002 · 2013-02-07 19:29:02 0

  • 1
    tcpdump -i eth0 port http or port smtp or port imap or port pop3 -l -A | egrep -i 'pass=|pwd=|log=|login=|user=|username=|pw=|passw=|passwd=|password=|pass:|user:|userna me:|password:|login:|pass |user '
    ene2002 · 2013-02-07 19:14:58 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

draw mesh

list block devices
Shows all block devices in a tree with descruptions of what they are.

Move a folder and merge it with another folder
This will move a folder and merge it with another folder which may contain duplicates. Technically it's just creating hardlinks of everything in the folder, and after it's done, delete the source (with rm -r source/ ) to complete the move. This is much faster than, for example, using rsync to merge folders which would actually copy the entire contents and so for a lot of files would take much longer. This uses macutils gcp port of cp so it can be used on osx/MacOS. If using in linux or some unix where cp includes the ability to create links with -l you can just use cp instead of gcp.

Go to the next sibling directory in alphabetical order
Sometimes you have to browse your way through a lot of sub-directories. This command cd to the next sub-directory in alphabetical order. For example, if you have the directories "lectures/01-intro", "lectures/02-basic", "lectures/03-advanced" and so on, and your PWD is "02-basic", it jumps to "03-advanced".

List of macros defined by gcc
Lists all macros and their values defined by gcc.

check open ports without netstat or lsof

list block devices
Shows all block devices in a tree with descruptions of what they are.

Compare directories via diff
http://hints.macworld.com/article.php?story=20070408062023352

list all file extensions in a directory
If your grep doesn't have an -o option, you can use sed instead.

determine if tcp port is open
@putnamhill, no need if statement in that case. && is a AND and || is a OR


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: