Skip to content

Instantly share code, notes, and snippets.

@phunanon
Last active August 3, 2023 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phunanon/5d0502838cffadf236041fc60e8c7323 to your computer and use it in GitHub Desktop.
Save phunanon/5d0502838cffadf236041fc60e8c7323 to your computer and use it in GitHub Desktop.
#Longest file name
find . -name '*.cs' | awk 'function base(f){sub(".*/", "", f); return f;} \
{print length(base($0)), $0}'| sort -nr | head -2
#Longest line
find . -name '*.cs' -print | xargs awk '{print length, $0}' | sort -nr | head -1
#Longest namespace
find . -name '*.cs' -print | xargs awk '{print length, $0}' |sort -nr | grep namespace | head -1
#Delete all node_modules
find . -depth -type d -name "node_modules" | xargs rm -rf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment