Loading ...
Sorry, an error occurred while loading the content.
 

diff

Expand Messages
  • dr_ovalle
    Hi, I have a problem which, maybe I can solve with command line. Let s assume in folder A I have a song named: Alicia Keys - No One.mp3 In folder B I have a
    Message 1 of 5 , Sep 17, 2008
      Hi, I have a problem which, maybe I can solve with command line.

      Let's assume in folder A I have a song named: "Alicia Keys - No One.mp3"

      In folder B I have a song named: "Alicia Keys - No one.mp3"

      Both files have the same song, the same number of bytes, etc. They're
      identical, except for the name of the file.

      I have the same problem with maybe 100 more files.

      Each folder has almost 2000 songs.

      I want to copy all the files in folder A to a folder C, then, I want
      to copy all the files in folder B to C (and then upload C to my iPod),
      but I don't want to have the same song twice in my iPod

      I was looking in rute handbook, and it looks like the diff command
      compares between files.

      Maybe this is the command I was looking for, but I dont know how to
      use it, I went to the terminal, typed diff --help, and believe me, is
      really confuse, too many options and no idea how to use it.

      Do you think command line would save me this time to make all the
      process manually?

      Any ideas?
    • duckzlandd
      ... Use bash script to check the file - if file is the same name rename the copied file - copy to destination folder
      Message 2 of 5 , Sep 18, 2008
        --- In LINUX_Newbies@yahoogroups.com, "dr_ovalle" <dr_ovalle@...> wrote:
        >
        > Hi, I have a problem which, maybe I can solve with command line.
        >
        > Let's assume in folder A I have a song named: "Alicia Keys - No One.mp3"
        >
        > In folder B I have a song named: "Alicia Keys - No one.mp3"
        >
        > Both files have the same song, the same number of bytes, etc. They're
        > identical, except for the name of the file.
        >
        > I have the same problem with maybe 100 more files.
        >
        > Each folder has almost 2000 songs.
        >
        > I want to copy all the files in folder A to a folder C, then, I want
        > to copy all the files in folder B to C (and then upload C to my iPod),
        > but I don't want to have the same song twice in my iPod
        >
        > I was looking in rute handbook, and it looks like the diff command
        > compares between files.
        >
        > Maybe this is the command I was looking for, but I dont know how to
        > use it, I went to the terminal, typed diff --help, and believe me, is
        > really confuse, too many options and no idea how to use it.
        >
        > Do you think command line would save me this time to make all the
        > process manually?
        >
        > Any ideas?
        >
        Use bash script to check the file -> if file is the same name rename
        the copied file -> copy to destination folder
      • Linux Canuck
        Linux is much pickier about names than Windows, for example. It is case sensitive for one thing and sometimes users replace spaces with underscores when they
        Message 3 of 5 , Sep 18, 2008
          Linux is much pickier about names than Windows, for example. It is case sensitive for one thing and sometimes users replace spaces with underscores when they work in commandline for simplify things. Also Linux will append copy_1, copy_2, etc. to the file name if it is a duplicate file name rather than replace it. However, Linux does not care about suffixes, such as .mp3.

          You have a few choices. You can use the commandline or you can install a program to weed out duplicate files. See: http://ubuntu.wordpress.com/2005/10/08/find-duplicate-copies-of-files/ and http://ubuntuforums.org/showthread.php?t=647883

          You can use a mp3 utility to rename files based on their metadata. You could use a filter in Nautilus (Search) to weed out duplicates if there is an obvious pattern such as a double space in the file name. It all depends on how you work and your willingness to leave it up to a program over doing it manually.

          Since you have so many then you probably want to go with fdupes as in the links above.

          Roy



          Linux: Fast, friendly, flexible and .... free!
          Support Open source.
          <*,)}}+<
          Only dead fish go with the flow!




          ----- Original Message ----
          From: dr_ovalle <dr_ovalle@...>
          To: LINUX_Newbies@yahoogroups.com
          Sent: Thursday, September 18, 2008 12:21:24 AM
          Subject: [LINUX_Newbies] diff


          Hi, I have a problem which, maybe I can solve with command line.

          Let's assume in folder A I have a song named: "Alicia Keys - No One.mp3"

          In folder B I have a song named: "Alicia Keys - No one.mp3"

          Both files have the same song, the same number of bytes, etc. They're
          identical, except for the name of the file.

          I have the same problem with maybe 100 more files.

          Each folder has almost 2000 songs.

          I want to copy all the files in folder A to a folder C, then, I want
          to copy all the files in folder B to C (and then upload C to my iPod),
          but I don't want to have the same song twice in my iPod

          I was looking in rute handbook, and it looks like the diff command
          compares between files.

          Maybe this is the command I was looking for, but I dont know how to
          use it, I went to the terminal, typed diff --help, and believe me, is
          really confuse, too many options and no idea how to use it.

          Do you think command line would save me this time to make all the
          process manually?

          Any ideas?




          __________________________________________________________________
          Ask a question on any topic and get answers from real people. Go to Yahoo! Answers and share what you know at http://ca.answers.yahoo.com

          [Non-text portions of this message have been removed]
        • dr_ovalle
          Simply amazing ! I ran in a terminal: $fdupes ./Songs fdupes.txt It took about 3 minutes to search all the folder and created a text file named fdupes.txt,
          Message 4 of 5 , Sep 18, 2008
            Simply amazing !

            I ran in a terminal:

            $fdupes ./Songs > fdupes.txt

            It took about 3 minutes to search all the folder and created a text
            file named fdupes.txt, in this files there was the name of all the
            duplicated files.

            There is an option in fdupes to delete the duplicated files, so I will
            investigate a little more to do that.

            Thank you very much.

            I'm happy now.

            Thanks



            --- In LINUX_Newbies@yahoogroups.com, Linux Canuck <linuxcanuck@...>
            wrote:
            >
            > Linux is much pickier about names than Windows, for example. It is
            case sensitive for one thing and sometimes users replace spaces with
            underscores when they work in commandline for simplify things. Also
            Linux will append copy_1, copy_2, etc. to the file name if it is a
            duplicate file name rather than replace it. However, Linux does not
            care about suffixes, such as .mp3.
            >
            > You have a few choices. You can use the commandline or you can
            install a program to weed out duplicate files. See:
            http://ubuntu.wordpress.com/2005/10/08/find-duplicate-copies-of-files/
            and http://ubuntuforums.org/showthread.php?t=647883
            >
            > You can use a mp3 utility to rename files based on their metadata.
            You could use a filter in Nautilus (Search) to weed out duplicates if
            there is an obvious pattern such as a double space in the file name.
            It all depends on how you work and your willingness to leave it up to
            a program over doing it manually.
            >
            > Since you have so many then you probably want to go with fdupes as
            in the links above.
            >
            > Roy
            >
            >
            >
            > Linux: Fast, friendly, flexible and .... free!
            > Support Open source.
            > <*,)}}+<
            > Only dead fish go with the flow!
          • Robert C Wittig
            ... I was following this thread, and scratching my head, and thinking of how cmp ( diff is for ascii files) might be combined with a sort script to do the
            Message 5 of 5 , Sep 19, 2008
              dr_ovalle wrote:
              > Simply amazing !
              >
              > I ran in a terminal:
              >
              > $fdupes ./Songs > fdupes.txt
              >
              > It took about 3 minutes to search all the folder and created a text
              > file named fdupes.txt, in this files there was the name of all the
              > duplicated files.
              >
              > There is an option in fdupes to delete the duplicated files, so I will
              > investigate a little more to do that.
              >

              I was following this thread, and scratching my head, and thinking of
              how 'cmp' ('diff' is for ascii files) might be combined with a sort
              script to do the job.

              As soon as I saw your success with 'fdupes' I went and downloaded the
              code and compiled/installed, and ran it, and it sure is a handy tool.

              http://premium.caribe.net/~adrian2/fdupes.html

              When I get some 'free time' (heh) I will examine the source code file,
              to see how Adrian Lopez did it, for my continuing education.


              --
              -wittig http://www.robertwittig.com/
              http://robertwittig.net/
              http://robertwittig.org/
              .
            Your message has been successfully submitted and would be delivered to recipients shortly.