LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-07-2015, 05:28 PM   #1
Altiris
Member
 
Registered: Mar 2013
Posts: 556

Rep: Reputation: Disabled
/etc/rc.d and cd /etc/rc.d show different files


Alright so I am new to Slackware and for this portion, I am not going to lie and I did not look around too much to try and solve, mostly because I found something else very interesting/confusing.

So besides me doing "su -" and trying to start /etc/rc.d/rc.postfix I noticed that if I type "/etc/rc.d/ and then press tab to show all files I only get"
Code:
init.d/             rc.httpd            rc.syslog
rc.0                rc.inet1            rc.sysvinit
rc.4                rc.inet2            rc.udev
rc.6                rc.inetd            rc.ulogd
rc.K                rc.local            rc.wireless
rc.M                rc.loop             rc0.d/
rc.S                rc.mcelog           rc1.d/
rc.acpid            rc.messagebus       rc2.d/
rc.alsa             rc.modules          rc3.d/
rc.bind             rc.modules-3.10.17  rc4.d/
rc.consolekit       rc.mysqld           rc5.d/
rc.dovecot          rc.ntpd             rc6.d/
rc.fuse             rc.samba            
rc.gpm              rc.sshd
However if I type "cd /etc/rc.d/ and press tab" I get a lot more files....why is this?
Code:
init.d/             rc.gpm              rc.samba
rc.0                rc.httpd            rc.saslauthd
rc.4                rc.inet1            rc.sendmail
rc.6                rc.inet1.conf       rc.serial
rc.K                rc.inet2            rc.snmpd
rc.M                rc.inetd            rc.sshd
rc.S                rc.ip_forward       rc.syslog
rc.acpid            rc.local            rc.sysstat
rc.alsa             rc.loop             rc.sysvinit
rc.alsa-oss         rc.mcelog           rc.udev
rc.atalk            rc.messagebus       rc.ulogd
rc.autofs           rc.modules          rc.wireless
rc.bind             rc.modules-3.10.17  rc.wireless.conf
rc.bluetooth        rc.mysqld           rc.yp
rc.cgconfig         rc.networkmanager   rc0.d/
rc.cgred            rc.nfsd             rc1.d/
rc.consolekit       rc.ntpd             rc2.d/
rc.cups             rc.pcmcia           rc3.d/
rc.dnsmasq          rc.php-fpm          rc4.d/
rc.dovecot          rc.postfix          rc5.d/
rc.font             rc.postfix.new      rc6.d/
rc.fuse             rc.rpc

Last edited by Altiris; 06-07-2015 at 05:30 PM.
 
Old 06-07-2015, 05:49 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,334

Rep: Reputation: Disabled
If you start typing a command, which is what you do when you type /etc/rc.d/, tab completion will list all executable files and subdirectories. Non-executable files can't possibly be used as commands, and are therefore not shown.

However, if you've already typed a command (for instance, cd) and then use tab completion on a parameter to that command, all available files and directories are listed. bash makes no attempt to figure out what the command you've typed actually does, so when it comes to parameters, it will simply list any file matching what you've typed so far.
 
Old 06-07-2015, 06:25 PM   #3
Altiris
Member
 
Registered: Mar 2013
Posts: 556

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Ser Olmy View Post
If you start typing a command, which is what you do when you type /etc/rc.d/, tab completion will list all executable files and subdirectories. Non-executable files can't possibly be used as commands, and are therefore not shown.

However, if you've already typed a command (for instance, cd) and then use tab completion on a parameter to that command, all available files and directories are listed. bash makes no attempt to figure out what the command you've typed actually does, so when it comes to parameters, it will simply list any file matching what you've typed so far.
Ahh I see, did not think of that. Thanks!
 
Old 06-07-2015, 06:34 PM   #4
genss
Member
 
Registered: Nov 2013
Posts: 741

Rep: Reputation: Disabled
it would be nice if cd didn't let you cd into a file
cd /dir/[TAB] to list files would still be good
 
Old 06-08-2015, 01:10 AM   #5
lems
Member
 
Registered: May 2004
Distribution: BSD
Posts: 269

Rep: Reputation: 119Reputation: 119
extra/bash-completion? Should let you configure bash so that cd only `cds' into a directory.
With tcsh (which I use) it's `complete cd p/1/d/' in your ~./.tcshrc. (Just for reference.)
 
  


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
Permission denied /var/lib/postfix/master.lock error landysaccount Linux - Newbie 4 01-26-2013 01:29 PM
file permission denied, install postfix aw_wolfe Linux - Newbie 7 07-13-2011 07:27 AM
/etc/init.d/apache2 start ---> permission denied david008 Linux - Newbie 4 11-12-2008 11:13 AM
postfix mailbox permission denied hua Linux - Enterprise 3 11-14-2006 09:05 AM
Postfix-MySQL-Courier IMAP - Permission denied abapdr Linux - Software 0 06-24-2004 03:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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