1

I'm trying to write a scenario which will input a number and then find all the files which size if bigger than this number.

So far I've got this:

read $size
find . -size "+{$size}c"

The above code doesn't work. What should I do instead?

2 Answers 2

2

You should be doing ${size}c

Sign up to request clarification or add additional context in comments.

Comments

1

You can do something like this to find files bigger than your number in the variable -

find . -size +"${size}"c 

You can also do something like this -

awk -v mysize="$size" '{if ($5>=mysize) print $9}' <(ls -l)

You can modify ls -l to provide path of a particular folder and add more options to doing search recursively.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.