I am new to using Bash scripting, but I have discovered a few solutions that use it to either remove or rename the filename for files within directories and sub-directories in Ubuntu 16.04. For example, my file structure is shown below. So, the FolderFruit,,, is the filename of our main directories. SubFolderApple???. SubFolder!!!Kiwi and SubFolder_Food_Banana are the filenames of our subdirectories. ListAppleFood, ListKiwiFood, and ListBanana are the filename of our individual files.
The goal is to change the filenames above into as shown below.
So far, I manage to script it as below, but it is not working. Thus, I would like to get help from any experienced Bash or Linux users.
shopt -s globstar for f in ./**; do sed ‘s/([[:punct:]])/\1/g’ “$f” done