59 lines
1.4 KiB
Markdown
59 lines
1.4 KiB
Markdown
|
|
|
|
|
|
|
|
# chflags
|
|
|
|
|
|
|
|
Changer les flags d'un fichier ou d'un dossier.
|
|
|
|
|
|
|
|
Voir les flags dans macOS (**ls -lO**):
|
|
|
|
```bash
|
|
silverbook-1:~ enzo$ ls -lO
|
|
total 0
|
|
drwx------+ 3 enzo staff - 96 12 aoû 22:28 Desktop
|
|
drwx------+ 3 enzo staff - 96 12 aoû 22:28 Documents
|
|
drwx------+ 3 enzo staff - 96 12 aoû 22:28 Downloads
|
|
drwx------@ 56 enzo staff hidden 1792 17 aoû 08:07 Library
|
|
drwx------+ 3 enzo staff - 96 12 aoû 22:28 Movies
|
|
drwx------+ 3 enzo staff - 96 12 aoû 22:28 Music
|
|
drwx------+ 3 enzo staff - 96 12 aoû 22:28 Pictures
|
|
drwxr-xr-x+ 4 enzo staff - 128 12 aoû 22:28 Public
|
|
```
|
|
|
|
Par défaut, le dossier Bibliothèque de l'utilisateur est caché.
|
|
|
|
Si aucun flag n'est pis, un tiret est affiché.
|
|
|
|
|
|
|
|
Les différents flags sont:
|
|
|
|
- <u>arch</u>, <u>archived</u> (super-user only)
|
|
- <u>opaque</u> (owner or super-user only)
|
|
- <u>nodump</u> (owner or super-user only)
|
|
- <u>sappnd</u>,<u>sappend</u> (super-user only)
|
|
- <u>schg</u>, <u>schange</u>, <u>simmutable</u> (super-user only)
|
|
- <u>uappnd</u>, <u>uappend</u> (owner or super-user only)
|
|
- <u>uchg</u>, <u>uchange</u>, <u>uimmutable</u> (owner or super-user only)
|
|
- <u>hidden</u>
|
|
|
|
|
|
|
|
Pour supprimer un flag, il faut le régler à l'opposé:
|
|
|
|
```bash
|
|
$ sudo chflags dump /usr/bin/local/oty.sh
|
|
```
|
|
|
|
Comme pour chmod, l'option -R permet la récursivité.
|
|
|
|
```bash
|
|
$ chflags -R nohidden ~/Desktop
|
|
```
|
|
|