[SOLVED] what does paths must precede expression means?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
sorry mate still it doesn't work. It still gives the same error. I know if I use grep it would certainly work but I do want to use -not clause only. I believe in innovation rather than repetition.
Did you check manual of find (see here)? As per this manual:
Code:
! expr
True if expr is false. This character will also usually need protection from interpretation by the shell.
-not expr
Same as ! expr, but not POSIX compliant.
So either try:
Code:
~$ find . -type f -mmin +10 -print | grep SS
OR
Code:
~$ find . -type f -mmin +10 -not "crapfiles*" | grep SS
"crapfiles*" is not preceded by "-name" as I think you intended. Because of this find is interpreting it as a pathname (to be considered along with ".") and should have come at the beginning of the arguments.
@shivaa basename can only work for a single file? i am having here multiple files but more than anything else if find has an inbuilt function why not to harness that?
Guys,
I am very close but still not that close
I have got all what I want except file's full path
I am doing a "cd" to a particular directory and then running a particular "find" command which is as follows:
Here i am getting the desired output but not getting the base directory where I did "cd" is there any quick and easy way to get that? else I am thinking of a for loop.
Please advise.
Last edited by sysmicuser; 04-22-2013 at 10:43 PM.
Reason: Update
It appears you're right... I did a quick(!) look through the man page, but missed that
In my defence, its a long page.
Mind you, I can't remember the last time I tried to get that anyway
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.