Skip to content

Instantly share code, notes, and snippets.

@cheshirecode
Last active May 27, 2022 03:22
Show Gist options
  • Save cheshirecode/64c94dd6e399b78bd2f6021135566551 to your computer and use it in GitHub Desktop.
Save cheshirecode/64c94dd6e399b78bd2f6021135566551 to your computer and use it in GitHub Desktop.
find and return only sub-directory names
#!/usr/bin/env sh
# find and return only sub-directory names
find . -maxdepth 1 -type d -not -path '.' -printf "%f\n"
# fast deletion 11
mkdir empty_dir
rsync -a --delete empty_dir/ yourdirectory/
# fast deletion -2
cd DIR # a must-do
perl -e 'for(<*>){((stat)[9]<(unlink))}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment