3

when I try this command I'm getting the right path

find /home/*/*/*/*.log

result is

 /home/blross23/karthi/mmw/sample.log

But When I try this command

find /home/*/*/*/*.log -mtime +1  -type f -size +2  -printf "%s %h%f\n"

The result I'm getting is

7950 /home/blross23/karthi/mmwsample.log

where at the end of the path "/" (mmwsample.log )is missing between the two directories

correct path is /..../mmw/sample.log What I'm getting is /..../mmwsample.log

What's the error in the command ???

0

1 Answer 1

2

Conseider the format in your command:

find /home/*/*/*/*.log -mtime +1 -type f -size +2 -printf "%s %h%f\n"

You are specifically telling it to print those two values without a '/' between them. To correct it, try:

find /home/*/*/*/*.log -mtime +1 -type f -size +2 -printf "%s %h/%f\n"

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

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.