125 lines
2.2 KiB
Markdown
125 lines
2.2 KiB
Markdown
# xattr
|
||
|
||
|
||
|
||
```bash
|
||
alubook:Custom bruno$ ls -la
|
||
total 7960
|
||
drwxr-xr-x 18 bruno staff 612 24 déc 09:11 .
|
||
drwx------+ 92 bruno staff 3128 24 déc 09:05 ..
|
||
-rw-r--r--@ 1 bruno staff 6148 24 déc 09:05 .DS_Store
|
||
-rw-r--r-- 1 bruno staff 558 7 oct 01:14 Localizable.strings
|
||
-rw-r--r--@ 1 bruno staff 16836 24 déc 08:28 MacOSX copie.png
|
||
-rw-r--r-- 1 bruno staff 10284 21 aoû 03:00 MacOSX.png
|
||
```
|
||
|
||
|
||
|
||
1er caractère
|
||
|
||
- d: dossier
|
||
|
||
- -: fichier
|
||
|
||
|
||
|
||
Dernier caractère:
|
||
|
||
- @: extended attributes
|
||
|
||
- +: extended security information (acl)
|
||
|
||
|
||
|
||
Afficher les attributs étendus: `xattr -l <filename>`
|
||
|
||
Effacer un attribut étendu: `xattr -d com.apple.quarantine my_jar.jar`
|
||
|
||
Effacer tous les attributs étendus: `xattr -c my_jar.jar`
|
||
|
||
|
||
|
||
#### Affiche les attributs étendus:
|
||
|
||
```bash
|
||
$ xattr tabColor.sh
|
||
com.apple.TextEncoding
|
||
com.apple.lastuseddate#PS
|
||
com.apple.macl
|
||
com.apple.metadata:_kMDItemUserTags
|
||
com.apple.metadata:kMDItemDownloadedDate
|
||
com.apple.metadata:kMDItemWhereFroms
|
||
com.apple.metadata:kMDLabel_mpkqupmo7cxdxxjnmfdfxofpfe
|
||
com.apple.quarantine
|
||
```
|
||
|
||
|
||
|
||
#### Affiche les attributs étendus et leur valeur:
|
||
|
||
```bash
|
||
$ xattr -l tabColor.sh
|
||
com.apple.TextEncoding: UTF-8;134217984
|
||
com.apple.lastuseddate#PS: <20><>]
|
||
com.apple.macl:
|
||
com.apple.metadata:_kMDItemUserTags: bplist00<30>
|
||
com.apple.metadata:kMDItemDownloadedDate: bplist00<30>3A<33>Yw<59><77>#<23>
|
||
|
||
com.apple.metadata:kMDItemWhereFroms: bplist00<30>_Ahttps://www.admin-linux.fr/wp-content/uploads/2013/09/tabColor.sh
|
||
|
||
com.apple.metadata:kMDLabel_mpkqupmo7cxdxxjnmfdfxofpfe: <20>
|
||
com.apple.quarantine: 0081;00000000;;
|
||
```
|
||
|
||
|
||
|
||
#### Affiche (-p (print)) la valeur d'un attribut étendu:
|
||
|
||
```bash
|
||
$ xattr -p com.apple.TextEncoding tabColor.sh
|
||
UTF-8;134217984
|
||
```
|
||
|
||
|
||
|
||
#### Modifie (-w (write)) la valeur d'un attribut étendu:
|
||
|
||
```bash
|
||
$ xattr -w <attribut> <valeur> tabColor.sh
|
||
```
|
||
|
||
|
||
|
||
#### Supprime (-d (delete)) l'attribut étendu et sa valeur:
|
||
|
||
```bash
|
||
$ xattr -d <attribut> tabColor.sh
|
||
```
|
||
|
||
|
||
|
||
#### Supprime (-c (clear)) tous les attributs étendus:
|
||
|
||
```bash
|
||
$ xattr -c tabColor.sh
|
||
```
|
||
|
||
|
||
|
||
#### Options:
|
||
|
||
- `-l`
|
||
- `-r`: récursive
|
||
- `-s`
|
||
- `-v`
|
||
- `-x`
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
https://developer.apple.com/library/archive/documentation/CoreServices/Reference/MetadataAttributesRef/MetadataAttrRef.html#//apple_ref/doc/uid/TP40001691-BCICJDHA
|
||
|