| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

mv

Page history last edited by PBworks 16 years, 11 months ago

mv

Movimenta ou renomeia arquivos e pastas do sistema

         mv origem destino

se destino for no mesmo diretório (e não existir) renomeia o arquivo ou pasta

Exemplo em Script

    
   for file in *; do
      mv $file $(echo $file | tr [:upper:] [:lower:])  2>/dev/null
   done

 

Movendo arquivos recurvamente

Para mover arquivos de subpastas para um nível acima ".."

find . -type f -exec mv {} .. \;

 

Trocando a extensão de arquivos

for i in $(find ~/tmp -iname *.xml);{
      mv $i ${i/.xml/.txt};

}

No caso acima estou trocando ".xml" por ".txt"

 

Referências

Comments (0)

You don't have permission to comment on this page.