Instructions and usage of linux touch chattr
- 2020-05-17 07:31:17
- OfStack
linux touch,chattr instructions
man touch
NAME
touch - Change the timestamp of the file
SYNOPSIS
touch [OPTION]... FILE...
DESCRIPTION
Update file atime and mtime For the time being
-a Fix only the time the file was retrieved
-c, --no-create A file that does not exist is not created as a new file
-d, --date=STRING use STRING Instead of using the current time
-m Modify only when the contents of the file have changed
-t STAMP use [[CC]YY]MMDDhhmm[.ss] Format the time rather than the current time
--help Show help
--version Display version information
man chattr
NAME
chattr - Change the hidden properties of the file
SYNOPSIS
chattr +-=[ASacDdIijsTtu] files...
OPTIONS
+ Increase: 1 Special parameters; - Remove: 1 Special parameters; = : set parameters as set parameters
A : if there is any access to this file or directory, his atime The timestamp will not be modified
S : when making any changes to a file, it will be written to disk "synchronously"
a: This file will only add data, not delete or modify data, only root To modify this property
c: This file will be "compressed" automatically. It will be extracted automatically when it is read. It will be compressed first and then stored when it is stored
d: The file or directory will not be dump The backup
i: Make the file unable to be deleted, renamed, linked, written or added, only root Can set this property
s: When the file is deleted, it may be removed completely and cannot be recovered
u: with s Instead of deleting completely, you can retrieve the deleted file
The man page of this instruction is really difficult to understand. After reference materials, I understood part of the content, so I did not follow the content of man page
man lsattr
NAME
lsattr - Shows the hidden properties of the file
SYNOPSIS
lsattr [ -RVadv ] [ files... ]
OPTIONS
-R Recursively lists data from subdirectories as well
-V Displays version information for the program
-a The properties of the hidden file are also displayed
-d If it is a directory, list only the properties of the directory itself, not the files in the directory
Thank you for reading, I hope to help you, thank you for your support of this site!