Basic Linux Commands


These are the basic Linux commands that could be useful at first step. This list could be kilometers long but I just wanted to give a first look to the users with no knowladge of Linux/Unix. For more information take look at the man pages, /usr/doc/ directory in your Linux machine and http://www.ctyme.com/linuxdoc/alpha1.htm

You can access man pages by simply typing "man command" at the command prompt on your Linux/Unix machine. The man pages can also be found at linux-howto.com

By the way, do not forget that Unix/Linux is case sensitive. This means that Linux and linux are not the same...


ls: It lists the files and the subdirectories in the current directory. Some of its valid parameters are F, a, l, R.

ls tip

cat: It is like the type command in MS-DOS but more and more powerful.You should have a look at it in man pages by typing the command "man cat".

cp: It copies files to the specified path. If no path is specified it copies the source file from the destination to the current directory.

mv: It is used to move file or directories to the specified path with the specified path with the specied name.It shoul be noticed that there isn't a rename function in Linux/Unix, so that mv is used to the this job.

rm: It erases one or multible files. You can use wildcards. It is important that there is no command like undelete in Unix variants so know that there is no way back. If you want to remove a directory with all the files/subdirectories just use -r parameter.

mkdir: It is used to create a new directory.

rmdir:It removes an empty directory.

startx: It starts the XWindow environment. It looks for a .xinitrc file in the users home directory and if there is something specified in this file extracts this (If you install a window manager you'll probably need this).

mount: In Unix copatible systems if you want to use a removable drive or use a non-specified hard-drive partition during the installation-process you need to mount that drive in a directory in order to use it. For example if you want to reach to the CD-ROM drive you may type "mount /dev/cdrom /mnt/cdrom". It is obvious that the destination directory (here, it is /mnt/cdrom) should exist before using this command. If you type mount alone it types the previosly mounted drives. To access to the floppy drive type "mount /dev/fd0 /mnt/floppy"

pwd: It prints the current directory.

cd: It changes the directory. It is used as the MS-DOS's cd command. The only difference can be seen when changing directory to the parent directory. We use "cd .." instead of MS-DOS's "cd..".

who: It displays the currently logged users and on which terminal they logged on.

w: It displays which user is doing what.If you see bashrc, csh, tcsh or something like that it means that the user is currently idle.

pine: Well, it is not a command but a very nice program to read, send mail etc...

lynx: It is an another usefull program which is used at least one time by every Linux/Unix user. It is a text mode web browser which is not capable of displaying images. It might be useful if you are looking for a text information and don't want to wait to see lots of pictures, applets etc...


Return To The Main Page