Linux Basic Tutorial Use the find command to find file usage based on system time under linux

  
Linux Basic Tutorial Use the find command under linux to find files based on system time usage

LinuxFind
    Xiaobian summarizes these timestamps including the
  copy code code as follows:
  mtime The last modification time of the file content
  atime The time the file was read or accessed
  ctime The file state change time
  mtime and The meaning of atime is easy to understand, while ctime requires more explanation. Because inodes maintain metadata on each file, if the metadata about the file changes, the inode data will also change. This can be caused by a range of actions, including creating a symbolic link to the file, changing file permissions, or moving the file, etc. Since the file contents will not be read or modified in these cases, mtime and atime will not change, but ctime will.
  Each of these time options needs to be combined with a value n, specified as -n, n, or +n.
  Copy code The code is as follows:
  N * 24
  +1 means 1 * 24 + 24 hours outside..
  +0 means 0 * 24 + 24 hours outside
  1 means 1 * 24 + 24 to 24..
  0 means 0 * 24 + 24 Between 0..
  -1 means within 0 * 24 +24, even for future time...
  1. Current time 24 hours - current time (yesterday-today)
  #find . -mtime 0
  2. Current time 48 hours ago – 24 hours ago current time (the day before yesterday - yesterday)
  #find . -mtime 1
  3. Current time 48 hours ago (2 days ago)
  #find . -mtime +1
  4. Current time 24 hours – Current time (yesterday-today)
  #find . -mtime -1

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326489382&siteId=291194637