Commands tagged scan (9)

  • 13
    sudo arp-scan -I eth0
    sata · 2010-07-01 02:46:41 3
  • Simple one-liner for scanning a range of hosts, you can also scan a range of ports with Netcat by ex.: nc -v -n -z -w 1 21-443 Useful when Nmap is not available:) Range declaration like X..X "for i in {21..29}" is only works with bash 3.0+ Show Sample Output

    for i in {21..29}; do nc -v -n -z -w 1 192.168.0.$i 443; done
    rez0r · 2009-09-25 03:31:29 3
  • nmap for windows and other platforms is available on developer's site: nmap is robust tool with many options and has various output modes - is the best (imho) tool out there.. from nmap 5.21 man page: -oN/-oX/-oS/-oG : Output scan in normal, XML, s| Show Sample Output

    nmap -v -sP
    anapsix · 2010-07-14 19:53:02 0
  • Joins two pdf documents coming from a simplex document feed scanner. Needs pdftk >1.44 w/ shuffle.

    pdftk A=odd.pdf B=even.pdf shuffle A1-end Bend-1S output duplex.pdf
    till · 2011-02-25 15:00:09 2
  • Xsane produces PDFs that are too large - particularly multipage PDFs. This command compresses them. If you do not use A4, remove the -sPAPERSIZE flag.

    gs -q -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=test.pdf multipageproject.pdf
    iain · 2009-03-24 17:14:46 1
  • Adjust the --resolution and --mode as required (if these options are available for your scanner). The size options (-x, -y, -imageheight, -imagewidth) are for US letter paper. For A4, I think the command would be: scanimage -p --resolution 250 --mode Gray -x 210 -y 297 | pnmtops -imageheight 11.7 -imagewidth 8.3 | ps2pdf - output.pdf

    scanimage -p --resolution 250 --mode Gray -x 215.9 -y 279.4 | pnmtops -imageheight 11 -imagewidth 8.5 | ps2pdf - output.pdf
    dbh · 2013-04-12 18:18:42 0

  • 1
    arp-scan -I eth0 -l | perl -ne '/((\d{1,3}\.){3}\d{1,3})/ and $ip=$1 and $_=`nmblookup -A $ip` and /([[:alnum:]-]+)\s+<00>[^<]+<ACTIVE>/m and printf "%15s %s\n",$ip,$1'
    bandie91 · 2011-07-08 07:41:41 0
  • Check to see if a port is open or closed on a given host. Show Sample Output

    checkport() { sudo nmap -sS -p $1 $2 }
    peterRepeater · 2011-12-13 11:46:15 1
  • documents all active ips on a subnet and saves to txt file. Show Sample Output

    FOR /L %i IN (1,1,254) DO ping -n 1 10.254.254.%i | FIND /i "Reply">> c:\ipaddresses.txt
    barrytrujillo · 2010-06-29 21:02:21 0

What's this? 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

Top 10 Memory Processes
It displays the top 10 processes sorted by memory usage

Create .pdf from .doc
sudo apt-get install cups-pdf

convert a line to a space

Count items in JSON array
Pipe any JSON to jq, then count with the appropiate expression and use the | length on the array

put an unpacked .deb package back together
If any changes have been made to the package while it was unpacked (ie, conffiles files in /etc modi‐fied), the new package will inherit the changes. This way you can make it easy to copy packages from one computer to another, or to recreate packages that are installed on your system, but no longer available elsewhere. Note: dpkg-repack will place the created package in the current directory.

Install pip with Proxy
Installs pip packages defining a proxy

How to trim a video using ffmpeg
Will trim the video to 4 seconds starting from the beginning. The -vcodec , -acodec options are required so that ffmpeg knows in what video/audio format you want for the new video.

Move all images in a directory into a directory hierarchy based on year, month and day based on exif information
This command would move the file "dir/image.jpg" with a "DateTimeOriginal" of "2005:10:12 16:05:56" to "2005/10/12/image.jpg". This is a literal example from the exiftool man page, very useful for classifying photo's. The possibilities are endless.

Comment out all lines in a file beginning with string

List the size of all sub folders and files from the current location, with sorting

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.


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: