Re: HELP - Moving Files By Date Range

From: Christoph Schuch (christoph.schuch_at_gmx.at)
Date: 11/19/03

  • Next message: Jean-Luc BEAUDET: "GNUtar doesn't fit my needs..."
    Date: Wed, 19 Nov 2003 11:24:18 +0100
    
    

    **** Post for FREE via your newsreader at post.usenet.com ****

    > Is there are command or utility that will let me specify files by date
    > range to move?

    you can achive your date-based move with the following commands. (But
    beware, find reports also files in subdirectories, which will cause possible
    problems with the mv command)

    touch -t 10010000 limit_begin
    touch -t 10312359 limit_end

    find . -newer limit_begin -a ! -newer limit_end -a -type f -exec mv {}
    /otherdir \;

    if you have many subdirs you could use sed to handle your task. In this case
    the strings limit_begin and limit_end must be unique in the output of
    ll -tr.

    for file in `ll -tr | sed -n '/limit_begin/,/limit_end/p' | sed -n '/^-/p' |
    awk '{ print $9}'`
    do
    mv $file /otherdir
    done

    christoph

    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     *** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
                          http://www.usenet.com
    Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


  • Next message: Jean-Luc BEAUDET: "GNUtar doesn't fit my needs..."

    Relevant Pages

    • Re: Suppressing Start-Up Messages
      ... ...but it gave an error message. ... I think that it's impossible to execute many commands at once with /C or /K. ... files in subdirectories with the "Archive" bit set. ...
      (comp.os.msdos.4dos)
    • Re: Directory size, used, available, and percent-used?
      ... of subdirectories" sound useful? ... The notion of free space in a particular directory doesn't ... free or used space on the whole partition where the directory resides. ... That's how unix was designed from the start, lots of commands that perform ...
      (comp.os.linux)
    • Re: Directory size, used, available, and percent-used?
      ... of subdirectories" sound useful? ... The notion of free space in a particular directory doesn't ... free or used space on the whole partition where the directory resides. ... That's how unix was designed from the start, lots of commands that perform ...
      (alt.linux)
    • Re: Directory size, used, available, and percent-used?
      ... of subdirectories" sound useful? ... The notion of free space in a particular directory doesn't ... free or used space on the whole partition where the directory resides. ... That's how unix was designed from the start, lots of commands that perform ...
      (alt.os.linux)
    • Re: Directory size, used, available, and percent-used?
      ... of subdirectories" sound useful? ... The notion of free space in a particular directory doesn't ... free or used space on the whole partition where the directory resides. ... That's how unix was designed from the start, lots of commands that perform ...
      (comp.os.linux.misc)