Hagith
2/12/2014 - 8:52 AM

Bash notes

Bash notes

# count lines in directory
find . -type f ! -path "\.git" ! -path "./CMakeFiles/*" | xargs wc -l

# du of hidden directories
du -hs .[^.]*
du -s .[^.]* | sort -nr

# mirror apache listing
wget --execute="robots = off" --mirror --convert-links --no-parent -R index.html [http://example.com/path/to/dir]
find -name "index.html*" -exec rm {} \;
find -name "*\.1" -type f -exec rm {} \;