An A-Z Index of The Command Line: Linux BASH
An A-Z Index of The Command Line: Linux BASH
m4 Macro processor
man Help manual
mkdir Create new folder(s)
mkfifo Make FIFOs (named pipes)
mknod Make block or character special files
more Display output one screen at a time
mount Mount a file system
mtools Manipulate MS-DOS files
mv Move or rename files or directories
nice Set the priority of a command or job
nl Number lines and write files
nohup Run a command immune to hangups
Below I have attempted to show how to use some basic commands. First you will
see the command and then some switches for that command. I really recommend
you buy a book on Linux such as Using Linux as it will help immensely. Sorry that
the commands are not in any particular order but I'll do that at a later date as I am
doing this off the top of my head.
logout
logout logs you out!
shutdown
shutdown shuts down and reboots are halts a system
shutdown -r now reboots a system immediately. You can also specify a time to
reboot say shutdown -r 09:30
shutdown -h now halts your system so you can turn it off. You must halt a system
to turn it off.
ls
ls shows the content of your current directly.
ls -l shows the files in long format i.e. the owner of the file, rights etc.
ls -a show hidden files like .bash_profile which does not show up with regular ls.
there are like 25 other switches but these are used most often.
ln
ln creates a link from a directory or device to another directory or device,
remember the link you made when setting up your modem? A very good use for
this is make what is called a symbolic link to a directory. Say your in /root and you
hate having to type say ls /usr/local/myfiles to display what is in this directory you
always put files in. Type ln -s /usr/local/myfiles myfiles. You now have a symbolic
link in your home directory to /usr/local/myfiles. Now if you just type ls myfiles
the link points to the actual directory. If you download something to you /root
directory. Type say mv testdownload.tar.gz myfiles and you save a lot of time.
mount
Filesystems are mounted by what's in you /etc/fstab file. Go ahead and look at it.
You'll see Filesystems that are mounted at startup and Filesystems that are user
mountable like you floppy and cdrom.
How do I mount my cdrom? mount /mnt/cdrom.
How do I mount my floppy? mount /mnt/floppy. Don't forget to umount it when
your done!
How do I mount a dos floppy? mount -t msdos /dev/fd0 /mnt/floppy
These all call the /etc/fstab file to see how they should be mounted. If you read up
on /etc/fstab you'll see Filesystems are mounted with options. For instance the
cdrom is not mounted at bootup and is read only. Please note that /mnt/floppy
and /mnt/cdrom are made by default. If you want to be able to mount other files
systems like your win95 partition do this. Mkdir /mnt/vfat. To mount it at any time
type mount -t vfat /dev/hda1 /mnt/vfat. hda1 is the first partition on your hard
drive, hda2 is the second, hdb1 is the first partition on your second hard drive.
Read up on mount as it is useful. Lastly all of these can be put in /etc/fstab so that
you can simply type mount /mnt/vfat for example. I recommend not editing this
file directly unless you know what you are doing. An easy way to do this is use
linuxconf which should be installed by default on your system. Lastly is your
wondering if there is a gui to do this yes there is, type usermount on RedHat
systems.
pwd
pwd shows your current directory position
cd
cd changes to a directory ex cd /usr/local. cd on its own brings you to your home
directory.
cd .. moves up one directory from you current
mv
mv moves a file to a directory
mv test test2 simply moves test to the test2 file, note its like renaming it.
cp
cp copies a file. You can copy a file to a directory and also rename it while copying