- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ls -l with AWK/grep
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-03-2002 10:17 PM
тАО07-03-2002 10:17 PM
I'm wanting to obtain the list of files/directories within several filesystems, i.e traversing just 1 level into the paths of these filesystems, and getting only the files/directories belonging to a particular project group within these filesystems.
Could anyone help me on this matter? I tried doing:
df -k|grep wmt
which only list filesystems having wmt within the file name.
I also did :
ls -l|grep wmt
which also list filesystems having wmt within the file name.
I would like to list the names of the files within a filesystem belonging to the group owner "wmt", not files having "wmt" as its substring.
Could some one help me out?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-03-2002 10:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-03-2002 10:31 PM
тАО07-03-2002 10:31 PM
Re: ls -l with AWK/grep
You should use find :
# cd
# find . -type f -group wmt -exec ls -l {} \;
Fr??d??ric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-03-2002 10:42 PM
тАО07-03-2002 10:42 PM
Re: ls -l with AWK/grep
In addition, if you want to search within a filesystem :
# find . -type f -group wmt -xdev -exec ls -l {} \;
The xdev option will causes find to avoid crossing any file system mount points.
Fr??d??ric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-03-2002 11:19 PM
тАО07-03-2002 11:19 PM
Re: ls -l with AWK/grep
for i in `ls`
do
if [ -d $i ]; then
ls -l $i | awk '{if ( $3 ~ /owner/ ) {print}}'
fi
done
You can substitute the `ls` for a list of directories if you wish. The script as above will list all files owned by owner. If you used $4, it will list by group