Horje
how to append string to file names in linux Code Example
how to append string to file names in linux
$ ls -all
-rw-r--r-- 1 29847 29847    0 Aug 21 14:33 file1.txt
-rw-r--r-- 1 29847 29847    0 Aug 21 14:33 file2.txt
-rw-r--r-- 1 29847 29847    0 Aug 21 14:33 file3.txt
-rw-r--r-- 1 29847 29847    0 Aug 21 14:33 file4.txt
-rw-r--r-- 1 29847 29847    0 Aug 21 14:33 file5.txt 

$ for f in *;do mv -v "$f" "${f%.*}hallo.${f##*.}";done
'file1.txt' -> 'file1hallo.txt'
'file2.txt' -> 'file2hallo.txt'
'file3.txt' -> 'file3hallo.txt'

$ ls -all
-rw-r--r-- 1 29847 29847    0 Aug 21 14:33 file1hallo.txt
-rw-r--r-- 1 29847 29847    0 Aug 21 14:33 file2hallo.txt
-rw-r--r-- 1 29847 29847    0 Aug 21 14:33 file3hallo.txt
append a string in all files name linux
rename 's/^/1_/' *

where ^ is for starting of the file or end




Shell

Related
Git lab global setup Code Example Git lab global setup Code Example
flutter android embedding check version Code Example flutter android embedding check version Code Example
xcuserstate file git Code Example xcuserstate file git Code Example
install realtek rtl88xxau usb wifi driver ubuntu Code Example install realtek rtl88xxau usb wifi driver ubuntu Code Example
install hass.io docker raspberry pi Code Example install hass.io docker raspberry pi Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10