Previous Next Table of Contents

3. Managing your system.

3.1 Q: Is there something like an 'autoexec.bat' or 'startup-sequence in Linux?

A: Sure it is. All the files are in /etc directory. The first file which is executed when the kernel boots it is the /etc/rc or /etc/init.d/rc or /etc/rc.d/rc. This depends on your distribution. Then from this file all the deamons and drivers load till you get the login script.

3.2 Q: 1. How do I edit files under Linux? 2. What editor is "best"?

A: 1. Use an editor. ;) 2. None is "best". SNw^tKB prefer Emacs, while xopy use jed for his purposes.

3.3 Q: How do I change the default hostname?

A: Edit the file "/etc/HOSTNAME". However, in most Linux-distributions, you can change it in the installation program. If you are using RedHat, use Netcfg(X-windows).

3.4 Q: How do I access my floppy drive under Linux?

A: Simple. First you need the supported filesystem in your kernel, e.g. msdos. Then you need to have a directory without data where you will access the floppy. After that you use the "mount" program to mount the disk. Try the example below, and you will (hopefully) understand. :)

EXAMPLE:

Lets say we have /dosa prepared for our floppy purposes. To access a floppydisk using the "msdos" filesystem, just use the command:

mount /dev/fd0 /dosa -t msdos

This will mount floppy A: into the /dosa directory, and you can work with the disk like it was an ordinary directory on your harddrive. When you are done using the disk, don't just pull the diskette out as you normally do in DOS, because that might damage the floppy. You have to do use the following command before removing it:

"umount /dosa"

3.5 Q: How do I access my cd-rom under Linux?

A: Same as with the floppy. You need a fresh directory where you mount the cdrom. The difference here, is that the filesystem used for cdroms is "iso9660". So to mount a cdrom make a dir called /cdrom(or whatever you want to call it..) and use the following command:

mount /dev/cdrom /cdrom -t iso9660

Again, you must use the "umount" command, not for the same reasons as with the disketter, but if you don't, you won't get out the cd.. ;) Command:

"umount /cdrom"

3.6 Q: How do I access other harddisks/partitions ?

A: Same as with the floppy and cdrom, just that you need to specify which partition, on the disk, you need to mount. Here's a word about how a disk is configured in the Linux environment:

With IDE drives you might have "/dev/hda", "/dev/hdb", "/dev/hdc" and "/dev/hdd". (if you have just one disk, you have only "/dev/hda".) If you have SCSI drives you might have "/dev/sda", "/dev/sdb" etc. Then every disk might be splitted into partitions so if you have 2 primary partitions on your first IDE drive, you'll have "/dev/hda1" and "/dev/hda2". If you want to access your ms-dos drive under linux, do as below: Let us suppose we have linux on "/dev/hda1" and msdos on "/dev/hda2". The first thing you should do is making a directory at the root. Call it what you want, however, in this example, we'll use "/dos_c". After making the directory, just use the following command:

mount /dev/hda2 /dos_c -t msdos

3.7 Q: How do I format disks under Linux?

A: There is no need to format a disk under linux. If you really wanna make a new fresh partition, just make a new filesystem. As we suppose you are in a linux environment, you will use the "ext2" filesystem. Just use the following command where "??" indicates the disk and partition ID.

mkfs.ext2 /dev/hd??

3.8 Q: How do I change my password under Linux?

Use the "passwd" command. As password, use a word with six characters or more, that's not very easily guessed. It should contain some number too. Just make it hard to guess for hackers. ;) Don't forget the password, or it will be impossible for you to log in. If you're not root, the one with root account can probably fix it. If you are root, you are in deep shit. ;)

3.9 Q: I just downloaded a compressed file called xxxxxx.tar.gz. What do I do now?

A: Change to the directory where you wanna expand it, and use the command:

tar xzvvf xxxxx.tar.gz

You can use the "-C directory" option to expand the files in the directory.

3.10 Q: How do I defrag my harddrive?

A: Why the heck do you want to defrag your drive? You are using Linux now, and not some Micro$oft-crap. ;)

3.11 Q: How do I setup my modem under Linux?

A: Use a program called "setserial". However, you need to know which com-port your modem is connected to(com1 to com4.). Note that in linux, com-ports are named "/dev/ttySx" where ? is a number between 0 and 3. Com1 equals to "/dev/ttyS0", and so on. After that, just use the command below where "?" is the number of your com-port.

setserial /dev/ttyS? autoconfig

Then you can use one of terminal programs for connecting to bbs, internet.. There is a Telix like program called minicom. Ask your administrator to install it if you dont have it.

3.12 Q: How do I use my printer under linux?

A: If you want to f.eks print this faq on a printer connected to lpt1, use the following command:

cp lxnewbie.faq /dev/lp1

3.13 Q: How do I setup my scanner under Linux?

A: There are a lot of ways to make your scanner working. First you need a supported scanner then get the proggy for scanning at ftp://sunsite.unc.edu/pun/Linux/apps/scanners or something...

3.14 Q: How do I setup my soundcard under linux, and how to use it with games/programs.

A: The sound-drivers are located in the kernel, so if you want to be able to use your soundcard you need to rebuild the kernel. Take a look at 2.16 for info on this. When configuring the kernel, you'll find a section called "Sound Card Support".It's rather self-explaining, so I'm sure you find out of it. (If you don't, you should consider using WIN95 instead of Linux..;) ) If you don't find your soundcard(or 100% compatible) in the list, you won't get the soundcard working whatever you do..... After building a kernel with soundcard-suport, restart the computer with the new kernel, and you should have some new devices in the "/dev" directory. The audio-device is /dev/audio. The dsp-device is /dev/dsp, and the mixerdevice is /dev/mixer. The soundcard status can be found at /dev/sndstat. Now, you have all the devices you need to use sound-players, games, trackers, ets.

Then as you have the devices you need a player for sound files. There is a huge palete of programs that are made for playing sound data. Just surf into ftp://sunsite.unc.edu/pub/Linux/apps/sound/ directory and get your player, mixer, etc...

Games are another chapter. I think if you are familiar with DOS games you probably know how to set up game sound support.(Or atleast, you don't have to do a brainstorming to do it, since it's rather simular to the dos-games setup...) =)


Previous Next Table of Contents