Article

maggot62's picture

Uniformity Across Your Linux Platform

Author Info

14 January 2009 - 12:42pm
Submitted by: maggot62

article
Reads:

1246

Score:
0
0
 
Comments:

0

It has been traditional within SUSE that service scripts are activated with a symbolic link usually in /usr/sbin. So that to start the sshd service you can issue the command rcsshd start as root from anywhere as the /usr/sbin directory is in the search path. Of course you also would be able to use the syntax /etc/init.d/sshd start , but this has always been a little long winded ;(

Moreover, these symlinks are not available in RedHat or CENTOS. They have the standard command: service . The problem with the command service is that you have to know the service name. You cannot use tab completion. So let's fix that!

 complete -W "$(ls /etc/init.d/)" service 
  • complete : the command complete sets up tab completion
  • -W : this option creates a word list for completion
  • "$(ls /etc/init.d/)" : out word list is made up of the output of the command ls /etc/init.d/
  • service : this then sets up the configured completion for the command service

Test and enjoy!

If you want this all the time add it to your ~/.bashrc


Author Info

14 January 2009 - 12:42pm
Submitted by: maggot62




User Comments

© 2009 Novell, Inc. All Rights Reserved.