06-08-20121
This commit is contained in:
@@ -98,6 +98,27 @@ $ ls archive.tar
|
||||
|
||||
Compresser avec zip:
|
||||
|
||||
```
|
||||
zip <archive.zip> <file1> <file2>
|
||||
zip <archive.zip> <file*>
|
||||
```
|
||||
|
||||
```bash
|
||||
$ zip p10k.zip p1Ok.zsh
|
||||
adding: p1Ok.zsh (deflated 63%)
|
||||
```
|
||||
|
||||
Options:
|
||||
|
||||
- -q : pas des sortie écran
|
||||
- -Z bzip2 : méthode de compression bzip2 (deflate par défaut)
|
||||
- -9 ... -0 : niveau de compression (maxi -> mini)
|
||||
- -e : avec mot-de-passe
|
||||
|
||||
|
||||
|
||||
Compresser un dossier avec zip:
|
||||
|
||||
```bash
|
||||
$ zip -r scripts.zip scripts/
|
||||
adding: scripts/ (stored 0%)
|
||||
|
||||
@@ -119,7 +119,7 @@ $ usermod -G "" <username>
|
||||
|
||||
|
||||
|
||||
### Code de sortie:
|
||||
### Code de sortie (code de retour):
|
||||
|
||||
Chaque commande renvoie un *code de sortie* (quelque fois nommé *état de retour* ).
|
||||
|
||||
@@ -136,6 +136,7 @@ $ hostname
|
||||
silverbook.home
|
||||
$ echo $?
|
||||
0
|
||||
|
||||
$ hostnam
|
||||
-bash: hostnam: command not found
|
||||
$ echo $?
|
||||
@@ -149,3 +150,18 @@ bruno@SilverBook:~/.kymsu/plugins.d$ if [ $? -eq 0 ]; then echo "ok"; else echo
|
||||
ok
|
||||
```
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
$ pip3 install -U "pip"
|
||||
ret=$?
|
||||
|
||||
# pas d'update: ret=0
|
||||
[ $ret -eq 0 ] && echo -e "No update available !"
|
||||
|
||||
if [ $ret -eq 0 ]; then
|
||||
echo -e "No update available !"
|
||||
fi
|
||||
|
||||
```
|
||||
|
||||
|
||||
@@ -100,6 +100,16 @@ if [ -d directory ]; then
|
||||
if [ -d ~/.kde ]; then
|
||||
```
|
||||
|
||||
Si le répertoire *<u>directory</u>* existe ET n'est <u>pas vide</u>
|
||||
|
||||
```bash
|
||||
local_path=$HOME/Sites/
|
||||
|
||||
if find "$local_path/node_modules" -mindepth 1 -maxdepth 1 | read; then echo "dir not empty"; else echo "dir empty"; fi
|
||||
|
||||
if [ -d "$local_path/node_modules" ] && [ -n "$(ls -A "$local_path/node_modules")" ]; then echo "dir not empty"; else echo "dir empty"; fi
|
||||
```
|
||||
|
||||
Si le fichier *<u>regularfile</u> (ni un blockspecialfile, ni un characterspecialfile, ni un directory)* existe
|
||||
|
||||
```bash
|
||||
|
||||
17
docs/Linux/exa.md
Normal file
17
docs/Linux/exa.md
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
**exa -lbhHigUmuSa@ --time-style=long-iso --git --color-scale**
|
||||
|
||||
```bash
|
||||
❯ exa -lbhHigUmuSa@ --time-style=long-iso --git --color-scale
|
||||
inode Permissions Links Size Blocks User Group Date Modified Date Created Date Accessed Git Name
|
||||
3426575 drwxr-xr-x 12 - - bruno staff 2021-08-05 17:33 2021-08-05 09:35 2021-08-05 17:33 -- .git
|
||||
3426645 drwxr-xr-x 3 - - bruno staff 2021-08-05 09:35 2021-08-05 09:35 2021-08-05 17:32 -- img
|
||||
3426641 .rw-r--r-- 1 1,1Ki 8 bruno staff 2021-08-05 09:35 2021-08-05 09:35 2021-08-05 09:35 -- LICENSE
|
||||
3426642 .rw-r--r-- 1 1,4Ki 8 bruno staff 2021-08-05 09:35 2021-08-05 09:35 2021-08-05 09:35 -- Pure Dark.alfredappearance
|
||||
3426643 .rw-r--r--@ 1 1,4Ki 8 bruno staff 2021-08-05 09:35 2021-08-05 09:35 2021-08-05 09:36 -- Pure Light.alfredappearance
|
||||
└── com.apple.lastuseddate#PS (len 16)
|
||||
3426644 .rw-r--r-- 1 316 8 bruno staff 2021-08-05 09:35 2021-08-05 09:35 2021-08-05 09:36 -- README.md
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user