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

(Visited 1 times, 1 visits today)
Tags:
Category: SUSE Linux Enterprise, SUSE Linux Enterprise Desktop, SUSE Linux Enterprise Server, Technical Solutions
This entry was posted Wednesday, 14 January, 2009 at 12:42 pm
You can follow any responses to this entry via RSS.

Leave a Reply

Your email address will not be published. Required fields are marked *

No comments yet