bash
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| bash [2024/01/10 10:59] – Move all files in subdirectories to parent rjt | bash [2025/04/23 12:45] (current) – Copy files from list to single directory rjt | ||
|---|---|---|---|
| Line 56: | Line 56: | ||
| <code bash> | <code bash> | ||
| find . -mindepth 2 -type f -print -exec mv {} . \; | 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.1704844794.txt.gz · Last modified: 2024/01/10 10:59 by rjt
