LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-05-2011, 06:21 AM   #1
mahendra singh
LQ Newbie
 
Registered: Mar 2011
Location: Bangalore,INDIA
Posts: 12
Blog Entries: 1

Rep: Reputation: 0
grep root directory


Dear All,

Want to grep pattern of root dir. (/)
staying in current directory.But i dont want to use the below code:

cd /
grep m *

Thanks in advance
Mahendra Singh
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-05-2011, 06:29 AM   #2
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 103Reputation: 103
grep option expression /


This can be done from your current working directory.
 
2 members found this post helpful.
Old 03-06-2011, 08:35 AM   #3
mahendra singh
LQ Newbie
 
Registered: Mar 2011
Location: Bangalore,INDIA
Posts: 12
Blog Entries: 1

Original Poster
Rep: Reputation: 0
Smile grep root dir.

Thanks a lot it works
 
Old 03-06-2011, 08:51 AM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,768
Blog Entries: 27

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Hi,

Welcome to LQ!

Quote:
Originally Posted by mahendra singh View Post
Dear All,

Want to grep pattern of root dir. (/)
staying in current directory.But i dont want to use the below code:

cd /
grep m *

Thanks in advance
Mahendra Singh
You are aware of the 'man' pages? 'man grep' will get you definitions & options for the command.
You can get 'man command' locally or online.

Just a few links to aid you to gaining some understanding;



1
Linux Documentation Project
2
Rute Tutorial & Exposition
3
Linux Command Guide
4
Bash Beginners Guide
5
Bash Reference Manual
6
Advanced Bash-Scripting Guide
7
Linux Newbie Admin Guide
8
LinuxSelfHelp
9
Utimate Linux Newbie Guide
10
Linux Home Networking

The above links and others can be found at '
Slackware-Links'. More than just SlackwareŽ links!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to configure 'grep' to ignore 'No such file or directory n179911 Linux - Newbie 4 07-08-2009 04:14 AM
grep a directory with date order ust Linux - Newbie 4 02-16-2009 02:17 AM
problem with grep in root directory river_jetties Linux - Software 3 01-22-2007 01:10 PM
how to grep a specifc directory irfanhab Linux - General 3 12-19-2005 08:44 PM
ps -ef|grep -v root|grep apache<<result maelstrombob Linux - Newbie 1 09-24-2003 11:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration