1 |
for i in `ps aux | grep "/tmp/prueba.sh" | awk '{print $2}'`; do kill -9 $i; done |
1 |
for i in `ps aux | grep "/tmp/prueba.sh" | awk '{print $2}'`; do kill -9 $i; done |
1 |
for i in `ls`; do echo $PWD/$i | grep -v 2014 | grep -v 2015 | grep -v 2016 | grep -v 2017 ; done |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#!/bin/bash # renombra.sh # renombrador de ficheros básico criterio=$1 expresion=$2 sustituto=$3 for i in $( ls *$criterio* ); do orig=$i dest=$(echo $i | sed -e "s/$expresion/$sustituto/") mv $orig $dest done |
1 2 3 4 5 6 7 8 9 10 |
#!/bin/bash MAX_WAIT=80 DELAY=10 TOTAL_WAIT=0 until [ $TOTAL_WAIT -gt $MAX_WAIT ] do echo $TOTAL_WAIT sleep $DELAY let TOTAL_WAIT=$TOTAL_WAIT+$DELAY; done |
1 |
swap -s | tr “k” ” ” | awk ‘{print ($9 * 100)/($9+$11)}’ |