Listing UIDs of data in a directory ?

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

Listing UIDs of data in a directory ?

Postby vmunich » May 20th, '19, 15:54

Hi everyone,

Due to me doing a clean install of Mageia and using backintime to backup/restore users' data, I am not sure that the many files I restored have the right UID.

(since userA on my old system had uid=1003 and the newly created userA on the new system may have uid=1002)

I know I could do a search for data having a certain uid:

Code: Select all
find /directory_to_be_search -uid 1002


but what I really want is to find out which UIDs are allocated in data of a given directory ("directory /directory_to_be_search contains data with UID 1002, 1005, 1008")

Any hint ?

Thank you
Vincent
Vincent
--
Mandrake since 1998, then Mandriva, then Mageia....
vmunich
 
Posts: 53
Joined: Jan 11th, '13, 12:35

Re: Listing UIDs of data in a directory ?

Postby alf » May 20th, '19, 19:20

vmunich wrote:Any hint ?

Code: Select all
ls -n
for windows problems reboot; for linux problems be root
alf
 
Posts: 326
Joined: Apr 1st, '11, 23:07
Location: DE Paderborn

Re: Listing UIDs of data in a directory ?

Postby doktor5000 » May 20th, '19, 23:47

That's not really possible, at least not with find, as it can either search for arbitrary UID numbers, or the other way around it can search for files that are not owned by a user via -nouser.

What you could do is search for everything that is not owned by your user / group, which should also achieve what you want.
E.g. if your user/group would be called vmunich
Code: Select all
find /directory_to_be_searched \( ! -user vmunich -o ! -group vmunich \) -ls
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest