Find the answer to your Linux question:
Results 1 to 7 of 7
Hi all, Using following command I can able to find the directory which was accessed on 8days back exactly # find /dir1 -type d -atime 8 But I want to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2009
    Posts
    26

    Question Find command in linux


    Hi all,

    Using following command I can able to find the directory which was accessed on 8days back exactly

    # find /dir1 -type d -atime 8

    But I want to know the directory which was NOT accessed for 8days.

    Thanks in advance

    Regards
    Kalyan

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,752
    Read the find manual page.

    TESTS
    Numeric arguments can be specified as

    +n
    for greater than n,
    -n
    for less than n,
    n
    for exactly n.

  3. #3
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,345
    One thing to add:
    It is not seldom, that the atime is turned off at mount time.
    This is for performance reasons, as with atime every read also triggers a write.
    Apart from some pop3/imap daemons, this is fairly safe (afaik), but ymmv.

    You can check in /etc/fstab how your system is setup.
    You must always face the curtain with a bow.

  4. #4
    Just Joined!
    Join Date
    Aug 2011
    Posts
    1
    stat /dir1 should give you access and modify information

  5. #5
    Just Joined!
    Join Date
    Sep 2007
    Location
    Silver Spring, MD
    Posts
    95

    Find answer

    Quote Originally Posted by rhcekalyan View Post
    Hi all,

    Using following command I can able to find the directory which was accessed on 8days back exactly

    # find /dir1 -type d -atime 8

    But I want to know the directory which was NOT accessed for 8days.

    Thanks in advance

    Regards
    Kalyan
    ==================================

    find /dir1 -type d ! -atime 8 -exec ls -l {} \;

    The exec lists the date and validates the file.

    Todd

  6. #6
    Just Joined!
    Join Date
    Sep 2007
    Location
    Silver Spring, MD
    Posts
    95
    find /dir1 -type d ! -atime 8 -exec ls -l {} \;

    The exec lists the date and validates the file.

    Todd

  7. #7
    Just Joined!
    Join Date
    Jul 2009
    Posts
    26
    Thank you all.

Posting Permissions

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