Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

number of files in a folder

ls | wc -l #Count files on current directory
ls path/to/dir | wc -l #Count files on specific directory path
Comment

number all files in a folder

a=1
for i in *.jpg; do
  new=$(printf "%04d.jpg" "$a") #04 pad to length of 4
  mv -i -- "$i" "$new"
  let a=a+1
done
Comment

number all files in a folder

ls -v | cat -n | while read n f; do mv -n "$f" "$n.ext"; done 
Comment

PREVIOUS NEXT
Code Example
Shell :: get container config docker 
Shell :: bash for in loop 
Shell :: add conda to sudo path 
Shell :: flutter sdk download 
Shell :: change desktop icon size in linux 
Shell :: gatsby-plugin-typography 
Shell :: View Commit History With Changes in git command 
Shell :: window reset wifi cmd 
Shell :: docker run commands 
Shell :: set up vim in zsh 
Shell :: archive file 
Shell :: append a string in all files name linux 
Shell :: ionic splash screen dimensions 
Shell :: mac terminal wifi commands 
Shell :: linux scroll terminal 
Shell :: linux grep regex return match 
Shell :: bash read file 
Shell :: install clang++ 
Shell :: EDIT WSL2 terminal user% 
Shell :: install docker 
Shell :: how to setup a gitignore 
Shell :: delete file from a branch git 
Shell :: uninstall adobe creative cloud 
Shell :: creating new branch 
Shell :: Rename File with the rename Command 
Shell :: copying directories in linux 
Shell :: revert the revert 
Shell :: kuberetes config 
Shell :: steps to assign mfa using aws cli 
Shell :: npm install firebase @angular/fire 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =