- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: grep problem
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-06-2009 02:34 PM
тАО07-06-2009 02:34 PM
here is what i have got and what i want if anyone can help me with this.
i just want all the files which has stdlist name in the current server and i dont care where they have linked to
like i want this
stdlist -> /tlglogs/twsprd82/stdlist
but i dont want this
BLBESLBENREXT_B04022008010078_IND_20080207_231710.log -> /usr/local/TWS/stdlist
you can see stdlist is in the link so its also giving me in the output but i dont want it
this is what i have got
ll|grep stdlist
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBEADJEXT_B04022008010078_IND_20080207_231710.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O10899.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBEBILLEXT_B04022008010078_IND_20080207_231710.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O10933.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBEBLMSGEXT_B04022008010078_IND_20080207_231710.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O10946.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBEBLSTEXT_B04022008010078_IND_20080207_231731.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O13927.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBEBSUBEXT_B04022008010078_IND_20080207_231711.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O10965.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBECANCTNEXT_B04022008010078_IND_20080207_231710.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O10858.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBECAUEXT_B04022008010078_IND_20080207_231711.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O10983.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBECHGEXT_B04022008010078_IND_20080207_231710.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O10915.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBECUSGEXT_B04022008010078_IND_20080207_231711.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O11002.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBEEQPEXT_B04022008010078_IND_20080207_231711.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O11056.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBEINCFTREXT_B04022008010078_IND_20080207_231711.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O11038.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBEIPEXT_B04022008010078_IND_20080207_231711.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O11137.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBEIPUSGEXT_B04022008010078_IND_20080207_231711.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O11095.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBEMPEXT_B04022008010078_IND_20080207_231710.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O10878.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBEPIEXT_B04022008010078_IND_20080207_231710.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O10884.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBEPYMEXT_B04022008010078_IND_20080207_231711.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O11022.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBEREEXT_B04022008010078_IND_20080207_231710.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O10867.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBEROLLEXT_B04022008010078_IND_20080207_231711.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O11176.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBESHRGRPEXT_B04022008010078_IND_20080207_231711.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O11251.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBESITINVEXT_B04022008010078_IND_20080207_231711.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O11084.2317
lrwxrwxr-x 1 twsprd82 oper 54 Feb 7 2008 BLBESLBENREXT_B04022008010078_IND_20080207_231710.log -> /usr/local/TWS/TWSREJ82/stdlist/2008.02.07/O10853.2317
lrwxrwxr-x 1 twsprd82 oper 25 Apr 10 2007 stdlist -> /tlglogs/twsprd82/stdlist
can anybody help me how can i just grep the first part where stdlist is there not in the link part
Thanks in advance
Solved! Go to Solution.
- Tags:
- grep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2009 02:44 PM
тАО07-06-2009 02:44 PM
Re: grep problem
>>>>ll|grep stdlist
Correct me, Is this you want:
ll |grep stdlist |grep -v "^l"
hth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2009 04:18 PM
тАО07-06-2009 04:18 PM
Re: grep problem
Instead of using 'grep' you could use 'awk' to match only the firat field:
# ls -al|awk '$9~/stdlist/ {print}'
...matches the nineth field and if it matches "stdlist" the whole line is printed.
Regards!
...JRF...
- Tags:
- awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2009 06:54 AM
тАО07-07-2009 06:54 AM
Re: grep problem
ll|grep stdlist|grep -v "^"
it prints nothing
James,
that works when I try that in the local server but when I do in remote server got some error
awk: Quitting
The source line is 1.
uid=388(gc1488) gid=20(users)
syntax error The source line is 1.
The error context is
>>> ~ <<<
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2009 07:04 AM
тАО07-07-2009 07:04 AM
Re: grep problem
>>>Nido, thats not giving me any output I dont know why,
ll|grep stdlist|grep -v "^"
it prints nothing <<<<
You have missed the "l" after "^". Correct syntax is,
# ll|grep stdlist|grep -v ^l
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2009 07:04 AM
тАО07-07-2009 07:04 AM
Re: grep problem
Try to use grep -i option.
Regards
Sunny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2009 07:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2009 08:36 AM
тАО07-07-2009 08:36 AM
Re: grep problem
yeah that did work
Thanks alot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2009 08:36 AM
тАО07-07-2009 08:36 AM
Re: grep problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2009 08:43 AM
тАО07-07-2009 08:43 AM
Re: grep problem
Simply use a better regexp:
ll -a | grep "stdlist.*->"
- Tags:
- regex