LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 07: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, 08:06 PM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
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



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 12:31 PM
chkconfig not working??? abefroman Linux - Server 6 12-22-2008 01:30 PM
chkconfig ?? vonedaddy Linux - Newbie 2 11-07-2007 11:44 PM
chkconfig ?? jchin Linux - Newbie 4 10-16-2003 01:59 AM
Help on chkconfig ztopher Linux - Software 0 04-09-2003 03:29 AM

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

All times are GMT -5. The time now is 01:39 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
Open Source Consulting | Domain Registration