linux:find
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:find [2023/05/29 11:55] – external edit 127.0.0.1 | linux:find [2025/05/19 12:15] (current) – [Recursively changing extension] Wuff | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== find examples ====== | ====== find examples ====== | ||
| + | |||
| + | General note to '' | ||
| + | The following executes program and sends a space separated list of quoted filenames to it. Program may be called multiple times if the amount of arguments exceeds ARG_MAX. | ||
| + | < | ||
| + | |||
| + | The following executes program with one! quoted filename, then executes program again with the next etc. | ||
| + | < | ||
| + | |||
| + | |||
| + | |||
| Find and extract all rar files in subfolders into the current folder: | Find and extract all rar files in subfolders into the current folder: | ||
| Line 64: | Line 74: | ||
| find . -type f -name " | find . -type f -name " | ||
| </ | </ | ||
| + | |||
| + | Recursive file renaming extension (e.g. from " | ||
| + | < | ||
| + | find . -type f -name ' | ||
| + | </ | ||
| + | |||
| Move files in subdirectories to other directory while retaining directory structure | Move files in subdirectories to other directory while retaining directory structure | ||
| Line 85: | Line 101: | ||
| < | < | ||
| for file in *; do mv " | for file in *; do mv " | ||
| + | </ | ||
| + | |||
| + | ====== Find largest subdirectories ====== | ||
| + | < | ||
| + | du -hd1 | sort -h | ||
| + | </ | ||
| + | |||
| + | ====== Recursively changing extension ====== | ||
| + | < | ||
| + | find . -type f -name " | ||
| + | |||
| + | find . -type f -name ' | ||
| + | </ | ||
| + | |||
| + | ====== Recursively delete empty directories ====== | ||
| + | < | ||
| + | find . -type d -empty -delete | ||
| </ | </ | ||
linux/find.1685357733.txt.gz · Last modified: by 127.0.0.1