04-03-2022
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
|
||||
##### Ouvrir une page man dans un fenêtre spécifique:
|
||||
#### Ouvrir une page man dans un fenêtre spécifique:
|
||||
|
||||
```bash
|
||||
$ open x-man-page://ls
|
||||
@@ -11,7 +11,9 @@ $ open x-man-page://ls
|
||||
function xmanpage() { open x-man-page://$@ ; }
|
||||
```
|
||||
|
||||
##### Ouvrir une page man dans Aperçu:
|
||||
|
||||
|
||||
#### Ouvrir une page man dans Aperçu:
|
||||
|
||||
```bash
|
||||
$ man -t ls | open -f -a "Preview"
|
||||
@@ -20,7 +22,9 @@ $ man -t ls | open -f -a "Preview"
|
||||
function preman() { man -t "$@" | open -f -a "Preview" ;}
|
||||
```
|
||||
|
||||
##### Obtenir le chemin de la fenêtre courante du Finder:
|
||||
|
||||
|
||||
#### Obtenir le chemin de la fenêtre courante du Finder:
|
||||
|
||||
```bash
|
||||
$ osascript -e 'tell app "Finder" to get posix path of ((target of window 1) as alias)'
|
||||
@@ -49,6 +53,27 @@ alias cdf='pwdf; cd "$(pwdf)"'
|
||||
|
||||
|
||||
|
||||
#### Erreur: 'zsh: operation not permitted'
|
||||
|
||||
```bash
|
||||
zsh: operation not permitted: /Users/bruno/.local/bin/convert-videos-for-plex.sh
|
||||
```
|
||||
|
||||
Le script est peut-être en quarantaine:
|
||||
|
||||
```bash
|
||||
$ xattr -l /Users/bruno/.local/bin/convert-videos-for-plex.sh
|
||||
com.apple.quarantine
|
||||
```
|
||||
|
||||
Pour supprimer la quarantaine:
|
||||
|
||||
```bash
|
||||
$ xattr -d com.apple.quarantine /Users/bruno/.local/bin/convert-videos-for-plex.sh
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### Raccourcis:
|
||||
|
||||
Aller en début de ligne: `CTRL+A`
|
||||
|
||||
124
docs/macos/terminal/xattr.md
Normal file
124
docs/macos/terminal/xattr.md
Normal file
@@ -0,0 +1,124 @@
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user