Linux / Unix stuff

City Melbourne Australia

Just some occasional unix / linux CLI related notes

To add a .txt to the end of a number of files in a directory

for f in * ; do mv “$f” “$f.txt” ; done

To delete every file in a directory that does not end in .txt

sudo find . -type f ! -name ‘*.txt’ -delete

Bookmark the permalink.

Comments are closed.