When the file capacity is percent_val
and a specific capacity criterion is limit
, the command to find and output all files whose percent_val
is limit
or higher is
find ./* -size "$percent_val" >= "$limit"
Is this right?
And is the code below the command to delete the file with a specific capacity or more found capacity?
find ./* -size "$percent_val" >= "$limit" -type f -ls -exec rm -rf {} \;
Outputs a list of files from 100 mega to 200 mega from all directories in the workspace
find workspace -type f -size +100M -200M -exec ls -lh {} \;
Delete the above list files
find workspace -type f -size +100M -200M -exec rm -f {} \;
© 2024 OneMinuteCode. All rights reserved.