LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Chkconfig output (https://www.linuxquestions.org/questions/linux-newbie-8/chkconfig-output-774092/)

wjs1990 12-07-2009 07:35 PM

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

jhwilliams 12-07-2009 08:06 PM

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/'


All times are GMT -5. The time now is 06:42 AM.