Posts

Showing posts with the label shell

Two links

I got this from a couple of tweets of my friend Maykel Moya ( http://twitter.com/maykelmoya ): ack is a tool like grep, aimed at programmers with large trees of heterogeneous source code. ack is written purely in Perl, and takes advantage of the power of Perl's regular expressions. http://betterthangrep.com/ Are two different references to the same integer value the same object? The answer: sometimes. Python gotcha: Bizarre integer equality

Top ten de mi .bash_history

Siguiendo algo que vengo viendo en varios weblogs aquí esta la lista de los 10 más ejecutados según mi ~/.bash_history : juliocarlos@bristol:~$ history | awk '{print $2}' | sort | uniq -c | sort -rn | head 83 ll 78 cd 56 git 49 sudo 21 ssh 19 rm 14 mv 13 python 13 mplayer 12 cat juliocarlos@bristol:~$ El comando ll se refiere a un alias a ls -l . Yasser en su entrada Shell history meme también muestra los 10 suyos.

Comando 'cp' con porciento

Image
Anoche mientras leía el Debian Planet encontré esta función en BASH que provee nuestra consola de un comando para copiar ficheros mostrando el avance del proceso como lo hace el WGET . Aquí está la función: cp_p() { set -e strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \ | awk '{ count += $NF if (count % 10 == 0) { percent = count / total_size * 100 printf "%3d%% [", percent for (i=0;i " for (i=percent;i Solo tienen que copiarla en su ~/.bashrc ó en /etc/bash.bashrc y para copiar usar cp_p <fuente> <destino> y verán algo como esto: Esta es la entrada donde encontré la función: "Can you get cp to give a progress bar like wget?"