http://www.eastchem.ac.uk http://www.eastchem.ac.uk/rcf http://www.st-andrews.ac.uk http://www.ed.ac.uk


Support Pages | Topics


Linux Command Line | Vi | Emacs

Linux and Text Editors

Linux Command Line

This section provides a quick intorduction to the basic linux commands you will need for using the cluster. Much more information is available on the web. Just use your favourite search engine to find them. There is a very quick linux minilesson available.

Why command line?

Graphical interfaces use a lot of resources so to keep the ovehead down we use the Linux command line to access the clusters. It may be strange at first but you will soon get used to it!

Moving Around

The first set of commands will allow you to move around the directories on the system and look at files.

pwd
Prints your current location in the filesystem.
cd <dir>

Change directory to <dir>. '..' - move up a directory; '~' - go to your home directory.

ls
List the files and directories in the current direcotry. Adding a '-l' will produce a long listing including permissions and creation dates.

Manipulating Files

These commands allow us to create directories, copy, move, rename and delete files.

mkdir <dir>
Create a directory
rmdir <dir>
Delete a direcotry.
cp <source> <destination>
Copy a file. Destination can be a direcory in which case the file is copied to that directory with its original name.
mv <source> <destination>
Move/rename a file. Destinatio can be a directory in which case the file is moved to that directory with its original name.
rm <file>
Delete a file.

Viewing and Editing Files

View the contents of files and edit them.

less <file>
Print the contents of the file to the screen one page at a time. Move forward through the file using 'space' or 'return'. 'u' goes up in the file, 'g' goes to the beginning and 'G' to the end.
vi <file>

Edit the file using the vi text editor. Please see below for an introduction to vi

emacs <file>

Edit the file using the emacs text editor. Please see below for an introduction to emacs

Miscellaneous Commands

Other useful commands.

man <command>

List a help page on <command>.

exit
Log out of the cluster.

Vi Text Editor

Vi is the standard linux text editor and can be found on almost all linux machines. It is also very powerful and requires no graphical interface. For these reasons it it worth learning to use, even though it seems complex at first.

The best way to learn to use vi is to look for material on the web. Good places to start are:

Emacs Text Editor

Emacs is another text editor that is available on the EaStCHEM RCF clusters. It is easier to use than vi, due to its graphical interface. Again, the best place to find information is on the web.

Top

ComputationalChemistryActivity/SupportPages/LinuxAndText (last edited 2007-07-02 10:25:54 by AndrewTurner)