Pick a Free OS

User login

Navigation

Starters for Linux - Part 3

The standard PC settings for the second serial port (cua1or ttyS1) are: address of i/o port 0x02f8, irq 3.

The third serial port (cua2 or ttyS2): 0x03e8, irq 4.

The forth serial port (cua3 or ttyS3): 0x02e8, irq 3.

Add your setting to /etc/rc.d/rc.local if you want it to be set at the boot time. See man setserial for a good overview.

fdisk

(as root) Linux hard drive partitioning utility (DOS has a utility with the same name)

mkfs -c=20 -t ext2

(floppy disk format, two commands, as root) Perform a low-level format on a floppy in the first floppy drive (/dev/fd0), high density (1440 kB). Then make a Linux filesystem (-t ext2), checking/marking bad

blocks (-c ). Making the files system equivalent to the high-level format.

fsck -t ext2 /dev/hda2

(file system check, as root) Check and repair a file system. The example uses the partition hda2, file system type ext2.

dd if=/boot/vmlinux of=/dev/fd0

dd, stands for Data Duplicator. The above command copies data, i.e the file vmlinuz in RAW format from /boot to the floppy.

mount -t iso9660 -r /dev/cdrom /mnt/cdrom

This command has to be issued as root unless root has provided you permissions to read from this drive. This command basically mounts the device /dev/cdrom to the directory /mnt/cdrom.

Basic Networking tools

ping machine_name

It stands for Packet Internet Groper. Check if you can contact another machine (give the machine’s name or IP), press Ctrl+C when done.

route -n

Show the routing table.

nslookup host_to_find

Query your default domain name server (DNS) for an Internet name host_to_find.

ifconfig

(as root) Display info on the network interfaces currently active (ethernet, ppp, etc). Your first ethernet device should show up as eth0, the second one as eth1, etc, first ppp over modem as ppp0, second as ppp1, etc. The lo is the loopback only interface which should be always active.

Use the options (see ifconfig --help) to configure the interfaces.

ifup interface_name

(/sbin/ifup to it run as a user) Startup a network interface.

E.g.: ifup eth0

ifup ppp0

Users can start up or shutdown the ppp interface only when the rights permission was checked during the ppp setup.

ifdown interface_name

(/sbin/ifdown to run it as a user). Shut down the network interface.

E.g.: ifdown ppp0

Also, see the previous command.

netstat | more