Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rename very long filename to short name

Status
Not open for further replies.

ady2012

MIS
Jun 6, 2010
108
0
0
US
I had a problem to cp to copy many very long filename.
The error messages : arg list too long
Example :
E2344_____________________________very_long_filename____________________________________________________________________.txt
become : E2344verylongfilename.txt
Any suggestion to rename very long filename to short filename.
 
The problem is possibly not the length of the filename, but the number of files you are renaming. More info please - how are you doing the rename?

The internet - allowing those who don't know what they're talking about to have their say.
 
I didn't know how to rename it. any script to rename this kind of filename ?
 
I will try it. Because I had a problem to run ls command to list all long filename.
But I can use firefox to list the all long filename.
Thanks.
 
One simple way that may actually help you perform other tasks in the future is to load midnightcommander and use it to copy/move files.

If you're in redhat/fedora use "yum install -y mc" to install it, then just run "mc". Very easy to navigate with arrow keys.
If you're on Debian based OS, use "apt-get install mc".

Otherwise you can't really rename a bunch of files automatically without a shell script. You have to understand you need to specify for each file what the new name is going to be.

If you know the criteria on which you are going to rename, I can help you write a short shell script to do just that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top