#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Move all files whose names contain a capital letter


    Anyone have any ideas how I can move all files whose names contain a capital letter from one directory to another?

    For instance:

    I have files named

    cat
    dog
    Zebra
    oRanGuTang

    But I only wanna move Zebra and oRanGutang
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,477
    Rep Power
    1752
    You could give the following a go:

    Code:
    find /source/dir -type f -maxdepth 1 -name "*[A-Z]*" -exec mv {} /target/dir \;
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc

IMN logo majestic logo threadwatch logo seochat tools logo