sort -t, -nk3 user.csv donde: * //-t//, - define que el delimitador es la ,. * //-n// - brinda el ordenamiento numerico. * //-k3// - define que columna usarĂ¡ para ordenamiento. manuel@lapanda:~/tmp$ cat prueba2.txt a,3,r,t d,5,d,d t,7,f,g u,3,g,w v,9,x,k p,0,k,l q,1,p,h manuel@lapanda:~/tmp$ sort -t, -nk2 prueba2.txt | cut -d, -f1,2,4 | tr , " " p 0 l q 1 h a 3 t u 3 w d 5 d t 7 g v 9 k manuel@lapanda:~/tmp$ sort -t, -nk2 prueba2.txt | cut -d, -f1,3,4 | tr , " " p k l q p h a r t u g w d d d t f g v x k manuel@lapanda:~/tmp$ cat gtthan.txt 12:sdaa:adasr:fdsfr 123:perpore:asdnassd:asdasd 34:74:okoasd:urur:rrp 128:popas:rera:fosa 45:bosla:miosna:xiooan 37:woajs:losala:huasmd 100:bfluasd:zoiorewr:ojuidf manuel@lapanda:~/tmp$ cat gtthan.txt |sort -t: -k3| awk -F: '{print $0}' 12:sdaa:adasr:fdsfr 123:perpore:asdnassd:asdasd 37:woajs:losala:huasmd 45:bosla:miosna:xiooan 34:74:okoasd:urur:rrp 128:popas:rera:fosa 100:bfluasd:zoiorewr:ojuidf manuel@lapanda:~/tmp$ cat gtthan.txt |sort -t: -k3| awk -F: '{if ($1 > 100) print $0}' 123:perpore:asdnassd:asdasd 128:popas:rera:fosa manuel@lapanda:~/tmp$ cat gtthan.txt |sort -t: -k3| awk -F: '{if ($1 > 100) print $0}' >pp.txt manuel@lapanda:~/tmp$ cat pp.txt 123:perpore:asdnassd:asdasd 128:popas:rera:fosa % Cortar del final # cortar del inicio #!/bin/bash IMAGEN="$1" EXTENSION="${IMAGEN##*.}" images=pasdasd.jpg echo ${images##*.} echo ${images%.*} echo $images |rev I="cn=lisa,dc=example,dc=com" echo ${I##*=} echo ${I%%=*} ACTUAL=$(xrandr | grep current | cut -d "," -f 2) RenX=$(echo $ACTUAL | cut -d " " -f 2) RenY=$(echo $ACTUAL | cut -d " " -f 4) echo ${RenX} echo ${RenY} ====== Referencias ====== * https://www.linux.com/tutorials/all-about-curly-braces-bash/ * https://devhints.io/bash * https://www.linuxjournal.com/content/bash-brace-expansion * https://www.lifewire.com/test-linux-command-unix-command-4097166 * https://stackoverflow.com/questions/17048188/how-to-use-awk-sort-by-column-3 * https://linuxhint.com/bash_tr_command/ * https://stackoverflow.com/questions/13690461/using-cut-command-to-remove-multiple-columns * https://riptutorial.com/bash/example/31704/sort-by-keys