Commandes Unix

Publié le par Vosgien linuxien

# Print the environment of a running process (ie. firefox)

xargs -n1 -0 < /proc/$(pidof firefox| cut -d' ' -f1)/environ

 

# Generate a random 5 digit numeric PIN.

for d in {1..5}; do printf ${RANDOM: -1:1}; done; echo

# Ou encore mieux apg -a 1 -M n -n 3 -m 5 -x 5

 

# On Linux, print out a list of the process IDs that are in the zombie state.

ps aux | awk '{if ($8=="Z") { print $2 }}'

 

# Liste des fichiers d'un dossier en double

fdupes -r /home/xxxx > dupes.txt

 

# Convertion fichier pdf en png en le réduisant a 20% de sa taille d'origine (fonctionne aussi pour d'autres formats) via imagemagick

convert Img_0026.pdf -resize 20% Img_0026.png

 

# Conversion de tous les fichiers d'un dossier en 1 commande via imagemagick

convert *.pdf  -set filename:f '%t.png' +adjoin '%[filename:f]'

 

# Création/Paramétrage d'un compte a rebours

countdown(){ a=${1:-10}; while [[ > 0 ]] ;do printf "\33[2K\r$a"; sleep 1; a=$(($a-1));done;printf "\33[2K\r"; }

Publié dans Linux

Pour être informé des derniers articles, inscrivez vous :
Commenter cet article