Skip to content

Instantly share code, notes, and snippets.

@weshouman
Last active October 28, 2017 06:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weshouman/86619bddd92b80756dee to your computer and use it in GitHub Desktop.
Save weshouman/86619bddd92b80756dee to your computer and use it in GitHub Desktop.
make numbered folders with bash #bash #study
# knowledge needed
# for looping check: http://www.cyberciti.biz/faq/bash-for-loop/
# print format: http://linuxconfig.org/bash-printf-syntax-basics-with-examples
# operand pipelining: http://unix.stackexchange.com/questions/9597/giving-grep-output-to-rm
# uses this if formatting isn't important
# for V in {1..13}; do mkdir "my_num_folder_${V}"; done
# note $V_ is different from ${V}_
for V in {1..13}; do printf "my_num_folder_%02i" $V | xargs mkdir ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment