Skip to content

Instantly share code, notes, and snippets.

@yangboz
Created September 30, 2015 09:11
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 yangboz/b1ef390b3ec8920d5855 to your computer and use it in GitHub Desktop.
Save yangboz/b1ef390b3ec8920d5855 to your computer and use it in GitHub Desktop.
Linux find folder name before timestamp(20150930)
CHBIN-M-Q0AA@[~/Projects]
$> find ./dingding_bonus -type d -print | sed -n -e '/[0-9]\{8,8\}$/p' | sed -n -e 's/\(.*\)\/\([0-9]\{8,8\}\)$/\1\/\2##\2/gp;' | awk -F '##' '{if(int($2) < cmpVl)print $1}' cmpVl="20150910"
./dingding_bonus/20150902
./dingding_bonus/20150903
./dingding_bonus/20150904
./dingding_bonus/20150905
./dingding_bonus/20150906
./dingding_bonus/20150907
./dingding_bonus/20150908
./dingding_bonus/20150909
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment