720 likes | 853 Views
Booth Engineering Center for Advanced Technology (BECAT) Seminar. An Introduction to Linux for Windows Users. http://www.engr.uconn.edu/becat/hpc. Outline. History System Overview Accessing the System FAQs Shells Processes The File System and File Access Rights Editors
E N D
Booth Engineering Center for Advanced Technology (BECAT) Seminar An Introduction to Linux for Windows Users http://www.engr.uconn.edu/becat/hpc
Outline • History • System Overview • Accessing the System • FAQs • Shells • Processes • The File System and File Access Rights • Editors • Summary of Useful Commands/Utilities • X-Window System and Cygwin/X • Acknowledgment
History • In order to understand the popularity of Linux, we need to travel back in time, about 30 years ago... • In 1969, a team of developers in the Bell Labs laboratories started working on a solution for the software problem, to address these compatibility issues. They developed a new operating system, which was • Simple and elegant. • Written in the C programming language instead of in assembly code. • Able to recycle code. The Bell Labs developers named their project “UNIX.”
Linus and Linux • Linus Torvalds, a young man studying computer science at the university of Helsinki • thought it would be a good idea to have some sort of freely available academic version of UNIX, and promptly started to code. • Linux is a full UNIX clone
Current application of Linux systems • Today Linux has joined the desktop market. • Linux developers concentrated on networking and services in the beginning, and office applications have been the last barrier to be taken down. • On the server side, Linux is well-known as a stable and reliable platform, providing database and trading services for companies like Amazon, the well-known online bookshop, US Post Office, the German army and such.
Current application of Linux systems • Clusters of Linux machines are used in the creation of movies such as “Titanic”, “Shrek” and others.
Is Linux difficult? • This is a frequently asked question about Linux. • Linux is designed to be fast, responsive and flexible. • There is excellent and free Internet support and documentation available • The graphical user interface is similar in design to that on any other system and a very powerful command line alternative is also available. • So Linux can get the things done you need doing. • Linux is user friendly.
Linux for non-experienced users • Companies such as RedHat, SuSE and Mandriva have sprung up, providing packaged Linux distributions suitable for mass consumption. • They integrated a great deal of graphical user interfaces (GUIs), developed by the community, in order to ease management of programs and services. • As a Linux user today you have all the means of getting to know your system inside out, but it is no longer necessary to have that knowledge in order to make the system comply to your requests. • Nowadays you can log in graphically and start all required applications without even having to type a single character, while you still have the ability to access the core of the system if needed. Because of its structure, Linux allows a user to grow into the system: it equally fits new and experienced users. New users are not forced to do difficult things, while experienced users are not forced to work in the same way they did when they first started learning Linux.
Does Linux have a future? • Open Source • This software will be more flexible and of a better quality than software that has been developed using the conventional channels • Today, Linux is ready to accept the challenge of a fast-changing world.
Properties of Linux • Linux is free: • As in free beer, they say. If you want to spend absolutely nothing, you don't even have to pay the price of a CD. Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
Properties of Linux • Linux is portable to any hardware platform: • A vendor who wants to sell a new type of computer and who doesn't know what kind of OS his new machine will run (say the CPU in your car or washing machine), can take a Linux kernel and make it work on his hardware, because documentation related to this activity is freely available.
Properties of Linux • Linux was made to keep on running: • As with UNIX, a Linux system expects to run without rebooting all the time. That is why a lot of tasks are being executed at night or scheduled automatically for other calm moments, resulting in higher availability during busier periods and a more balanced use of the hardware. This property allows for Linux to be applicable also in environments where people don't have the time or the possibility to control their systems night and day.
Properties of Linux • Linux is secure and versatile: • The security model used in Linux is based on the UNIX idea of security, which is known to be robust and of proven quality. But Linux is not only fit for use as a fort against enemy attacks from the Internet: it will adapt equally to other situations, utilizing the same high standards for security.
Properties of Linux • Linux is scalable: • From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes: add or remove the appropriate packages and Linux fits all. You don't need a supercomputer anymore, because you can use Linux to do big things using the building blocks provided with the system. If you want to do little things, such as making an operating system for an embedded processor or just recycling your old 486, Linux will do that as well
Properties of Linux • The Linux OS and quite some Linux applications have very short debug-times: • Because Linux has been developed and tested by thousands of people, both errors and people to fix them are usually found rather quickly. It sometimes happens that there are only a couple of hours between discovery and fixing of a bug
Software • GNU Compilers, Intel C++/Fortran Compilers • Libraries : BLAS, LAPACK, SCSL, MKL, MPT, OpenMP etc. • Applications: Scilab, Octave, VTK, Paraview, R, etc.
Accessing the System • OpenSSH • SSH Client – Putty • http://www.chiark.greenend.org.uk/~sgtatham/putty/ • SFTP Client – WinSCP • http://winscp.net/eng/index.php • Other SSH Clients • http://www.ssh.com
FAQs • Where is my home directory? • /u/home/{username} • What is the disk quota limit? • 500 MB for the home directory • Up to 500 GB for /data/scratch • How do I navigate the file system? • cd dir
FAQs • How do I create directories/files? • nedit, pico, vi, emacs • mkdir dir • How do I delete directories/files? • rm –rf dir/files • How do I protect my directories/files from being viewd by other users? • chmod 700 dir/file
FAQs • Are my files backed up automatically? • For the time being, no. • How do I back up my files? • Use tar, gzip and transfer backup files to a safe place • How do I transfer files between sgi1 and my PC? • Sftp, WinSCP • How do I access the system from home? • Through fester or VPN
Passwords • Every account must have a password. • Passwords can be composed of letters, numbers, the space character and other special symbols. It is essential for users to choose a strong password. • Passwords are case-sensitive.
Changing Your Password • Standalone systems: passwd • NIS: yppasswd • The SoE systems: • Method 1: USING SOE WEB MAIL • Go to www.engr.uconn.edu/mail • Enter your SOE email ID, hit Enter • Click on Read Mail • Enter ID and Pass Word • Click on the Options Icon located in the bottom left • Scroll down to Change Password • Enter Account, Old Password, New Password and Confirm new password • Method 2: USING ECS LC • Come to any ECS LC and login into any PC, • then press CTRL, ALT & DEL again while logged in. • You will be able to select Change Password from the Task Menu.
The Shell • Shell – command processor • Korn shell (/bin/ksh) • C shell (/bin/csh) • Bourne Shell (/bin/sh) • Bourne Again Shell (/bin/bash) • Switch between shells
BASH • Bash is a command language interpreter • Bash is the most popular shell under Linux • The prompt: %, #, $, ~> • Everything you type before return is consider to be the command line • The first word is taken to be the command • Everything else on the command line is information for either the command itself or for the shell. Options usually begin with a minus sign
BASH: Startup Environment • When a login shell starts, BASH reads and executes commands from: • /etc/profile • ~/.bash_profile • When an interactive shell (not login shell) starts, BASH reads and executes commands from: • ~/.bashrc
BASH: Startup Script Example # Sample .bashrc export PATH=$PATH:/usr/local/bin export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/usr/X11/lib source /opt/intel/cc/9.0/bin/eccvars.sh source /opt/intel/fc/9.0/bin/ifortvars.sh source /opt/intel/idb/9.0/bin/idbvars.sh source /opt/intel/mkl72/tools/environment/mklvars64.sh source /opt/intel/ipp41/ia32_itanium/tools/env/ippvars64.sh test -s ~/.alias && . ~/.alias
BASH • Some useful shell commands: • ls – lists the files you have in the current directory • date – gives the date and time • who – gives information about who is currently logged on • man – access to the on-line manual when you need to check the syntax of a command
BASH • cat - concatenates files together and sends the result to stdout • more - gives you one screenful of the files at a time. Type the SPACE bar to get another screenful. • find - search for files in a directory hierarchy
BASH • Controlling the flow of input and output • Redirection: • To redirect input to come from a specified file (instead of stdin), type: • command < filename • To redirect output to a specified file (instead of stdout), type: • command > filename • Example : $ ls –lct > list.txt
BASH • Piping – connecting stdout of one command to stdin of another • One can pipe the output of one command into the input of another command by using the vertical bar character (|). • Example: • $ cat file1 file2 | more • Concatenate the files file1 and file2 and use the results as input to the more program
Processes • A process is a shell command or a program in execution. • When you log in, a process is created. This process is executing the shell • When you execute a shell command, a new process is created. When the command terminates, the new process dies. • A single user can have many processes executing at the same time
Processes • The command ps is used to determine the status of active processes. The command returns the process id (PID) number and other information such as the amount of CPU time the process has used (TIME) and the command which invoked the process (CMD). • Options may be combined. • UNIX options; BSD options; GNU options
Examples of the ps Command hpc@linuxAltix:~> ps PID TTY TIME CMD 7032 pts/11 00:00:00 bash 7346 pts/11 00:00:00 ps hpc@linuxAltix:~> ps -ef|more UID PID PPID C STIME TTY TIME CMD root 1 0 0 Jan22 ? 00:00:14 init [3] root 2 1 0 Jan22 ? 00:00:00 [migration/0] root 3 1 0 Jan22 ? 00:00:00 [ksoftirqd/0] root 4 1 0 Jan22 ? 00:00:00 [migration/1] root 5 1 0 Jan22 ? 00:00:00 [ksoftirqd/1] root 6 1 0 Jan22 ? 00:00:02 [migration/2] root 7 1 0 Jan22 ? 00:00:00 [ksoftirqd/2] root 8 1 0 Jan22 ? 00:00:00 [migration/3] root 9 1 0 Jan22 ? 00:00:00 [ksoftirqd/3] root 10 1 0 Jan22 ? 00:00:00 [migration/4] root 11 1 0 Jan22 ? 00:00:00 [ksoftirqd/4] root 12 1 0 Jan22 ? 00:00:00 [migration/5]
Top • The command top is used to show a real-time view of Linux tasks • top can be used to display the CPU/memory usage of each task and the CPU the task is running on in a SMP system • $ top • $ top -u
Terminate Processes • kill is used to terminate processes or to send signal to processes. • Examples: • $ kill PID Terminate the process with the process id (PID). • $ kill –HUP PID Restart the process with the process id (PID). • $ kill -9 -1 Terminate all processes. Useful when you want to clean all the tasks you initiated.
The File System • Ext2, ext3, reiserfs, xfs and more • Journaling file system is a file system which records changes to a journal before writing to the main system, e. g. ext3, reiserfs etc.
The File System • UNIX file name can be very long. • Use alphabetic, numeric and some special characters. • Files started with a .(dot) are hidden. Use • $ ls –a to display hidden files. • Hierarchical file structure (tree structure).
The File System • You are automatically placed in your home directory after logging in. • e.g. /u/home/hpc, /home/hpc • You can move up and down in the tree to other directories if you have permission to do so.
The File System • Commands for moving around in the directory structure • pwd – no argument needed. Tells you the current directory/path • cd dir_name – this changes your position to the specific directory • You can specify directory names in two ways: • The full pathname from the root of the tree • $ cd /u/home/hpc/test/bin • A pathname relative to you current directory • $ cd . • $ cd .. • $cd test/bin
The File System • Creating new directories and removing old ones • $ mkdir dir_name • This command creates a new directory. • $ rmdir dir_name • This command is used to delete the directory, which must be empty. • $ rm –rf dir_name • This command is used to delete the directory and all the files in it.
The File System: Pathnames • The root of the tree is specified by the character / • All levels of a subtree are separated by the character / • Examples of complete pathnames are: • /u/home/hpc/ee401/homework • /usr/home/hpc/.bashrc • Examples of relative pathnames are: • ../homework/hw1 • ee401/homework