Top 32 Nmap Command Examples For Linux Sys/Network Admins

last updated in Categories Command Line Hacks, Howto, Networking, Security

Nmap is short for Network Mapper. It is an open source security tool for network exploration, security scanning and auditing. However, nmap command comes with lots of options that can make the utility more robust and difficult to follow for new users.

The purpose of this post is to introduce a user to the nmap command line tool to scan a host and/or network, so to find out the possible vulnerable points in the hosts. You will also learn how to use Nmap for offensive and defensive purposes.

diff Command Colorize Output On the Unix / Linux Command Line

last updated in Categories Command Line Hacks, Programming, Web Developer

The diff command compare files line by line and displays a list of changes between two file. You can use diff command to:

  1. See the changes between one version of a file.
  2. Compare two configuration or program files.
  3. Create a patch file which can be applied with the Linux / Unix program patch.

Say hello to colordiff

colordiff is a wrapper for diff and produces the same output as diff but with coloured syntax highlighting at the command line to improve readability. colordiff has been tested on various flavours of Linux and under OpenBSD, but should be broadly portable to other systems.

Testing HTTP Status: 206 Partial Content and Range Requests

last updated in Categories Cloud Computing, Command Line Hacks, Howto, Networking, Web Developer

The HTTP 2xx class of status codes indicates the action requested by the client was received, and processed successfully. HTTP/1.1 200 OK is the standard response for successful HTTP requests. When you type www.cyberciti.biz in the browser you will get this status code. The HTTP/1.1 206 status code allows the client to grab only part of the resource by sending a range header. This is useful for:

  1. Understanding http headers and protocol.
  2. Troubleshooting network problems.
  3. Troubleshooting large download problems.
  4. Troubleshooting CDN and origin HTTP server problems.
  5. Test resuming interrupted downloads using tools like lftp or wget or telnet.
  6. Test and split a large file size into multiple simultaneous streams i.e. download a large file in parts.

Linux ifdata Command: See Network Interface Info Without Parsing ifconfig Output

last updated in Categories Command Line Hacks, Debian Linux

Reading an IP address in a shell script requires many time and various Linux distributions stores IP address in different text files. So most of us end up writing shell pipes/scripts to get the information using ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}' syntax. There is an alternative to ifconfig+shell pipe hack – ifdata command. It is a little know tool that can be used to check for the existence of a network interface and find out info about your interface such as IP, netmask, MTU and much more. No need to write shell pipes and fetch information via ifconfig or ip command. This command is designed to be easily used by a shell script.

agedu: Unix / Linux Command For Tracking Down Wasted Disk Space

last updated in Categories Command Line Hacks, Hardware, Howto, Storage

The most sysadmin will run low on disk space or storage space. Users will demand more disk space, and you need to free storage space. You will find out files that are a waste of space and delete it or move to an archive medium. However, how do you find the right files to delete that can help recover maximum space? Say hello to agedu tool (pronounced as ‘age dee you’) – it scans a directory tree and produces reports about how much disk space is used in each directory and subdirectory, and also how that usage of disk space corresponds to files with last-access times a long time ago. In other words, this command might help you to free up disk space.

Download Slackware 14.0 CD / ISO Images

last updated in Categories Open Source

Slackware version 14.0 has been released and available for download from the official project website. This updated version brings many enhancements, including Xfce 4.10.0, KDE 4.8.5, and Linux kernel version 3.2.29.