Results 1 to 8 of 8

Thread: Renaming long filenames

  1. #1

    Default Renaming long filenames

    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, PHP, and I know basic C.

  2. #2
    Join Date
    Jun 2008
    Location
    The English Lake District. UK - GMT/BST
    Posts
    36,733
    Blog Entries
    20

    Default Re: Renaming long filenames

    Open a terminal in the directory

    Lets assume the file is called: imabigfilename.txt

    try this

    Code:
    mv imabigfilename.txt smallfilename.txt
    Leap 15.1_KDE
    My Articles Was I any help? If yes: Click the star below

  3. #3

    Default Re: Renaming long filenames

    Worked. What a life saver. Many thanks

  4. #4
    Join Date
    Dec 2008
    Location
    Hamburg
    Posts
    458

    Default Re: Renaming long filenames

    Hi,

    Quote Originally Posted by Angadude View Post
    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, PHP, and I know basic C.
    What exactly do you want to do? The rename command is not for renaming files from old to new file name but for fixing e. g. numbered file names or file extensions like this

    Code:
    rename .htm .html *.htm
    which means "Search for *.htm and change the extension from htm to html. Could you give us an example what exactly the problem is. I think to rename the files with mv in a 3 gig folder will cause a load of work.

    Bye

    Erik

  5. #5

    Default Re: Renaming long filenames

    Hello Angadude,

    Please take a look at a software package called "fslint".

    It is a tool that performs various types of clean-up on large numbers of files in an automated way. Two of the sub-features that may interest you are called "Bad names" and "Name clashes".

    FSlint - Duplicate file finder for linux

    Best of luck!

  6. #6

    Default Re: Renaming long filenames

    Quote Originally Posted by oxala View Post
    Hello Angadude,

    Please take a look at a software package called "fslint".

    It is a tool that performs various types of clean-up on large numbers of files in an automated way. Two of the sub-features that may interest you are called "Bad names" and "Name clashes".

    FSlint - Duplicate file finder for linux

    Best of luck!
    Thanks for the info on Fslint. Interesting application.
    Definitely beats writing my own find program.
    Looks like I'm going to have my hands filled getting rid of duplicates.
    Box 1: OpenSuse 11.1/Win7 | Linux 2.6.27 Gnome | AMD 64 X2 6000+ | nVidia 8600GT | 2GB RAM
    Box 2: OpenSuse 11.2 | Linux 2.6.31 Gnome | AMD 64 3000+ | ATI X800 Pro | 1GB RAM
    Box 3: Win7 Premium Home | Intel P4 3.0Gz | ATI AIW 2006 | 2GB RAM

  7. #7
    Join Date
    Sep 2008
    Location
    Near Brussels, Belgium N50 50.394 E4 29.462
    Posts
    318

    Default Re: Renaming long filenames

    On 2010-08-09, tararpharazon <tararpharazon@no-mx.forums.opensuse.org> wrote:

    > Looks like I'm going to have my hands filled getting rid of duplicates.


    Duplicate what? Names? Or file content?

    I have a script that replaces identical files with links to each other. Just
    to save space, you know.

    That could easly be changed to only list the identical files, without taking
    any action.

    Any use to you ?


    --
    When in doubt, use brute force.
    -- Ken Thompson

  8. #8

    Default Re: Renaming long filenames

    Quote Originally Posted by Rikishi42 View Post
    On 2010-08-09, tararpharazon <tararpharazon@no-mx.forums.opensuse.org> wrote:

    > Looks like I'm going to have my hands filled getting rid of duplicates.


    Duplicate what? Names? Or file content?

    I have a script that replaces identical files with links to each other. Just
    to save space, you know.

    That could easly be changed to only list the identical files, without taking
    any action.

    Any use to you ?


    --
    When in doubt, use brute force.
    -- Ken Thompson
    Thanks, no I don't think so. I want to get rid of duplicates. Mostly the same files in different locations, look-alike photos, cached .pngs.

    Sadly, afile.txt from folder ~/download is a duplicate to afile.txt in ~/documents, and bfile.txt in ~/folder/bbbc is a duplicate of bfile.txt in ~/folder/123ts. Then self asks self what and why do I have a ~/folder/123ts?
    Box 1: OpenSuse 11.1/Win7 | Linux 2.6.27 Gnome | AMD 64 X2 6000+ | nVidia 8600GT | 2GB RAM
    Box 2: OpenSuse 11.2 | Linux 2.6.31 Gnome | AMD 64 3000+ | ATI X800 Pro | 1GB RAM
    Box 3: Win7 Premium Home | Intel P4 3.0Gz | ATI AIW 2006 | 2GB RAM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •