LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   What are these files? (https://www.linuxquestions.org/questions/linux-software-2/what-are-these-files-159660/)

beejayzed 03-18-2004 11:22 PM

What are these files?
 
Hi all,
I've been using Mandrake Linux for a few months now but still don't know the different files.
For example, I know fstab and mtab have something to do with filesystems and xf86config is what I edited to get my mouse wheel working.
What exactly are fstab and mtab and what is the difference between them?
Also which file contains the path? I've heard of running a command to add something to the path but can't I just edit a file? I prefer that.
Which scripts are run every time my system boots? I've heard of rc.d for Redhat in another forum but is it the same for Mandrake?
Is there a file equivalent to autoexec.bat in Windows?

Thanks to everone in advance.

Tinkster 03-19-2004 12:29 AM

Re: What are these files?
 
Quote:

Originally posted by beejayzed
What exactly are fstab and mtab and what is the difference between them?
fstab is the configuration file (so to speak),
mtab holds the actual values for currently
mounted devices...

Quote:

Also which file contains the path? I've heard of running a command to add something to the path but can't I just edit a file? I prefer that.
Sure can ... it it's meant to be global just
put a shell-script in /etc/profile.d/ and set
the path's there ... e.g.:
my_paths.sh
Code:

#!/bin/sh
export PATH=$PATH:/usr/java/bin:/usr/local/pgsql/bin

If it's for your user create/edit (depending on how
you invoke your shell) a) ~/.bashrc and put an
export statement like the above in it, or b) create
~/.bash_profile and put the above statement in it
or c) create both, put above statement in one, and
Code:

if [ -x  <other_file> ]; then
  source <other_file>
fi

in the second :}


Quote:

Which scripts are run every time my system boots? I've heard of rc.d for Redhat in another forum but is it the same for Mandrake?
Is there a file equivalent to autoexec.bat in Windows?
Just look at /etc/inittab :}


Cheers,
Tink

beejayzed 03-19-2004 12:58 AM

Thanks for the reply Tinkster.
So fstab contains the config for the devices, right? I understood about the path.
Can I add my own things to inittab?
Are there any other interesting files I should know about?
Thanks

Tinkster 03-19-2004 01:20 AM

Pleasure mate :)

Quote:

Can I add my own things to inittab?
Umm, no, it just points you to the "real" thing... don't
change any of the files it points to directly, either,
unless you're 100% you know what you're doing,
or how to recover from what you did ;)

In my case (Slackware) it's rc.M
# Script to run when going multi user.
rc:2345:wait:/etc/rc.d/rc.M

Mandreck and DeadRat will probably look
somewhat different ...

Quote:

Are there any other interesting files I should know about?
Basically EVERYTHING in /etc is interesting,
they're pretty much all configuration files or
system scripts (with a few exceptions).



Cheers,
Tink

beejayzed 03-19-2004 02:06 AM

So, which file can I edit to add my own things?

beejayzed 03-19-2004 02:10 AM

Hey wait a minute, you're also from New Zealand. Never noticed that.

jschiwal 03-19-2004 02:43 AM

There are files which run when you log in, and there are different files which run every time you start a new shell. For the bash shell, man bash will give you the details of /etc/profile /etc/bashrc ~/.bashrc ~/.bash_profile and ~/.bash_logout. If you use a different shell, there will be different scripts.

There are scripts in /etc/init.d which may be run when booting up. These tend to be scripts that control the daemons (services) which run in the background.

beejayzed 03-19-2004 02:54 AM

Alrighty, now I know a bit more :)

JoeDuncan 03-19-2004 09:58 AM

The equivalent to "autoexec.bat" on Mandrake systems is the following file:

etc/rc.d/rc.local

You can edit it to add what you like, but don't remove anything that's already in there.

As for setting the path, Mandrake does it in a very convoluted way, and no one except Mandrake is really sure where the *master* PATH is set (r.csysconfig plus a bunch of other files... IIRC)

However, your best bet to edit the PATH for your own purposes is just to add to the PATH variable in

.bash_profile

You have to be careful about the differences between rc.local and .bash_profile, .bashrc etc...

The bash files run when you launch a new shell (terminal window, console, command line whatever you like to call it...) whereas rc.local runs everytime the machine starts up.

Tinkster 03-19-2004 02:58 PM

Quote:

Originally posted by beejayzed
Hey wait a minute, you're also from New Zealand. Never noticed that.
Yep, well, not exactly from, but in sunny Wellington :}


As for the files: Even though the things
JSchiwal pointed out are correct I consider
it bad practice to modify the ones in /etc because
of upgrades ... either a) your modifications will
be overwritten or b) you have to put them in
the upgraded file manually. The approach with
/etc/profile.d/ is CLEAN.


Cheers,
Tink

beejayzed 03-19-2004 03:20 PM

Okay I gather the following from these posts:
1. Autoexec.bat = /etc/rc.d/rc.local
2. Path = many places but I can edit .bash_profile, /etc/profile.d/, /etc/profile
3. fstab = config for devices, mtab = mounted devices.

Many thanks to everyone helped.

Tinkster 03-19-2004 05:02 PM

Got that right mate :)


Cheers,
Tink


All times are GMT -5. The time now is 03:35 PM.