You can combine the sort and uniq command line programs to remove duplicate lines from a text file. In the example below, it will produceRead more
To go to a specific line number in VI, first, make sure you’re not in editing mode by hitting ESC. Next type the line numberRead more
This example lists out the IPs that are on the SSH port (22) on a particular subnet. List out IPs (only) of open ssh portsRead more
Here are a few shutdown examples for quick reference. Turn Server Off Immediately
shutdown -h now
shutdown -r now
Restart in 45 minutes
shutdown -r +45
Restart at nextRead more
This will quickly do a scan on a subnet to determine IP addresses on the network.
nmap -sP 10.1.0.0/16
Only Return IP Addresses If you only wantRead more
This command will untar and unzip all files in a single step. If you’re running Linux you’ll be doing this all the time so memorizeRead more
This is a simple screenshot server running over http. You append a url (a urlencoded url) to the server and it returns a PNG imageRead more
Sometimes you run a program at the command line and it’s running longer than you thought. You’re worried process might die if you walk awayRead more
To copy files between remote servers where transfers occur on the local host you use the -3 command line switch. This is useful if server1Read more
To See headers only and not the HTML response from a web server, you can use the command line CURL program to do it.
MacBook:~ mike$ curl -I -L 'http://google.com'