I would like to know how to change the name of a txt file inside a directory.
I know that I can mv test123 test456
, but that only changes the name in the current directory. What if I want to change the name of a txt file inside /home/folder1/
?
#!/bin/bash ls *.txt > Scripttextfil1.txt mkdir modul2 cp Scripttextfil1.txt modul2 mv modul2/Scripttextfil1.txt nyttextfil.txt cp nyttextfil.txt modul2 rm nyttextfil.txt
but this is not "clean scripting" i need to just change the file name without having to copy more or remove more documents.. i hope u understand
– TraumCro Jun 21 '16 at 14:23mv modul2/scripttextfil1.txt modul2/nyttextfil.txt
. Make sure you get spelling and capitalization right. – anonymous2 Jun 21 '16 at 14:25find
command:sudo find ~/ -name *.txt
– anonymous2 Jun 21 '16 at 14:30ls *.txt
. – anonymous2 Jun 21 '16 at 14:31