gnu-linux:bash
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
gnu-linux:bash [2019/12/21 11:49] – jocker | gnu-linux:bash [Date inconnue] (Version actuelle) – supprimée - modification externe (Date inconnue) 127.0.0.1 | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== Bash ====== | ||
- | |||
- | ===== Aliases ===== | ||
- | |||
- | Quelques aliases plus ou moins utiles. | ||
- | |||
- | <code bash .bash_aliases> | ||
- | |||
- | # wget2 | ||
- | alias wget=" | ||
- | |||
- | # Edit alias | ||
- | alias aliases-edit=" | ||
- | # Update alias | ||
- | alias aliases-update=" | ||
- | |||
- | # Meteo | ||
- | alias meteo=" | ||
- | |||
- | # cryptocurrencies | ||
- | alias cryptocurrencies=" | ||
- | |||
- | # cp, mv, rm, ls, du | ||
- | alias rm="rm -v" | ||
- | alias ls="ls -AFhoqv --color --group-directories-first" | ||
- | alias ds="du -csh * | sort -h -r" | ||
- | alias tree=" | ||
- | |||
- | # Reduce CD cover | ||
- | cover-maker(){ | ||
- | for img in *.gif *.GIF *.jpg *.JPG *.jpeg *.png *.PNG *.tif *.TIF *.bmp *.BMP; | ||
- | do convert -quality 92 -resize 1000 " | ||
- | done | ||
- | } | ||
- | |||
- | # top 15 size file | ||
- | top15files(){ | ||
- | find " | ||
- | } | ||
- | |||
- | # retirer parentheses et texte dedans | ||
- | remove-parenthesis-content(){ | ||
- | for file in * ; do mv -v " | ||
- | } | ||
- | |||
- | # Compresse séparément tout les fichiers d'un répertoire en zip | ||
- | compress-all-zip(){ | ||
- | SOURCE=$(wc -c * 2> /dev/null | grep " | ||
- | for file in *.*; do zip " | ||
- | TARGET=$(wc -c *.zip 2> /dev/null | grep " | ||
- | PERC=$(bc <<< | ||
- | echo -e "The target(s) compressed file(s) does " | ||
- | } | ||
- | |||
- | # Compresse séparément tout les fichiers d'un répertoire en xz | ||
- | compress-all-xz(){ | ||
- | SOURCE=$(wc -c * 2> /dev/null | grep " | ||
- | for file in *.*; do tar -c -v " | ||
- | TARGET=$(wc -c *.tar.xz 2> /dev/null | grep " | ||
- | PERC=$(bc <<< | ||
- | echo -e "The target(s) compressed file(s) does " | ||
- | } | ||
- | |||
- | # Compresse séparément tout les fichiers d'un répertoire en lz4 | ||
- | compress-all-lz4(){ | ||
- | SOURCE=$(wc -c * 2> /dev/null | grep " | ||
- | for file in *.*; do tar -c -v " | ||
- | TARGET=$(wc -c *.tar.lz4 2> /dev/null | grep " | ||
- | PERC=$(bc <<< | ||
- | echo -e "The target(s) compressed file(s) does " | ||
- | } | ||
- | |||
- | # Compression tar.xz | ||
- | compress-xz(){ | ||
- | if [[ -d $@ ]]; then | ||
- | time tar -c " | ||
- | echo | ||
- | SOURCE=$(find " | ||
- | TARGET=$(wc -c " | ||
- | PERC=$(bc <<< | ||
- | echo -e "The target compressed file does " | ||
- | else | ||
- | time tar -c " | ||
- | echo | ||
- | SOURCE=$(wc -c " | ||
- | TARGET=$(wc -c " | ||
- | PERC=$(bc <<< | ||
- | echo -e "The target compressed file does " | ||
- | fi | ||
- | } | ||
- | |||
- | # Compression tar.lzo | ||
- | compress-lzo(){ | ||
- | if [[ -d $@ ]]; then | ||
- | time tar -c " | ||
- | echo | ||
- | SOURCE=$(find " | ||
- | TARGET=$(wc -c " | ||
- | PERC=$(bc <<< | ||
- | echo -e "The target compressed file does " | ||
- | else | ||
- | time tar -c " | ||
- | echo | ||
- | SOURCE=$(wc -c " | ||
- | TARGET=$(wc -c " | ||
- | PERC=$(bc <<< | ||
- | echo -e "The target compressed file does " | ||
- | fi | ||
- | } | ||
- | |||
- | # Compression tar.lz4 | ||
- | compress-lz4(){ | ||
- | if [[ -d $@ ]]; then | ||
- | time tar -c " | ||
- | else | ||
- | time tar -c " | ||
- | fi | ||
- | } | ||
- | |||
- | # Extraire une archive | ||
- | function extract(){ | ||
- | if [ -f " | ||
- | case " | ||
- | *.tar.xz) | ||
- | *.tar.lzo) | ||
- | *.tar.lz4) | ||
- | *.tar.lzma) | ||
- | *.tar.bz2) | ||
- | *.tar.gz) | ||
- | *.bz2) | ||
- | *.rar) | ||
- | *.gz) | ||
- | *.tar) | ||
- | *.tbz2) | ||
- | *.tgz) | ||
- | *.zip) | ||
- | *.Z) | ||
- | *.7z) | ||
- | *.7z.*) | ||
- | *.iso) | ||
- | *.img) | ||
- | *) echo "' | ||
- | esac | ||
- | else | ||
- | echo "' | ||
- | fi | ||
- | } | ||
- | |||
- | # Extraire plusieurs archives de meme type | ||
- | function extract-all(){ | ||
- | if [ -f " | ||
- | case " | ||
- | *.rar) | ||
- | *.tar.xz) | ||
- | *.zip) | ||
- | *.7z) | ||
- | *) echo "' | ||
- | esac | ||
- | else | ||
- | echo "' | ||
- | fi | ||
- | } | ||
- | </ | ||
- | |||
gnu-linux/bash.1576928943.txt.gz · Dernière modification : 2022/12/17 14:09 (modification externe)