ubuntu:file:rename_multiple_files
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ubuntu:file:rename_multiple_files [2020/07/15 09:30] – external edit 127.0.0.1 | ubuntu:file:rename_multiple_files [2022/06/13 11:32] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Ubuntu - File - Rename multiple files ====== | ||
- | |||
- | ===== Add an extension ===== | ||
- | |||
- | <code bash> | ||
- | ls | ||
- | file1 file2 file3 | ||
- | </ | ||
- | |||
- | Add the extension " | ||
- | |||
- | <code bash> | ||
- | for F in $(ls);do mv $F $F.txt;done | ||
- | </ | ||
- | |||
- | Check the result: | ||
- | |||
- | <code bash> | ||
- | ls | ||
- | file1.rm file2.rm file3.rm | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ===== Change the extension ===== | ||
- | |||
- | Change the extension from " | ||
- | |||
- | <code bash> | ||
- | for F in $(ls);do mv $F $(echo $F|sed -e ' | ||
- | </ | ||
- | |||
- | Check the result: | ||
- | |||
- | <code bash> | ||
- | ls | ||
- | file1.mp3 file2.mp3 file3.mp3 | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ===== Remove the extension ===== | ||
- | |||
- | <code bash> | ||
- | for F in $(ls);do mv $F $(echo $F|sed -e ' | ||
- | </ | ||
- | |||
- | Check the result: | ||
- | |||
- | <code bash> | ||
- | ls | ||
- | file1 file2 file3 | ||
- | </ | ||
ubuntu/file/rename_multiple_files.1594805433.txt.gz · Last modified: 2020/07/15 09:30 by 127.0.0.1