How to quickly find the depth of deepest file in a directory tree

If for whatever reason you want to find how deep a directory tree goes in your software projects, simply run this nifty little one liner

find . | grep -v "\.git" | awk '{print gsub(/\//,"")}' - | sort -r  | head -1

This will first run a find on the current directory, filter git files, find the number of “/” per line, reverse sort them and finally show the highest depth.

 
8
Kudos
 
8
Kudos

Now read this

How to read ISO 8601

ISO 8601 is a format of expressing a date with timezone information. I used to get confused after looking at dates like “2014-10-07T16:11:24-07:00”. Ok so you can tell it is 7th October 2014 and 4:24 PM. The -07:00 tells us the timezone... Continue →