Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save daubac402/d00be7af9ae18e36ba1449e957ed2032 to your computer and use it in GitHub Desktop.
Save daubac402/d00be7af9ae18e36ba1449e957ed2032 to your computer and use it in GitHub Desktop.
Copy a file to same path in multi siblings directory linux
# You want to copy/replace a/sub_i/sub_j/x.html to b/.., c/.. etc.
# (your_current_dir)
# |___a
# | |____sub_i
# | |____sub_j
# | |____x.html
# |___b
# | |____sub_i
# | |____sub_j
# | |____x.html
# |___c
# | |____sub_i
# | |____sub_j
# | |____y.html
# ...
echo ./*/sub_i/sub_j/ | xargs -n 1 cp a/sub_i/sub_j/x.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment