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

Basic Monitoring for Hadoop Data Nodes

Here’s a basic monitoring script to monitor the HDFS cluster disk space, Temp Dir space and number of data nodes up. This was plenty useful before we switched to Cloudera Manager. #!/usr/bin/env ruby # Checks Hadoop and alerts if there... Continue →