Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

Dan Berlyoung

Human Readable ls and df commands

Simple but useful to know...

To get a ls (file list) or df (disk free) to show in K,M or G instead of *huge* numbers of bytes without commas, use the -h flag.

ls -lh
df -h

Get all files in ftp server directory using WGET

It's a PITA to recursively get all files in a directory using ftp. Instead use wget.

wget -r ftp://account_name:password@example.com/directoryname

Reverse DNS from command line

Quick and easy way to look up a domain name given an IP address.

dig -x 17.254.3.183


Search for open files that won't allow you to unmount a server volume

lsof | grep "Office Server"

Lists out all open files on a given volume ("Office Server" in this case.) Good to find those peskey open files that won't let you eject a mounted network volume.