LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-07-2009, 08:35 PM   #1
wjs1990
Member
 
Registered: Nov 2009
Posts: 30

Rep: Reputation: 15
Chkconfig output


Hi all,
For example, when i type the command "chkconfig --list xfs". I will get the result " xfs 0: off ... 3: on 4: on 5: on 6: off".
But what if i only want to see whether runlevel "3" and "5" is on or off? So what command can i actually use to grep that particular output? Thanks!

Regards
JS W
 
Old 12-07-2009, 09:06 PM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 210Reputation: 210Reputation: 210
A more concise approach notwithstanding, the below will work

To see only 5:

Code:
chkconfig --list xfs | sed 's/.*5\: \([ofn]* \).*/\1/'
To see only 3:
Code:
chkconfig --list xfs | sed 's/.*3\: \([ofn]* \).*/\1/'
 
  


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
Why do I get "bash: chkconfig: command not found" when I try to run chkconfig? non-thrash Fedora 10 05-20-2010 01:31 PM
chkconfig not working??? abefroman Linux - Server 6 12-22-2008 02:30 PM
chkconfig ?? vonedaddy Linux - Newbie 2 11-08-2007 12:44 AM
chkconfig ?? jchin Linux - Newbie 4 10-16-2003 02:59 AM
Help on chkconfig ztopher Linux - Software 0 04-09-2003 04:29 AM


All times are GMT -5. The time now is 04:46 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