I have directories I want to rename,
I want to rename them to just the
I've tried to use the cut command
echo "$filename" | cut -d'_' -f3, however that leaves me with just the L001 part of the filename.
Obviously I could just rename them all manually, but there are hundreds of directories and I have not got the time.
Is there a way to use the cut command to get everything before the specific instance of the delimiter, or indeed anything else I could use?