Amber masthead
Filler image AmberTools23 Amber22 Manuals Tutorials Force Fields Contacts History
Filler image

Useful links:

Amber Home
Download Amber
Installation
Amber Citations
GPU Support
Updates
Mailing Lists
For Educators
File Formats
Contributors
Tools
 

Getting started with Linux

Amber MD is software that is entirely based on a Command Line Interface (CLI) on a computer with Linux. To run Amber, you will need to open a terminal.

1. Open a terminal window now on your Linux computer.

On most Linux machines, your terminal will look like this:

terminal

List files and make a directory (folder) to store your files in

When you first log in and start a terminal, your current working directory (or folder) is your home directory. It has the same name as your username, and it is where your files and directories are stored. In most cases, this is /home/username

ls (list)

2. Use the ls command to list what is in your current directory.
Note that the "$" is the command line prompt in the terminal.
$ ls
At this point there will probably be some files and directories in your home directory that are created automatically with your account. Alternatively, "ls -l" can be used here to show the file sizes and the associated permissions.

mkdir (make directory)

You'll need a new directory for the files and folders created in this tutorial.

3. Make a new directory for this tutorial with the mkdir command called Tutorial.

$ mkdir Tutorial
Now when you do ls you should see your new directory has been created.
$ ls
Tutorial

cd (change directory)

At this point, you'll want to move into your Tutorial directory so that you can save all of your working files there.

4. Use the cd command to change to different directory.

$ cd Tutorial
$ ls
There is a special directory named "..". This means the parent of the current directory or simply "up" one directory. So to return to the parent of the Tutorial directory use cd ..
$ cd ..
$ ls
Tutorial
If you ever need to return to your home directory use just the cd command by itself. Tilde "~" is a shortcut to your home directory. The following commands both change directory to your home directory.
$ cd
$ cd ~

pwd (print working directory)

Pathnames describe what directory you are in relative to the entire computer's filesystem. Your home directory has a location within the entire filesystem.

5. Print the working directory pathname of your home directory with pwd.
$ cd
$ pwd
/home/username
This is the current working directory that you're located in. In this case the directory username is in the directory home which is in the / (root) directory.

Command List

Here are a list of other commands and their functions:

Command
Description
Example
cd directory
changes to a specified directory
cd newdirectory

OR

cd /usr/local/bin (only system directories need the first slash)

OR

cd ~amberuser1 (changes to the username’s directory)
cd home
changes to /home/yourusername
cd home
cd ..
changes up two directories
cd ../../
cdl
change to last directory
cdl
cp filename newfile
copies a file to a new filename
cp test.in newtest.in
gzip filename
gzips (compresses) a file
gzip test.in
gunzip *.gz
gunzips (uncompresses) a file
gunzip test.in.gz
ls
lists the directory contents
ls
ls –l
lists the directory contents and also shows the size of files and the permissions
ls -l
ls –la
like ls –l except it also shows all filenames beginning with a period.
ls -la
mkdir directory
make a directory
mkdir pdbfiles
less filename
View a file
less test.in

(Shift-G - go to end; b-back 1 page; space bar – forward one page)
mv filename newfile
moves a file from one place to another
mv test.in newstuff/newtest.in (moves test.in to the directory newstuff and calls it a new name newtest.in)

OR

mv test.in newstuff/ (moves test.in to the directory newstuff and keeps the same name test.in)
pwd
tells you which directory you are in
pwd
rm
removes a file or directory
rm test.in
rm –fr
remove a file or directory and all its contents without prompting for a confirmation
rm –fr allmystuff
rm –I
remove a file with a prompt for a confirmation
rm –I allmystuff

Note:Its recommended that you set this as your default in your .alias file or your .cshrc file
rm –r
removes a directory and all its contents with a prompt for confirmation
rm –r allmystuff
tar –cvf name.tar directory or list of filenames
Create an archive (one file) of a directory or list of files
tar –cvf archiveI.tar allmystuff

OR

tar –cvf archiveI.tar test.in test2.in
tar –xvf name.tar
Extract an archive file
tar –xvf archiveI.tar
which command
tells you the alias for the command
which ls

Other Resources

For more information, please visit the following pages.

Code Academy

Ryan's Linux Tutorials

Last updated by Jan Ziembicki July 31, 2020.

"How's that for maxed out?"

Last modified: