By: Strauss K in macos Tutorials on 2011年02月03日 [フレーム]
The chflags command in Mac OS X is used to change the file or directory flags. File flags are the attributes that can be set on a file or directory to modify its behavior or state. The chflags command can be used to set or unset the file flags.
The syntax of the chflags command is as follows:
chflags [ -R [-H | -L | -P]] flags file...
Here, the options are:
-R: Recursively change the flags of all files and directories in the specified directory hierarchy.-H: If a command-line argument is a symbolic link to a directory, recursively change the flags of the directory the symbolic link refers to.-L: If a command-line argument is a symbolic link, change the flags of the symbolic link itself rather than the file or directory it refers to.-P: Do not follow symbolic links; instead, change the flags of the symbolic link itself.The flags are a series of one or more letters, which represent the file or directory flags. Some commonly used flags are:
arch: Set the archived flag.hidden: Set the hidden flag.nohidden: Unset the hidden flag.sappnd: Set the system append-only flag.noappnd: Unset the system append-only flag.uchg: Set the user immutable flag.nouchg: Unset the user immutable flag.hidden: Set the hidden flag.Here are some examples of how to use the chflags command:
Set the hidden flag on a file:
chflags hidden myfile.txt
Unset the hidden flag on a file:
chflags nohidden myfile.txt
Set the immutable flag on a file:
chflags uchg myfile.txt
Unset the immutable flag on a file:
chflags nouchg myfile.txt
Recursively set the hidden flag on all files in a directory
chflags -R hidden mydirectory
This policy contains information about your privacy. By posting, you are declaring that you understand this policy:
This policy is subject to change at any time and without notice.
These terms and conditions contain rules about posting comments. By submitting a comment, you are declaring that you agree with these rules:
Failure to comply with these rules may result in being banned from submitting further comments.
These terms and conditions are subject to change at any time and without notice.
Most Viewed Articles (in macos )
Different Versions of Mac OS X
Installing gedit for python programming in Mac OS X
Latest Articles (in macos)
© 2023 Java-samples.com
Tutorial Archive: Data Science React Native Android AJAX ASP.net C C++ C# Cocoa Cloud Computing EJB Errors Java Certification Interview iPhone Javascript JSF JSP Java Beans J2ME JDBC Linux Mac OS X MySQL Perl PHP Python Ruby SAP VB.net EJB Struts Trends WebServices XML Office 365 Hibernate
Latest Tutorials on: Data Science React Native Android AJAX ASP.net C Cocoa C++ C# EJB Errors Java Certification Interview iPhone Javascript JSF JSP Java Beans J2ME JDBC Linux Mac OS X MySQL Perl PHP Python Ruby SAP VB.net EJB Struts Cloud Computing WebServices XML Office 365 Hibernate