Skip to content

Instantly share code, notes, and snippets.

@7171u
Last active October 13, 2015 13:33
Show Gist options
  • Save 7171u/e81d9be6a5598aa8bb67 to your computer and use it in GitHub Desktop.
Save 7171u/e81d9be6a5598aa8bb67 to your computer and use it in GitHub Desktop.
#FunWithLinux #Find #Linux #FileSystem
Today I was just curious which directory holds the deepest file on my Linux PC.
The below command will print the dir with maximum depth.
>find / -type d | awk -F "/" -v slash=0 '{if (NF > slash) { slash=NF; DIR=$0}} END { print DIR":"slash}'
The result I got is 16 as max depth which was a ruby dir.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment