bash
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
bash [2023/10/01 17:28] – getopts rjt | bash [2025/04/23 12:45] (current) – Copy files from list to single directory rjt | ||
---|---|---|---|
Line 48: | Line 48: | ||
mv -- " | mv -- " | ||
done | done | ||
+ | </ | ||
+ | |||
+ | ==== Move all files in subdirectories to parent ==== | ||
+ | |||
+ | * https:// | ||
+ | |||
+ | <code bash> | ||
+ | find . -mindepth 2 -type f -print -exec mv {} . \; | ||
+ | </ | ||
+ | |||
+ | ==== Copy files from list to single directory ==== | ||
+ | |||
+ | Takes paths in a text file (one per line), and copies the files they point to to a single location. I use this to put audio files from playlists into directories I can move over to my phone. | ||
+ | |||
+ | <code bash> | ||
+ | while IFS= read -r filename; do cp " | ||
</ | </ | ||
bash.1696141718.txt.gz · Last modified: 2023/10/01 17:28 by rjt