lab01 - Scientific Programming in Atmospheric Science...

Info icon This 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
Image of page 1

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

View Full Document Right 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
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern