Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

rename all files in a folder with progressive numbers linux

for i in *.txt; do
	new=$(printf "%01d.txt" "$a")
	mv -i -- "$i" "$new"
	let a=a+1
done

# "%01d.txt" 01 is the number of digits you want your name to be composed of,
# Example: %01.txt --> 1.txt , 2.txt, 3.txt, ..., 10.txt, ...
#		   %04.txt --> 0001.txt, 0002.txt, ..., 0010.txt, ...
Comment

PREVIOUS NEXT
Code Example
Shell :: bash if number equals 
Shell :: set multiple git username and password 
Shell :: how to install spotify in linux 
Shell :: psycopg2-binary install for M1 
Shell :: choco installation 
Shell :: npm dev server 
Shell :: sed replace all occurances? 
Shell :: npm install package as developer dependency 
Shell :: git chnage to commit id 
Shell :: vscode save git credentials 
Shell :: add user ubuntu 20.04 
Shell :: bash copy contents of file to clipboard 
Shell :: git remove without deleting 
Shell :: / bin/sh: 1: bc: not found 
Shell :: laravel installation from github 
Shell :: git clone with personal access token command line 
Shell :: how to set up git in linux terminal 
Shell :: vendor/autoload.php download 
Shell :: show remote git 
Shell :: bash script get ip address of eth0 
Shell :: where is tomcat installed on mac 
Shell :: install r packages in anaconda 
Shell :: how to install atom on manjaro 
Shell :: how to remove filmora watermark 
Shell :: ansible lineinfile 
Shell :: gem uninstall version specific 
Shell :: linux create user with home directory 
Shell :: cisco copy running config 
Shell :: sudo cd 
Shell :: git tag a previous commit 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =