开发者

UNIX - Renaming files with long names

I am screwed. I misused wildcards like a moron, in the rename command.

I repeated names twice in a开发者_运维知识库 3gig folder, which I cannot afford to delete.

Now, the rename command is not working, and it says the file name is too long.

Please help me.

If programming can solve this, please let me know. I am a competent programmer in Java and PHP.


Under the hood, any rename command should get implemented with rename(). If you are in the directory where the file is and do:

mv hugefilenamethatiscreweduponandwanttobemuchshorted tersefile

it should work, as I don't think the path would get expanded out and overflow the limit. Otherwise, you can temporarily move the parent directory somewhere so it had a minimal path (like /p) and then rename the file and then move it back.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜