Bash script to append a .txt extension to a filename

for i in *.log*; do mv "$i" "$i.txt"; done
 

Download this snippet

Iterate over the current directory, get all files with .log and append .txt to the end of the entire filename:

Twitter Twitter

0 Comments to “ Bash script to append a .txt extension to a filename”

Leave a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>