79546943

Date: 2025-03-31 17:58:16
Score: 1.5
Natty:
Report link

I found this solution, with the aid of ChatGPT and it seems to solve the problem in my case, the script is:

for file in *; do
  if [[ "$file" == *"_"* ]]; then
    new_name=$(echo "$file" | sed 's/^[^_]*_//')
    mv "$file" "$new_name"
  fi
done
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Tony