Bioafrica home HIV-1 Subtype Maps GDE for Linux and MacOS X HIV-1 Proteomics Resources HIV Bioinformatics online resources Training and Workshops About us ?
.

Linux Tutorials on the Internet:



Linux Basic Commands:  


The following is a list of basic linux commands.:

ls Lists files. The equivalent of "dir" in DOS. Common switches are -al which will list all files with a long description, including their permissions, size, and datestamp. You can also type in ls -al followed by a specific filename to learn information about that specific file. This is helpful if you have many files within a directory and you only want information on one of them. You can even use wildcards. For example, ls *.html show only files with extension .html
uname -a Show info about current machine and operative system
pwd Print Working Directory. Wonder which directory you're currently in? This reveals full path.
clear clear the screen
touch touch filename. If filename doesn't exist it gets created (0 byte). If filename already exists, touch alters its timestamp to the current time. Please note, in UNIX we can not easily name files with spaces in them, so words should use underscores or a capital letter to separate them. For example, touch my file will not work. You must write either touch myFile or touch my_file . This applies to creating directories as well.
mkdir makes a directory. You can put files in a directory :)
rmdir removes an empty directory. If it is not empty, you can use rm -rf instead.
rm removes files. You can use it with wildcards too. For example rm -f *.html will remove all html files in the directory. You can use it to remove a directory with an -rf switch. However, this is not the ideal way to remove directories.
cp cp originalFile newFile Creates a copy of the first file having the name of the second. If the paths are not specificied, then cp assumes you mean the current working directory. You can also copy a file to another location. For example,
cp OriginalFile /home/someDirectory/newFile
will copy a file from the current directory to another directory with "NewFile" as it's name. If no name is specified, and you are copying the file to another directory, then the original filename will be used.
cat
Concatenate files and print on standard output. Works like the DOS "TYPE" command. Simply put, "cat" can be use to read the contents of a file.
chmod
Change the permissions on a file or directory
grep
Find line matching a certain pattern. Very powerful search tool.
less
Filter for viewing files and directories. Works the same as the "more" command, but lets you scroll backwards. It is a little bulkier than more.
more
Filter for viewing files and directories a screen at a time.
mv
Move or rename file
>
A cool feature of Linux is that you can easily send the info that normally gets printed on the screen into a text file instead. This is called redirecting output. . For example, ls > newFile, will list all files in a directory and write them to a file called "newFile". If "newFile" already exists, the contents will be over-written, otherwise a new file will be created.
>>
Append the output of a program to a file. If the file does not already exist, it will be created. If it does already exist, the output will be written to the end of the file.
|
Called the "pipe". It is used to redirect the output of a command to another command.




Please report problems to toliveira@mrc.ac.za
The GDE for Linux package is maintained by: Tulio de Oliveira,  Bioinformatics Unit at Africa Centre, Nelson R Mandela School of Medicine, University of Natal, South Africa.

Revised 6 of February 2003 - Copyright @ Africa Centre