Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Shell/Bash
bash remove random files from directory
jwodder
Programming language:
Shell/Bash
2021-06-13 23:34:32
0
Q:
bash remove random files from directory
Charlie Lam
Code:
Shell/Bash
2021-03-05 13:04:16
find /path/to/dir -type f -print0 | sort -zR | tail -zn +1001 | xargs -0 rm
0
Tags
file
files
remove
random
Related
bash unzip all files
bash how to delete a specific line from a file
bash remove directory
bash remove duplicate lines from a file
bash remove rows that are found in another file
bash move a list of files
bash delete folder
bash unsquash specific files
bash delete all files of type recursively
bash delete a range of lines from a file
randomly choose n rows from a file linux
bash how to copy or move all files in a list
bash ls exclude substring
delete all files with specific name ubuntu
New to Communities?
Join the community