Presentation is loading. Please wait.

Presentation is loading. Please wait.

An Introduction to Linux for Windows Users

Similar presentations


Presentation on theme: "An Introduction to Linux for Windows Users"— Presentation transcript:

1 An Introduction to Linux for Windows Users
Booth Engineering Center for Advanced Technology (BECAT) Seminar An Introduction to Linux for Windows Users

2 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

3 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.”

4 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

5 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.

6 Current application of Linux systems
Clusters of Linux machines are used in the creation of movies such as “Titanic”, “Shrek” and others.

7 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.

8 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.

9 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.

10 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.

11 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.

12 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.

13 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.

14 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

15 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

16 Software GNU Compilers, Intel C++/Fortran Compilers
Libraries : BLAS, LAPACK, SCSL, MKL, MPT, OpenMP etc. Applications: Scilab, Octave, VTK, Paraview, R, etc.

17 Accessing the System OpenSSH SSH Client – Putty SFTP Client – WinSCP
SFTP Client – WinSCP Other SSH Clients

18 Accessing the System - Putty

19 Accessing the System - Putty

20 Accessing the System - Putty

21 Accessing the System - Putty

22 FAQs Where is my home directory? What is the disk quota limit?
/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

23 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

24 FAQs Are my files backed up automatically? How do I back up my files?
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

25 Transferring Files - WinSCP

26 Transferring Files - WinSCP

27 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.

28 Changing Your Password
Standalone systems: passwd NIS: yppasswd The SoE systems: Method 1: USING SOE WEB MAIL Go to Enter your SOE 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.

29 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

30 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

31 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

32 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

33 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

34 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

35 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

36 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

37 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

38 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

39 Examples of the ps Command
ps PID TTY TIME CMD 7032 pts/ :00:00 bash 7346 pts/ :00:00 ps ps -ef|more UID PID PPID C STIME TTY TIME CMD root Jan22 ? :00:14 init [3] root Jan22 ? :00:00 [migration/0] root Jan22 ? :00:00 [ksoftirqd/0] root Jan22 ? :00:00 [migration/1] root Jan22 ? :00:00 [ksoftirqd/1] root Jan22 ? :00:02 [migration/2] root Jan22 ? :00:00 [ksoftirqd/2] root Jan22 ? :00:00 [migration/3] root Jan22 ? :00:00 [ksoftirqd/3] root Jan22 ? :00:00 [migration/4] root Jan22 ? :00:00 [ksoftirqd/4] root Jan22 ? :00:00 [migration/5]

40 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

41 Top

42 Top: Options

43 Top

44 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.

45 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.

46 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).

47 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.

48 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

49 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.

50 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

51 The File System – ls -l

52 File Access Rights The command ls -l displays the access right to a file. Example: drwxr-xr-x The first single character specifies whether the entry is a directory (d), a simple file (-) or a link (l). r : read permission w : write/modify permission x : execute permission for a file or search permission for a directory - : no permission

53 File Access Rights Example: drwxr_xr_x
The first group (rwx) specifies the access privileges of the owner of the file or directory The next group (r_x) specifies the access privileges of a group in which the owner is a member The last group (r_x) specifies the access privileges of the rest of the world (i.e. everyone on the system)

54 Changing the Access Rights: chmod
The command changes the access rights to a file or directory. There are two ways to do this: 1. symbolically 2. using octal notation

55 Changing the Access Rights: Symbolically
$ chmod [who]permission filename who is specified by u (user/owner), g (group), o (others), a (all three) Examples: Add execute permission to the owner of the file file1: $ chmod u+x file1 Remove execute permission from everyone including the owner on the file file2: $ chmod a-x file2

56 Changing the Access Rights: Using OCTAL notation
$ chmod mode filename The mode is specified by treating each of the groups of three rwx fields as an octal digit. Read permission has a value of 4 Write permission has a value of 2 Execute permission has a value of 1 Examples: $ chmod 700 file1 changes access rights of file1 to -rwx------ $ chmod 644 dir2 changes access rights of dir2 to drw-r--r--

57 File Archiving: tar Saves and restores multiple files to/from a single file. Directories followed recursively. Format: tar [opitions] [options_values] [files] Examples: $ tar cvf /tmp/backup.tar ~/data ~/test $ tar xvf backup.tar

58 File Compression: gzip
Compressing files: gzip filename $ gzip backup.tar The resulted file is backup.tar.gz Uncompressing files: gzip –d filename.gz $ gzip –d backup.tar.gz The uncompressed file is backup.tar GUN Tar combines uncompress and untar $ tar zxvf filename.tar.gz

59 Example: Back Up Files can be drag and drop to your PC using WinSCP.
To back up all the files in a directory: Create a directory to hold the backup file Use tar to save files into a single tar file Compress the tarball using gzip Transfer the compressed backup file (filename.tar,gz) to your PC Delete the backup file or folder on the server The backup file can be expanded on PC using WinZip and other utilities Relative path and full path

60 Example: Back Up

61 Editors vi - a universal text editor in UNIX/Linux
$ vi filename nano – a free pico clone in the style of the Pine composer $ nano filename emacs – an extensible, customizable, self-documenting real-time display editor nedit - a multi-purpose text editor for the X Window System

62 Editors - nano

63 Editors - nedit

64 Summary of Useful Commands/Utilities
man [command] – display the manual page for the command ls –al | more – list all the files in the current directory cd [dir] – change the current directory cd .. – go to the parent directory pwd - print the current directory rm [file] – delete a file rm –rf [file,dir] – force delete files or directories

65 Summary of Useful Commands/Utilities
cp [file1] [file2] – copy file1 to file2, the paths need to be added if the files are not in the current directory mv [oldname] [newname] – rename the file or directory mkdir [dir] – create a directory du –ks – print the space used by the current directory quota –v – display the disk usage by the current users

66 Summary of Useful Commands/Utilities
find [dir] –name [filename] – search files with the filename under the directory chmod 700 [file] – change the permission of the file so only the owner can read, write and execute the file chmod –R mode [dir] – change the permissions recusively tar – archive files gzip – compress and expand file(s) export – display the current environment

67 Summary of Useful Commands/Utilities
ps –ef | more – display all the processes top – show real-time view of tasks top –u [username] – show tasks owned by the user kill [pid] – terminate the process kill – terminate all the processes owned by you

68 Summary of Useful Commands/Utilities
who – displays who is logged on which [command] – shows the full path of the command

69 Examples: Compiling and Running Simple Programs
$ g77 hello.f $ ./a.out $ icc –o foobar foobar.c -lmkl_lapack -lmkl_ipf -lguide -lpthread $ ./foobar $ icc –o hello hello.c –lmpi $ mpirun –np 4 hello

70 X and Cygwin/X X Window System (X11 or X) presents the toolkit and protocol to build GUI on Unix, Unix-like systems. To display the remote X GUI applications on your local PC, an X server program (Hummingbird Exceed, XWin32, Cygwin/X etc.) needs to be running on the PC. Cygwin/X provides X Window System for Microsoft Windows. X11 Forwarding/Tunneling through SSH Another seminar will be offered regarding Cygwin/X

71 More Information For supercomputer issues (sgi1, sgi2)
For SoE /UNIX accounts, VPN ECS Help Desk

72 Acknowledgement Some materials in this presentation are based on seminar notes prepared by Sue Lipsky and other Booth Research Center technical staff Jerry Peek et al, UNIX Power Tools, 2nd, O’Reilly, 1997


Download ppt "An Introduction to Linux for Windows Users"

Similar presentations


Ads by Google