bugfindutils - Bugs: bug #44732, -user flag gives different output...

 
 

bug #44732: -user flag gives different output with -exec ls and -ls

Submitted by:  DAndC <aravindvjn>
Submitted on:  Sun 05 Apr 2015 09:59:28 AM UTC  
 
Category: findSeverity: 3 - Normal
Item Group: Wrong resultStatus: Invalid
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Open/Closed: Closed
Release: NoneFixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 06 Apr 2015 06:55:20 PM UTC, comment #2:

Thank you for the reply. You are correct, I got the expected output with "-type f " .

[casper@localhost find_test]$ find $PWD -type f -not -user root -exec ls -l {} \;
-rw-r--r-- 1 casper users 0 Mar 27 18:34 /home/casper/find_test/test2
-rw-r--r-- 1 casper users 0 Mar 27 18:34 /home/casper/find_test/test1
-rw-r--r-- 1 casper users 0 Mar 27 18:34 /home/casper/find_test/test3
[casper@localhost find_test]$

DAndC <aravindvjn>
Sun 05 Apr 2015 02:12:52 PM UTC, comment #1:

Hello,

find does not only find files but also directories, therefore "find $PWD -not -user root -exec ls -l {} \;" inter alia runs this command

ls -l /home/casper/find_test

and will therefore list test1 and test2

cu Andreas

Andreas Metzler <ametzler>
Sun 05 Apr 2015 09:59:28 AM UTC, original submission:

Hi,

Thanking you for a nice tool called find . I met with some confusion when i tried to use find, Please advice on this.

Please find the list of files in find_test .

[casper@localhost find_test]$ ls -lrt
total 0
-rw-r--r-- 1 casper users 0 Mar 27 18:34 test1
-rw-r--r-- 1 casper users 0 Mar 27 18:34 test2
-rw-r--r-- 1 casper users 0 Mar 27 18:34 test3
-rw-r--r-- 1 root root 0 Mar 27 18:35 root_test1
-rw-r--r-- 1 root root 0 Mar 27 18:35 root_test2
[casper@localhost find_test]$

when i tried to execute the command,

"find $PWD -not -user root -exec ls -l {} \;"

It gave me an output as,

[casper@localhost find_test]$ find $PWD -not -user root -exec ls -l {} \;
total 0
-rw-r--r-- 1 root root 0 Mar 27 18:35 root_test1
-rw-r--r-- 1 root root 0 Mar 27 18:35 root_test2
-rw-r--r-- 1 casper users 0 Mar 27 18:34 test1
-rw-r--r-- 1 casper users 0 Mar 27 18:34 test2
-rw-r--r-- 1 casper users 0 Mar 27 18:34 test3
-rw-r--r-- 1 casper users 0 Mar 27 18:34 /home/casper/find_test/test2
-rw-r--r-- 1 casper users 0 Mar 27 18:34 /home/casper/find_test/test1
-rw-r--r-- 1 casper users 0 Mar 27 18:34 /home/casper/find_test/test3

which is not accurate , as i am expecting files that are not owned by root only.

but with the command, "find $PWD -not -user root -ls"

find gave me an output as,
[casper@localhost find_test]$ find $PWD -not -user root -ls
9182333 4 drwxr-xr-x 2 casper users 4096 Mar 27 18:35 /home/casper/find_test
8921411 0 -rw-r--r-- 1 casper users 0 Mar 27 18:34 /home/casper/find_test/test2
8918596 0 -rw-r--r-- 1 casper users 0 Mar 27 18:34 /home/casper/find_test/test1
8921412 0 -rw-r--r-- 1 casper users 0 Mar 27 18:34 /home/casper/find_test/test3

which looks good.

and my find version,
[casper@localhost find_test]$ find --version
find (GNU findutils) 4.4.2

about os,
[casper@localhost find_test]$ uname -a
Linux localhost 3.15.0-rc4-ARCH-00298-g9f1eb57 #1 SMP PREEMPT Fri May 23 01:56:57 IST 2014 x86_64 GNU/Linux

DAndC <aravindvjn>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jay (Updated the item)
  • -unavailable- added by aravindvjn (Submitted the item)
  • -unavailable- added by aravindvjn
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 23 Dec 2015 04:33:46 PM UTCjayStatusNone=>Invalid
      Assigned toNone=>jay
      Open/ClosedOpen=>Closed
    Sun 05 Apr 2015 09:59:28 AM UTCaravindvjnCarbon-Copy-=>Added aravindvjn

    Back to the top


    Powered by Savane 3.1-cleanup1