I have a folder of audio files in Ubuntu and each file name looks something like this:…
- User
I have a folder of audio files in Ubuntu and each file name looks something like this:
《三体:地球往事》第一部 有声小说 第06集 [mNxSmHis758].opus. This file name for example contains some text in brackets. For each file in the folder if the file name contains brackets, I need to remove the brackets and text in the brackets from the file name. write me a command for this Assistant
You can use this bash command to rename all files by removing the bracketed text:
bashfor file in *; do if [[ "$file" == *"["*"]"* ]]; then newname=$(echo "$file" | sed 's/\s*\[[^]]*\]//g') mv "$file" "$newname" fi done
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.