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

Two Very Useful Hive CLI settings

It is very helpful to set these in your .hiverc file. The hive cli reads from the .hiverc file in your home directory to override defaults. Two of the settings I find very important is set hive.cli.print.header=true; set... Continue →