Find the answer to your Linux question:
Results 1 to 4 of 4
Hello all, I am no scripting guru, but I think this is a simple command? I would like to perform a search of a directory and all it's sub directories ...
  1. #1
    Linux Newbie AboveNBeyond's Avatar
    Join Date
    Mar 2007
    Posts
    120

    Simple script needed, find all fily type, move to dir?

    Hello all,
    I am no scripting guru, but I think this is a simple command?

    I would like to perform a search of a directory and all it's sub directories for a certain file type, then mv all the files to a single directory.

    Basically I have a DJ rig with tons of duplicate mp3's, I would like to move them all to one directory so I can then clean up and sort back out.

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695
    Find Command
    Code:
    -exec mv {} /some_new_folder

  3. #3
    Linux Newbie AboveNBeyond's Avatar
    Join Date
    Mar 2007
    Posts
    120
    Where do I enter the file type?

  4. #4
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Exclamation

    find command has an option (-f) to specify the file type.
    Check
    man find
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

Posting Permissions

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