Find Linux specific capacity files

Asked 2 years ago, Updated 2 years ago, 31 views

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 {} \;

linux

2022-09-20 20:00

1 Answers

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 {} \;


2022-09-20 20:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.