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
 


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.
 
Moving this to Command Line.

Welcome, @Weasle

Chris Turner
wizardfromoz
 
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 :)
 

Members online


Latest posts

Top