How can I remove the first letter from  a directory name? for example:Folder is named as AFolder_01 how can I rename it to Folder_01The reason for my question is that I have list of folders and I want to rename all these folders at once by removing the first letter.I found this code online to remove the last character(s):  while IFS= read -r dir; do [[ -d $dir ]] && mv -i $dir ${dir%?}; done <all.txtHow can this code be revised to remove the first letter?i.e. In my example  rename AFolder_01 to Folder_01How can this code be revised to add charterer back at the beginning of the folder name:i.e. in my example rename Folder_01  to AFolder_01
Remove first character in a folder name
command line
Once you have your directory name in a variable (e. g. dir), you can:mv $dir ${dir:1}This will strip the first character from the variable.  I shall leave sanity-checking that the new directory does not yet already exist up to you.To add something to the beginning (e. g. the letter A):mv $dir A$dir