User Tools

Site Tools


ubuntu:file:rename_multiple_files

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ubuntu:file:rename_multiple_files [2019/11/27 21:28] – created peterubuntu: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 
-</code> 
- 
-Add the extension ".txt" 
- 
-<code bash> 
-for F in $(ls);do mv $F $F.txt;done 
-</code> 
- 
-Check the result: 
- 
-<code bash> 
-ls 
-file1.rm file2.rm file3.rm 
-</code> 
- 
----- 
- 
-===== Change the extension ===== 
- 
-Change the extension from ".txt" to ".mp3": 
- 
-<code bash> 
-for F in $(ls);do mv $F $(echo $F|sed -e 's,\.rm,,').mp3 ;done 
-</code> 
- 
-Check the result: 
- 
-<code bash> 
-ls 
-file1.mp3 file2.mp3 file3.mp3 
-</code> 
- 
----- 
- 
-===== Remove the extension ===== 
- 
-<code bash> 
-for F in $(ls);do mv $F $(echo $F|sed -e 's,\.mp3,,') ;done 
-</code> 
- 
-Check the result: 
- 
-<code bash> 
-ls 
-file1 file2 file3 
-</code> 
  
ubuntu/file/rename_multiple_files.1574890099.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki