Vector Linux 5

Information Center

 

Re-Discover the power of the CLI
(Command Line Interface)

CONTENTS

  1. Introduction
  2. Useful CLI applications
2.1 mc - File manager 2.2 mc - FTP client 2.3 Lynx - web browser
2.4 wget - download manager 2.5 mc - package installer and remover
2.6 mount - disk mounting
3. Credits



1. Introduction

Have you ever found yourself in a situation where a system refuses to enter the GUI and you need to edit some configuration file or download some patch or driver ?
Well, some Operative Systems are almost useless if you canīt access their GUI, but a strong point in Linux, is that you can do a LOT os stuff in CLI (text mode) to administer or rescue the OS.


2. Useful CLI applications

 

2.1 Filemanager

Type "mc" to open Midnight Manager, it is a filemanager (so you can copy files around with it).
With it, you can also create symlinks (a.k.a. symbolic links) by browsing to the directory where you want to create the symlink on one pane, then selecting the file whom the symlink must point to and the pressing

F9 -> F -> S

 

2.2 FTP client

mc is also an ftp client !! You open it, then press F9, press "P" or select "FTP" on the menu. You will reach a dialog where you must enter the connection details; press F1 to see some instructions about itīs formatting.

 

2.3 CLI web browser.

Type "lynx ftp.nluug.nl/pub/os/Linux/distr/vectorlinux/" and you will be browsing in CLI mode a mirror of the VL server. Browse around to get the files you need, then move them with mc to their "appropiate places".

 

2.4 Download manager

There is a command line utility named wget wich can be used as a Download Manager, it is not "interactive" but rather a "set and forget" application. Basically, you need to type ´wget´ followed by the address of a file and it downloads it to the directory where you are standing.

wget http://www.someserver.com/files/thisfile.tgz

Among other features, it can be used for http and ftp links, just type "man wget" to learn about it´s many options.

 

2.5 Package installer and remover

Yet again, mc proves to be incredibly useful.

  • Install packages.
    To install a package, open mc, browse to the directory where the package is located, select it and then press
F2 -> select install current .tgz package -> press [Enter]

You could also install it by using the command installpkg <packagename>, but you need to be in the directory where the .tgz file is located.

  • Remove Packages.
    To remove a package, open mc, then browse to the /var/log/packages directory, select the one you want to remove and press
F2 -> remove a package listed in [...] -> press [Enter]

 

2.6 Mounting drives by CLI

Attaching another device to your filesystem is easy. All you have to do is use the mount command, along with a few options. Using mount can also be made much more simple if the device has an entry in the /etc/fstab file. For example, let's say that I wanted to mount my CD-ROM drive and that my fstab file looked like the example from the previous section. I would call mount like this:

# mount /mnt/cdrom

Since there is an entry in fstab for that mount point, mount knows what options to use. If there wasn't an entry for that device, I would have to use several options for mount:

Mounting a CDRom:

# mount -t iso9660 -o ro /dev/cdrom /mnt/cdrom

Mounting a Windows Fat32 partition with root-only access:

# mount -t vfat -o rw /dev/hda1 /mnt/win

The -t iso9660 is the filesystem type of the device to mount. In this case, it would be the iso9660 filesystem which is what CD-ROM drives most commonly use. The -o ro tells mount to mount the device read-only. The /dev/cdrom is the name of the device to mount, and /mnt/cdrom is the location on the filesystem to mount the drive.

Before you can remove a floppy, CD-ROM, or other removable device that is currently mounted, you'll have to unmount it. That is done using the umount command. Don't ask where the “n” went because we couldn't tell you. You can use either the mounted device or the mount point as the argument to umount. For example, if you wanted to unmount the CD-ROM from the previous example, either of these commands would work:

# umount /dev/cdrom
# umount /mnt/cdrom


Note: Since version VectorLinux 5.0 you can create and remove "mount points" using VASM, however, devices will not be mounted automatically; so this guide can probe useful when you need to mount a device but you can´t use a GUI application for some reason.

Top


5. Credits

Copyright 2004 Vector Linux
Released under [GNU Free Document License [ http://www.gnu.org/licenses/fdl.html ]
Contributed by: UKBill

Top