User Tools

Site Tools


linux:files:create_random_filenames

Linux - Files - Create random filenames

!/bin/bash
# Randomize filenames
 
for fname in *.jpg;
do
  mv "$fname" $(echo "$fname" | \
    sha1sum | \
    cut -f1 -d ' ' | \
    cut -b 1-5).jpg
done

returns:

08df4.jpg  
1e788.jpg  
315e6.jpg  
41e19.jpg  
5f7d0.jpg  
7471e.jpg
linux/files/create_random_filenames.txt · Last modified: 2023/07/17 17:42 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki