Locating files!


 
Thread Tools Search this Thread
Operating Systems Solaris Locating files!
# 1  
Old 04-29-2013
Locating files!

My question is :
-How do I locate files of specific user in specific folder.
In other words, How do I find files that belong only to "root" user, in /etc folder?
# 2  
Old 04-29-2013
Quote:
Originally Posted by alexex666
My question is :
-How do I locate files of specific user in specific folder.
In other words, How do I find files that belong only to "root" user, in /etc folder?
Code:
find /etc/ -user root 2>/dev/null

Note: Use /usr/xpg4/bin/find
This User Gave Thanks to verdepollo For This Post:
# 3  
Old 04-29-2013
Quote:
Originally Posted by verdepollo
Code:
find /etc/ -user root 2>/dev/null

Note: Use /usr/xpg4/bin/find
Thanks ALOT!

whats does 2>/dev/null do or mean?
# 4  
Old 04-29-2013
Quote:
Originally Posted by alexex666
whats does 2>/dev/null do or mean?
It tells the shell to redirect all error messages (if any) into the void (/dev/null).
This User Gave Thanks to verdepollo For This Post:
# 5  
Old 04-29-2013
Why /usr/xpg4/bin/find ?
IMHO it only differs from /bin/find in the interpretation of -name '*' and is not relevant here.
# 6  
Old 04-30-2013
Quote:
Originally Posted by MadeInGermany
Why /usr/xpg4/bin/find ?
Just the habit I guess. More than once I've seen a Solaris script fail because the default binary doesn't work the same as the one under non-standard directories.

Nothing against Solaris, though; just how it makes a mess of binaries in /usr/bin, /usr/css/bin, /usr/xpg6/bin, /usr/xpg4/bin, etc.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Locating all the scripts which start with:#!

Hi, I need to find all the executable shell scripts under /home dirctory and its sub directories. I would like to print the path to the files , which include in the header of the file: #! (Actually its the first line of the file). I have tried : find . -name "*" -type f -exec sh -c ' ... (14 Replies)
Discussion started by: Yoav
14 Replies

2. UNIX for Dummies Questions & Answers

Locating shell script files with the $PATH variable

I've created a test script, which is located in $HOME/bin. The script runs as expected with no issues. However, upon echo'ing the $path variable the location of my script is not located in any of the directories listed in $path. So my question is, how does shell know where the script is located... (2 Replies)
Discussion started by: BrandonD
2 Replies

3. Shell Programming and Scripting

Script to locating Linux servers

All, Need an urgent help! , I have an simple text file that holding more than 500 IP Address, My requirement : bash script that will run from my central server , and will scan with nmap all the 500 ip address , for ssh port with . for example with the command : nmap -sT | grep '22.*open' ... (1 Reply)
Discussion started by: James Stone
1 Replies

4. UNIX for Dummies Questions & Answers

Locating a hidden file

it seems one of my server's account was compromised. I caught a perl script running a hack/attack script: 20:23 /usr/bin/perl ./up **.**.**.** 0 120 I've disabled the user etc, but I cannot find the script "up" anywhere in the server. I tried using locate or find. any ideas? (1 Reply)
Discussion started by: MaRiOsGR
1 Replies

5. Shell Programming and Scripting

Help in locating a word in huge files

hi i receive about 5000 files per day in my system. Each of them are like: cat ABC.april24.dat ABH00001990 01993 409009092 0909 INI iop 9033 AAB0000237893784 8430900 898383 AUS 34349089008 849843 9474822 AAA00003849893498098394 84834 348348439 -438939 IN AAA00004438493893849384... (2 Replies)
Discussion started by: Prateek007
2 Replies

6. Ubuntu

Help with locating a file (to download)

debian_base_system.tar.bz2 is what I am looking for. Hello All; I am trying to learn Linux and have done some work, now I am installing Xen virtual machine But I need a .tar.bz2 file which is the base Operating System (for Ubuntu or Debian)* but I do not know where to download it from, the... (2 Replies)
Discussion started by: Matey
2 Replies

7. Shell Programming and Scripting

Dynamically locating a file

Hi, I have a requriement where in I need to install a s/w by executing the installable file through a script. The script currently contains the path of the installable file. I need to now update the script accordingly such tht it identifies the location of the installable file automatically and... (1 Reply)
Discussion started by: yoursdavinder
1 Replies

8. UNIX for Dummies Questions & Answers

locating the last file in the directory

i have few files in a directory.. i want to know , how to locate or display that last file in the directory which has the max date.. pls help (2 Replies)
Discussion started by: wip_vasikaran
2 Replies

9. UNIX for Dummies Questions & Answers

Locating C source code

Hi, I'm trying to locate where on the filesystem I can find the source code for C standard libraries. The reason why is I'd like to look at the implementation of "'atoi"'. I've tried a brutal search of "grep -r "atoi" *" from root as root but the search took too long. I'm running redhat 7.3... (3 Replies)
Discussion started by: chadwick0
3 Replies

10. Filesystems, Disks and Memory

Locating files and directing ouput

I'm trying to locate all files that do not contain the string /usr but do contain the string csh within the file called /etc/passwd. Then I would like to direct this output to a file called pout. Does anyone one have suggestions on this one? Thanks (2 Replies)
Discussion started by: klannon
2 Replies
Login or Register to Ask a Question