1834425 Members
1937 Online
110067 Solutions
New Discussion

Re: grep in sub-dirs

 
SOLVED
Go to solution
panchpan
Regular Advisor

grep in sub-dirs

Hello.
1) Do we have some option with grep command so that we could search in current directory and all its sub-directories/files?

2) How to find out the ownername of a filesystem on HP-UX?
3) Do we need to delete and recreate filesystem IF I want to change the allocated space or owner?

Thank you!
4 REPLIES 4
Pete Randall
Outstanding Contributor
Solution

Re: grep in sub-dirs

1) Use find: find /start_dir -exec grep -l "string" {} \;

2) Use ll with the -d option: ll -d /mountpoint

3) Unless you have online jfs, changes to size would require re-creation. Changes in ownership can be accomplished using "chmod".


Pete

Pete
Peter Godron
Honored Contributor

Re: grep in sub-dirs

Hi,
1. combine grep with find
find . -exec grep -name *.lis {} \;
Can be resource/process hungry.

2. Directories, but not file systems have owners.
ll (3rd colum indicates owner of file/directory)

3. Use SAM to extend filesystem.
Look under "Disks and FileSystems"
Peter Godron
Honored Contributor

Re: grep in sub-dirs

Hi,
1. combine grep with find
find . -exec grep -name *.lis {} \;
Can be resource/process hungry.

2. Directories, but not file systems have owners.
ll (3rd colum indicates owner of file/directory)

3. Use SAM to extend filesystem.
Look under "Disks and FileSystems"

But, no, you do not have to delete filesystems to expand. To change the ownership you can use chmod.
See "man chmod" for details.
panchpan
Regular Advisor

Re: grep in sub-dirs

THANKS