lab01 - Scientific Programming in Atmospheric Science...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Scientific Programming in Atmospheric Science MSC321 Lab 1 Learning the basics When you login in a Linux system, you are greeted by a prompt . The prompt indicates you are talking to a shell What is a shell ? A shell is a command interpreter. You type command into a shell and the shell passes them to the computer for the execution. Why the name shell? Think of a shell as something wrapping around the Operative System (OS), in this case Linux, avoiding you to know every single detail. Your work is done through the shell: it reads the commands you type and it passes to Linux. There are a lot of shells but their study is beyond this course. Just be aware you are going to use the BASH shell How to enter a command in Linux? To enter a command just type it and press RETURN . Let’s try, just for example: - date displays current date and time; - who shows who is logged in - ls lists files in the directory - pwd prints the current work directory - cal 1946 shows the 1946 calendar - ls -a lists all the files including the invisible ones How to refer to the current directory? Typing ls -a , you can notice that filenames . and .. always appear. The filename . means ‘the current work directory’ and gives a convenient way to refer to the current location. The filename .. always means ‘the parent of the current directory’. It is useful when you want to refer, or move, to locations one or more levels up in the file system How to create a new directory? Use the mkdir command. For example mkdir Newdir creates a directory whose name is Newdir. It is a good habit to stick with safe characters in the 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
name of directories or files, such as letters, digits and underscores. Try to avoid dashes, points and spaces in the names and keep in mind that Linux is case sensitive, so Newdir is not the same of newdir / ¤ ¥ ¡ / ¤ ¥ ¡ / ¤ ¥ ¡ / ¤ ¥ ¡ / ¤ ¥ ¡ / ¤ ¥ ¡ / ¤ ¥ ¡ / bin lib home opt mnt tmp / ¤ ¥ ¡ / ¤ ¥ ¡ / ¤ ¥ ¡ usr1 students usr2 / ¤ ¥ ¡ / ¤ ¥ ¡ / ¤ ¥ ¡ std1 std2 std3 / ¤ ¥ ¡ / ¤ ¥ ¡ Newdir Msc321 How to move in a directory? To change into a directory, you usually have to specify a pathname. Suppose the computer you are working on has the directory tree structure shown above. There is the root directory that contains all the informations and that usually is denoted with / . There are its subdirectories like bin, lib, opt, mnt, tmp and home. Usually when you login with your account, you are directed to your home directory that is a subdirectory of the home with the name of your account. In this specific case, your own home directory is a subdirectory of the directory students. So the correct path of the home directory for std3 is /home/students/std3 . Another way to refer to your 2
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/08/2012 for the course MSC 321 taught by Professor Staff during the Fall '08 term at University of Miami.

Page1 / 7

lab01 - Scientific Programming in Atmospheric Science...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online