Quickly list all files recursivly

More hackery today with this dirty little script to print out all files within a directory recursively. This is by no means perfect; any directory that includes a period/full stop (.) will be treated like a file, and any file that doesn’t include an extension (.txt, .jpg, .php etc) will be treated like a directory and ignored. Hey, I told you it was dirty.


find . | grep -Pv "^\.\/\." | grep -v ^\.$ | grep -Pv "^\.[^.]*$"

That’s obviously a little hard to remember so as always you can download the program here and place in /usr/bin or /home/user/bin.

Literally the only reason this came about is because I wanted to see how many lines of code I’d written – now I can find out by simply running


wc -l $(findall)

For anyone interested, it was 1507.

 

Read More