An Introduction to Linux for Windows Users - PowerPoint PPT Presentation

1 / 60
About This Presentation
Title:

An Introduction to Linux for Windows Users

Description:

Booth Engineering Center for Advanced Technology (BECAT) Seminar. Outline. System ... Journaling file system is a file system which records changes to a journal ... – PowerPoint PPT presentation

Number of Views:57
Avg rating:3.0/5.0
Slides: 61
Provided by: engrU
Category:

less

Transcript and Presenter's Notes

Title: An Introduction to Linux for Windows Users


1
An Introduction to Linux for Windows Users
Booth Engineering Center for Advanced Technology
(BECAT) Seminar
  • http//www.engr.uconn.edu/becat/hpc

2
Outline
  • 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
Equipment
  • SGI Altix 3700 BX2 System (sgi1)
  • 64 Intel Itanium 2 Processors (1.5GHz/4MB)
  • 64 GB RAM
  • SGI Altxi 350 Server (sgi2)
  • 8 Intel Itanium 2 Processors (1.5GHz/6MB)
  • 8 GB RAM
  • SuSE SLES 9/SGI ProPack 4

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

5
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

6
Accessing the System - Putty
7
Accessing the System - Putty
8
Accessing the System - Putty
9
Accessing the System - Putty
10
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

11
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

12
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

13
Transferring Files - WinSCP
14
Transferring Files - WinSCP
15
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.

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

17
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

18
BASH
  • Bash is a command language interpreter
  • Bash is the most popular shell under Linux
  • The prompt , , , gt
  • 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

19
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

20
BASH Startup Script Example
Sample .bashrc export PATHPATH/usr/local/bin
export LD_LIBRARY_PATH/usr/lib/usr/local/lib/u
sr/X11/lib source /opt/intel/cc/9.0/bin/eccvars.s
h 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/ip
pvars64.sh test -s /.alias . /.alias
21
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

22
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

23
BASH
  • Controlling the flow of input and output
  • Redirection
  • To redirect input to come from a specified file
    (instead of stdin), type
  • command lt filename
  • To redirect output to a specified file (instead
    of stdout), type
  • command gt filename
  • Example ls lct gt list.txt

24
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

25
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

26
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

27
Examples of the ps Command
hpc_at_linuxAltixgt ps PID TTY TIME CMD
7032 pts/11 000000 bash 7346 pts/11
000000 ps hpc_at_linuxAltixgt ps -efmore UID
PID PPID C STIME TTY TIME CMD root
1 0 0 Jan22 ? 000014 init
3 root 2 1 0 Jan22 ?
000000 migration/0 root 3 1 0
Jan22 ? 000000 ksoftirqd/0 root
4 1 0 Jan22 ? 000000
migration/1 root 5 1 0 Jan22 ?
000000 ksoftirqd/1 root 6 1 0
Jan22 ? 000002 migration/2 root
7 1 0 Jan22 ? 000000
ksoftirqd/2 root 8 1 0 Jan22 ?
000000 migration/3 root 9 1 0
Jan22 ? 000000 ksoftirqd/3 root
10 1 0 Jan22 ? 000000
migration/4 root 11 1 0 Jan22 ?
000000 ksoftirqd/4 root 12 1 0
Jan22 ? 000000 migration/5
28
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

29
Top
30
Top Options
31
Top
32
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.

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

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

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

36
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

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

38
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

39
The File System ls -l
40
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

41
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)

42
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

43
Changing the Access Rights Symbolically
  • chmod whopermission 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 ux file1
  • Remove execute permission from everyone including
    the owner on the file file2
  • chmod a-x file2

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

45
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

46
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

47
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

48
Example Back Up
49
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

50
Editors - nano
51
Editors - nedit
52
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

53
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

54
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

55
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 -9 -1 terminate all the processes owned by
    you

56
Summary of Useful Commands/Utilities
  • who displays who is logged on
  • which command shows the full path of the
    command

57
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

58
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

59
More Information
  • For supercomputer issues (sgi1, sgi2)
  • hpc_at_engr.uconn.edu
  • http//www.becat.uconn.edu/hpc
  • http//www.engr.uconn.edu/becat/hpc
  • For SoE Email/UNIX accounts, VPN
  • ECS Help Desk
  • help_at_engr.uconn.edu

60
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,
    OReilly, 1997
Write a Comment
User Comments (0)
About PowerShow.com