Search command e or E, a root owner owns the files, no errors on display command

Weasle

New Member
Joined
Dec 18, 2022
Messages
4
Reaction score
2
Credits
42
1 Hello, i'm trying to write a command to search for all files on the system that start with e or E, owned by root, without displaying errors.
2 the same command as above but by all root users, no errors at display

sudo find -user root {e..E} 2>/dev/null
Find / -iname ls root {e..E} 2> /dev/null

find /etc -name passwd
 


osprey

Well-Known Member
Joined
Apr 15, 2022
Messages
684
Reaction score
568
Credits
6,379
This command may do what you ask:
Code:
find / -user root -name "e*" -o -user root -name "E*" 2>/dev/null
but what would be the point of running it? It has a massive output which hunts through the /proc directory as well which is virtual and tells you little of the operating system's installed filesystem.

If this is about learning how the find command works, it is far better to create a directory with subdirectories, all with files of various names and types so that one can then use the find command with its various options to find and manipulate relevant groups of files and quickly check that the find command used has produced the intended result.
 

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
8,628
Reaction score
7,587
Credits
35,291
Moving this to Command Line.

Welcome, @Weasle

Chris Turner
wizardfromoz
 
OP
W

Weasle

New Member
Joined
Dec 18, 2022
Messages
4
Reaction score
2
Credits
42
Thank you for your reply. Once a week to master things faster am inscribed also in a centre for evening adult education . This was part of the assignment but for this part there is no teacher help. Completely agreed about your opinion about the command itself irl and to start with as a starter. searches in books and course not so clear, so thx for answering it :)
 
MALIBAL Linux Laptops

Linux Laptops Custom Built for You
MALIBAL is an innovative computer manufacturer that produces high-performance, custom laptops for Linux.

For more info, visit: https://www.malibal.com

Members online


Latest posts

Top