Skip to content

Instantly share code, notes, and snippets.

@7yl4r
Last active January 27, 2020 20:27
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 7yl4r/3e7eb927edf732021288bb345343a840 to your computer and use it in GitHub Desktop.
Save 7yl4r/3e7eb927edf732021288bb345343a840 to your computer and use it in GitHub Desktop.
how to move selected files from text file listing one file per line

Use rsync, then move files out of folders and delete empty folders:

# starting in /tpa_pgs/
mkdir fl_se
rsync -avzh --recursive --files-from=./files_to_move/files_to_move_sefl.txt ./pgc_batches/imagery/ ./fl_se/.

# cd to region and cleanup if needed:
find ./ -mindepth 2 -type f -exec mv {} . \;
find ./ -type d -empty -delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment