Tutorial 5 q15 Need help
Moderator: drgrussell
Tutorial 5 q15 Need help
the question states Create a directory called smallc in /home/demo. Copy into it all the file that begin with s from /usr/include that are smaller or equal to 12K. You may find these instructions on the use of find from Developer's Daily useful.
I have tried the following commands but am still failing.
find /usr/include -name 's*' -size -12k -size 12 -exec cp {} /home/demo/smallc/ \;
and
find /usr/include -name 's*' -size -12k -size 12 -exec > {} /home/demo/smallc/ \
I can't figure it out at this point. Any suggestion will help
Regards,
Munir Olorunoje
I have tried the following commands but am still failing.
find /usr/include -name 's*' -size -12k -size 12 -exec cp {} /home/demo/smallc/ \;
and
find /usr/include -name 's*' -size -12k -size 12 -exec > {} /home/demo/smallc/ \
I can't figure it out at this point. Any suggestion will help
Regards,
Munir Olorunoje
-
- Site Admin
- Posts: 426
- Joined: Sat Feb 12, 2005 8:57 pm
- Are you a robot or a human?: Human
Re: Tutorial 5 q15 Need help
you have 2 different "-size" parameters in each find.
Personally I would do "-size -12k".
Additionally make sure you empty the smallc directory each time you try something new.
Personally I would do "-size -12k".
Additionally make sure you empty the smallc directory each time you try something new.
Re: Tutorial 5 q15 Need help
I will to thank you for replying my post. I tried the -12k it still failed the questions states smaller or equal to 12k. The -size -12k option give the result smaller than 12k.
Regards,
moolorun
Regards,
moolorun
-
- Site Admin
- Posts: 426
- Joined: Sat Feb 12, 2005 8:57 pm
- Are you a robot or a human?: Human
Re: Tutorial 5 q15 Need help
The question was originally written for units in blocks.
So -12k is -24. Less than or equal to is thus -25.
Try "-size -25"
But I think you are using >, and you should use cp in the exec.
So -12k is -24. Less than or equal to is thus -25.
Try "-size -25"
But I think you are using >, and you should use cp in the exec.
Re: Tutorial 5 q15 Need help
It worked thanks men I wouldn't have figured it out.
Thanks
moolorun
Thanks
moolorun
Re: Tutorial 5 q15 Need help
Thanks to your posting and the reply with the solution sent to you, I had finally been able to solve that same problem from the tutorial 5 question 15. Up until recently I had no idea that such thing as an -exec {} command even existed even though I have been browsing and reading as much information as my time allows and never came across this new creature.
Thanks for posting and helping me with this problem even tough it was perhaps not your intention.
I am okay now
Thanks for posting and helping me with this problem even tough it was perhaps not your intention.
I am okay now

Re: Tutorial 5 q15 Need help
I am sorry but my system somehow deleted my commands history and I couldn't get the whole syntax of the command needed for the tutorial 5 question 15. What I was able to copy is:
find /usr/include -name 's*' -size -25 -exec cp {} /home/demo/smallc \;
I believe I am missing something because when I run it again it won't work. Do you mind me asking to type the whole command so I can copy it and learn as much as I can from it?
I would really appreciate it.
find /usr/include -name 's*' -size -25 -exec cp {} /home/demo/smallc \;
I believe I am missing something because when I run it again it won't work. Do you mind me asking to type the whole command so I can copy it and learn as much as I can from it?
I would really appreciate it.

-
- Site Admin
- Posts: 426
- Joined: Sat Feb 12, 2005 8:57 pm
- Are you a robot or a human?: Human
Re: Tutorial 5 q15 Need help
Probably your smallc directory has been deleted too.
Who is online
Users browsing this forum: No registered users and 1 guest