Skip to content

Instantly share code, notes, and snippets.

@amalrik
Created March 26, 2012 21:39
Show Gist options
  • Save amalrik/2209954 to your computer and use it in GitHub Desktop.
Save amalrik/2209954 to your computer and use it in GitHub Desktop.
adicionar um prefixo a todos arquivos de um mesmo padrão de um diretorio e todos os subdiretorios
PREFIX=xyz;
while read line
do
path="$(dirname $line)"
base="$(basename $line)";
mv "${line}" "$path/${PREFIX}${base}"
done < <(find dir1 -name "*.c")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment