Results 1 to 3 of 3

Thread: Change Create Date on Directory

  1. #1
    Junior Member
    Join Date
    Jun 2001
    Location
    Melbourne, Australia
    Posts
    94

    Change Create Date on Directory

    I want to run a script to delete any directory over a certain age, so for testing I want to create a bunch of dir's and change their date to one over 30 days old. Anyone know how to modify the create date on a directory?

    Cheers,

    David.

  2. #2

    re: Change Create Date on Directory

    Strictly speaking, Linux/Unix files don't have "Create" dates. They have, among other things, "Change" dates which indicate the last time the status information of the file was changed. For lots of information, read $(man 2 stat).

    As a partial answer to the question, see this small shell sample:

    [cdl@delta try]$ mkdir foo.d
    [cdl@delta try]$ ls -ld foo.d
    drwxrwxr-x 2 cdl cdl 4096 Nov 1 11:00 foo.d/
    [cdl@delta try]$ touch --date=1-oct-2007 foo.d
    [cdl@delta try]$ ls -ld foo.d
    drwxrwxr-x 2 cdl cdl 4096 Oct 1 00:00 foo.d/

    carl

  3. #3
    Junior Member
    Join Date
    Jun 2001
    Location
    Melbourne, Australia
    Posts
    94
    Quote Originally Posted by clowenstein View Post
    Strictly speaking, Linux/Unix files don't have "Create" dates. They have, among other things, "Change" dates which indicate the last time the status information of the file was changed. For lots of information, read $(man 2 stat).

    As a partial answer to the question, see this small shell sample:

    [cdl@delta try]$ mkdir foo.d
    [cdl@delta try]$ ls -ld foo.d
    drwxrwxr-x 2 cdl cdl 4096 Nov 1 11:00 foo.d/
    [cdl@delta try]$ touch --date=1-oct-2007 foo.d
    [cdl@delta try]$ ls -ld foo.d
    drwxrwxr-x 2 cdl cdl 4096 Oct 1 00:00 foo.d/

    carl
    Champion, Carl. Just what I was after. Thanks mate.

Similar Threads

  1. Active Directory LDAP Compliance
    By regix in forum Windows - General Topics
    Replies: 0
    Last Post: 01-04-2005, 03:34 AM
  2. Reinstall Dial-Up Networking and TCP/IP
    By regix in forum Windows - General Topics
    Replies: 0
    Last Post: 01-01-2005, 02:07 AM
  3. no modem in Redhat Linux 8??
    By in forum Linux - General Topics
    Replies: 172
    Last Post: 09-14-2003, 04:20 PM
  4. Help with Modem/Weird Request...
    By McBane in forum Suse
    Replies: 22
    Last Post: 12-31-2002, 02:46 AM

Bookmarks

Posting Permissions

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