From dac108912794add7f4db53b52908c6b881eb4a38 Mon Sep 17 00:00:00 2001 From: inference Date: Sat, 1 Oct 2022 01:33:41 +0100 Subject: [PATCH] Add file rename UUID script. --- file-rename-uuid.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 file-rename-uuid.sh diff --git a/file-rename-uuid.sh b/file-rename-uuid.sh new file mode 100644 index 0000000..fc7f594 --- /dev/null +++ b/file-rename-uuid.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# Copyright 2022 Inference + +# 0.0.0.0 + + +# Rename all files in current directory to UUIDs. +for FILE in * +do + if [ -f "$FILE" ];then + ID=`uuidgen` + EXTENSION=${FILE#*.} + mv -v "$FILE" "$ID"."$EXTENSION" + fi +done