CS395T: Introduction to Scientific and Technical Computing
|
|
- James Johns
- 6 years ago
- Views:
Transcription
1 CS395T: Introduction to Scientific and Technical Computing Instructors: Dr. Karl W. Schulz, Research Associate, TACC Dr. Bill Barth, Research Associate, TACC
2 Outline Continue with Unix overview File attributes and permissions Basic commands Pattern matching, regular expressions Shell scripting
3 UNIX Command Examples Remember the ls l command to show long listings? /export/home/rob % ls -l total 26 drwxr-xr-x 2 rob users 512 Nov 2 15:09 bin/ drwx rob users 512 Nov 1 09:19 my_data/ -rw rob users 343 Dec 5 13:51 data.fasta The long listing displays specific attributes about each file or directory.
4 File Attributes Every file has a specific list of attributes: Access Times: when the file was created when the file was last changed when the file was last read Size Owners user (remember UID) group (remember GID) Permissions
5 File Time Attributes Time Attributes: ls -l shows when the file was last changed ls -lc shows when the file was created ls -lu shows when the file was last accessed Special names exist for these date-related attributes: mtime (last modification time) ctime (last change time, ie. when changes were made to the file or directory's inode: owner, permissions, etc. atime (last access time)
6 File Permissions Each file has a set of permissions that control who can access the file There are three different types of permissions: read abbreviated r write abbreviated w execute abbreviated x In Unix, there are permission levels associated with three types of people that might access a file: owner (you) group (a group of other users that you set up) world (anyone else browsing around on the file system)
7 File Permissions Display Format -rwxrwxrwx Owner Group Others The first entry specifies the type of file: - is a plain file d is a directory c is a character device b is a block device l is a symbolic link
8 What is this rwx Craziness? Meaning for Files: r - allowed to read w - allowed to write x - allowed to execute Meaning for Directories: r - allowed to see the names of the files w - allowed to add and remove files x - allowed to enter the directory
9 Changing File Permissions The chmod command changes the permissions associated with a file or directory Basic syntax is: chmod mode file The mode can be specified in two ways: symbolic representation octal number Both methods achieve the same result (user s choice) Multiple symbolic operations can be given, separated by commas
10 chmod: Symbolic Representation Symbolic Mode representation has the following form: [ugoa][+-=][rwxx ] u=user + add permission r=read g=group - remove permission w=write o=other = set permission x=execute a = all X= pure unix gold The X permission option is very handy - it sets to execute only if the file is a directory or already has execute permission
11 chmod Symbolic Mode Examples > ls -al foo -rw karl support... > chmod g=rw foo > ls -al foo -rw-rw karl support... > chmod u-w,g+x,o=x foo > ls -al foo -r--rwx--x 1 karl support...
12 chmod: Octal Representation Octal Mode uses a single argument string which describes the permissions for a file (3 digits) Each digit of this number is a code for each of the three permission levels (user,group,world) Permissions are set according to the following numbers: Read = 4 Write = 2 Execute = 1 0 = no permissions whatsoever; 1 = execute only 2 = write only 3 = write and execute (1+2) 4 = read only 5 = read and execute (4+1) 6 = read and write (4+2) 7 = read and write and execute (4+2+1) Sum the individual permissions to get the desired combination
13 chmod Octal Mode Examples > ls -al foo -rw karl support... > chmod 660 foo > ls -al foo -rw-rw karl support... > chmod 417 foo > ls -al foo -r----xrwx 1 karl support...
14 Basic Commands Some basic commands for interacting with the Unix file system are: ls -pwd -touch cd - cp - mkdir df - awk - rmdir cat -rm -find more (less) -chmod -grep head - tail - chown/chgrp Let s cruise through some examples...
15 UNIX Commands: mkdir mkdir creates directories. /export/home/rob % ls bin/ my_data/ data.fasta backup.fasta /export/home/rob % mkdir new_data /export/home/rob % ls bin/ my_data/ new_data/ data.fasta backup.fasta /export/home/rob %
16 UNIX Commands: rmdir rmdir removes directories. /export/home/rob % ls bin/ my_data/ new_data/ data.fasta backup.fasta /export/home/rob % rmdir my_data /export/home/rob % ls bin/ new_data/ data.fasta backup.fasta /export/home/rob %
17 UNIX Commands: cd cd changes the current directory. /export/home/rob % ls bin/ my_data/ new_data/ /export/home/rob % cd my_data /export/home/rob/mydata % ls data.fasta backup.fasta /export/home/rob/mydata % cd.. /export/home/rob % Note: a cd with no arguments takes you to your HOME directory.
18 UNIX Commands: cat cat displays the contents of a text file: /export/home/rob % cat data.fasta >c01_ amino acids MW=55632 D pi=5.38 numambig=0 MPGGFILAIDEGTTSARAIIYNQDLEVLGIGQYDFPQHYPSPGYVEHNPDEIWNAQMLAI KEAMKKAKIESRQVAGIGVTNQRETTILWDAISGKPIYNAIVWQDRRTSNITDWLKENYF GMIKDKTGLIPDPYFSGSKIKWILDNLPNVRSKAEKGEIKFGTIDTYLIWKLTNGKIHVT IGITRGTTKAHIARAILESIAYQNRDVIEIMEKESGTKINILKVDGGGAKDNLLMQFQAD ILGIRVVRPKVMETASMGVAMLAGLAINYWNSLNELKQKWTVDKEFIPSINKEERERRYN AWKEAVKRSLGWEKSLGSK* /export/home/rob %
19 UNIX Commands: more more displays the contents of a text file one screen s worth at a time: /export/home/rob % more data.fasta >c01_ amino acids MW=55632 D pi=5.38 numambig=0 MPGGFILAIDEGTTSARAIIYNQDLEVLGIGQYDFPQHYPSPGYVEHNPDEIWNAQMLAI KEAMKKAKIESRQVAGIGVTNQRETTILWDAISGKPIYNAIVWQDRRTSNITDWLKENYF GMIKDKTGLIPDPYFSGSKIKWILDNLPNVRSKAEKGEIKFGTIDTYLIWKLTNGKIHVT IGITRGTTKAHIARAILESIAYQNRDVIEIMEKESGTKINILKVDGGGAKDNLLMQFQAD ILGIRVVRPKVMETASMGVAMLAGLAINYWNSLNELKQKWTVDKEFIPSINKEERERRYN AWKEAVKRSLGWEKSLGSKLPNVRSKAEKGEIKFGTIDTYLIWKLTNGRDVIEIMEKESG TKINILKVDGGGAKDNLLMQFQILDNLPNVRSKAEKGEIKFGTIDTYLIWKLTNGTSAIG AHIARAILESIAYQNRDVIEIMEKESGTKINILKVDGGGAKDNLLMQFQADTDWLKENYF LGWEKSLGSKLPNVRSKAEKGEIKFGTIDTYLIWKLTNGRDVIEIMIKFGTIDTYLIWTG GMIKDKTGLIPDPYFSGSKIKWILDNLPNVRSKAEKGEIKFGTIDTYLIWKLTNGKIHVT IGITRGTTKAHIARAILESIAYQNRDVIEIMEKESGTKINILKVDGGGAKDNLLMQFQAD DKTGLIPDPYFSGSKIKWILDNLPNVRSKAEKGEIGVAMLAGLAINYWNSLNELKFKIHE NILKVDGGGAKDNLLMQFQILDNLPNVRSKAEKGEIKFGTIDTYLFQFQILDNLPNVRSK AEKGEIKFGTIDTYLIWILDVIEIMEKESGTKINILKVDGGGKVDGGIAYQNRDVIEIME LWDAISGKPIYNDNLPNVRSKAEKGEIGVAMLAGLAINNLPNVRSKAEKGEIGKGEIGVA --More--(75%) Notes: hit <space> to see the next page hit q to quit, / to search, read the man page. less is an enhanced version of more on Linux
20 UNIX Commands: cp cp copies files /export/home/rob % ls bin/ my_data/ data.fasta /export/home/rob % cp data.fasta backup.fasta /export/home/rob % ls bin/ my_data/ data.fasta /export/home/rob % backup.fasta
21 UNIX Commands: mv mv moves files /export/home/rob % ls bin/ my_data/ data.fasta /export/home/rob % mv backup.fasta my_data /export/home/rob % ls bin/ my_data/ data.fasta /export/home/rob % ls my_data backup.fasta /export/home/rob % backup.fasta
22 UNIX Commands: mv mv also renames files /export/home/rob % ls bin/ my_data/ data.fasta /export/home/rob % mv backup.fasta my_data /export/home/rob % ls bin/ my_data/ data.fasta /export/home/rob % ls my_data backup.fasta /export/home/rob % mv data.fasta Dec15.fasta /export/home/rob % ls bin/ my_data/ Dec15.fasta /export/home/rob % backup.fasta
23 UNIX Commands: rm rm deletes files - permanantly. /export/home/rob % ls bin/ my_data/ data.fasta /export/home/rob % rm backup.fasta /export/home/rob % ls bin/ my_data/ data.fasta /export/home/rob % backup.fasta Note: There is no Recycle bin or Undelete Key! Thou shalt know what thou are doing...
24 UNIX Commands: head & tail head displays the top of a file head -n displays the top n lines default is 10 tail displays the bottom of a file tail -n displays the bottom n lines default is 10 tail +n displays the file starting at line n
25 UNIX Commands: id /export/home/rob> id uid=1003(rob) gid=10(staff) Use id to see your uid and gid for the default group.
26 UNIX Commands: groups /export/home/rob> id uid=1003(rob) gid=10(staff) /export/home/rob> groups staff sysadmin wwwdevel Use groups to see all the group names to which you belong.
27 UNIX Commands: chgrp /export/home/rob> ls -l total 0 -rwxr--r-- 1 rob staff 0 Sep 17 20:02 lasagne /export/home/rob> chgrp sysadmin lasagne /export/home/rob> ls -l total 0 -rwxr--r-- 1 rob sysadmin 0 Sep 17 20:02 lasagne Use chgrp to change group ownership
28 UNIX Commands: find At its simplest, find searches the filesystem for files whose name matches a specific pattern However, it can do a lot more and is one of the most useful commands in Unix (as it can find specific files and then perform operations on them) Here is a simple example: > ls dir1 foo foo2 > find. -name foo -print./foo
29 UNIX Commands: grep grep extracts lines from a file that match a given string or pattern /export/home/rob> cat sequence.fas >c01_ amino acids MW=55632 D pi=5.38 numambig=0 MPGGFILAIDEGTTSARAIIYNQDLEVLGIGQYDFPQHYPSPGYVEHNPDEIWNAQMLAI KEAMKKAKIESRQVAGIGVTNQRETTILWDAISGKPIYNAIVWQDRRTSNITDWLKENYF DYSNASRTMLFNINKLEWDREILELLKIPESILPEVRPSSDIYGYTEVLGSSIPISGDAG DQQAALFGQVAYDMGEVKSTYGTGSFILMNIGSNPIFSENLLTTIAWGLESKRVTYALEG SIFITGAAVQWFRDGLGREPKICKSBUTTASVPDTGGVYFVPAFVGLGAPYWDPYARGLI IGITRGTTKAHIARAILESIAYQNRDVIEIMEKESGTKINILKVDGGGAKDNLLMQFQAD ILGIRVVRPKVMETASMGVAMLAGLAINYWNSLNELKQKWTVDKEFIPSINKEERERRYN AWKEAVKRSLGWEKSLGSK* /export/home/rob> grep AA sequence.fas DQQAALFGQVAYDMGEVKSTYGTGSFILMNIGSNPIFSENLLTTIAWGLESKRVTYALEG SIFITGAAVQWFRDGLGREPKICKSBUTTASVPDTGGVYFVPAFVGLGAPYWDPYARGLI grep can also use a regular expression for the pattern to search
30 Regular Expressions In addition to grep, a number of Unix commands support the use of regular expressions to describe patterns: sed awk perl General search pattern characters: Any character (except a metacharacter) matches itself. matches any character except a newline * matches zero or more occurrences of the single preceding character + matches one or more of the proceeding character? matches zero or one of the proceeding character Additional special characters: () parentheses are used to quantify a sequence of characters works as an OR operator {} braces are used to indicate ranges in the number of occurrences
31 Regular Expressions If you really want to match a period '.', you need to escape it with a backslash "\." Regexp Matches Does not match a.b axb abc a\.b a.b axb
32 Regular Expressions A character class, also called a character set can be used to match only one out of several characters To use, simply place the characters you want to match between square brackets [] You can use a hyphen inside a character class to specify a range of characters Placing a caret (^) after the opening square bracket will negate the character class. The result is that the character class will match any character that is not in the character class Examples: [abc] matches a single a b or c [0-9] matches a single digit between 0 and 9 [^A-Za-z] matches a single character as long as it is not a letter
33 Regular Expressions Since certain character classes are used often, a series of shorthand character classes are available for convenience: \d a digit. eg [0-9] \D a non-digit, eg. [^0-9] \w a word character (matches letters and digits) \W a non-word character \s a whitespace character \S a non-whitespace character
34 Regular Expressions More shorthand classes are available for matching boundaries: ^ the beginning of a line $ the end of a line \b a word boundary \B a non-word boundary \A the beginning of the input \z the end of the input
35 Regular Expressions Examples notice a string that has the text "notice" in it F. matches an F followed by any character a.b matches a followed by any 1 char followed by b ^The matches any string that starts with "The" oh boy$ matches a string that ends in the substring "oh boy"; ^abc$ matches a string that starts and ends with "abc" -- that could only be "abc" itself! ab* matches an a followed by zero or more b 's ("a", "ab", "abbb", etc.) ab+ similar to previous, but there's at least one b ("ab", "abbb", etc.) (b cd)ef matches a string that has either "bef" or "cdef" a(bc)* ab{3,5} or "abbbbb") [Dd][Aa][Vv][Ee] matches an a followed by zero or more copies of the sequence "bc" matches an a followed by three to five b 's ("abbb", "abbbb", matches "Dave" or "dave" or "dave, does not match "ave" or "da"
36 UNIX Commands: grep grep extracts lines from a file that match a given string or pattern /export/home/rob> cat sequence.fas >c01_ amino acids MW=55632 D pi=5.38 numambig=0 MPGGFILAIDEGTTSARAIIYNQDLEVLGIGQYDFPQHYPSPGYVEHNPDEIWNAQMLAI KEAMKKAKIESRQVAGIGVTNQRETTILWDAISGKPIYNAIVWQDRRTSNITDWLKENYF DYSNASRTMLFNINKLEWDREILELLKIPESILPEVRPSSDIYGYTEVLGSSIPISGDAG DQQAALFGQVAYDMGEVKSTYGTGSFILMNIGSNPIFSENLLTTIAWGLESKRVTYALEG SIFITGAAVQWFRDGLGREPKICKSBUTTASVPDTGGVYFVPAFVGLGAPYWDPYARGLI IGITRGTTKAHIARAILESIAYQNRDVIEIMEKESGTKINILKVDGGGAKDNLLMQFQAD ILGIRVVRPKVMETASMGVAMLAGLAINYWNSLNELKQKWTVDKEFIPSINKEERERRYN AWKEAVKRSLGWEKSLGSK* /export/home/rob> grep '[ST].[RK]' sequence.fas MPGGFILAIDEGTTSARAIIYNQDLEVLGIGQYDFPQHYPSPGYVEHNPDEIWNAQMLAI KEAMKKAKIESRQVAGIGVTNQRETTILWDAISGKPIYNAIVWQDRRTSNITDWLKENYF DQQAALFGQVAYDMGEVKSTYGTGSFILMNIGSNPIFSENLLTTIAWGLESKRVTYALEG IGITRGTTKAHIARAILESIAYQNRDVIEIMEKESGTKINILKVDGGGAKDNLLMQFQAD a regular expression search
37 Interacting with the Shell
38 Running a Unix Program Typically, you type in the name of a program and some command line options The shell reads this line, finds the program and runs it, feeding it the options you specified The shell establishes 3 separate I/O streams: Standard Input Standard Output Standard Error
39 Programs and Standard I/O Standard Input (STDIN) Program Standard Output (STDOUT) Note: File descriptors are associated with each stream 0=STDIN 1=STDOUT 2=STDERR Standard Error (STDERR)
40 Defaults for I/O When a shell runs a program for you: standard input is your keyboard standard output is your screen or window standard error is your screen or window If standard input is your keyboard, you can type stuff in that goes to a program To end the input you press Ctrl-D (^D) on a line by itself, this ends the input stream The shell is a program that reads from standard input Any idea what happens when you give the shell ^D?
41 UNIX: Shell Flavors There are two main flavors of shells: Bourne created what is now known as the standard shell: sh, or bourne shell. It s syntax roughly resembles Pascal. It s derivatives include ksh ( korn shell ) and now, the most widely used, bash ( bourne again shell ) One of the creators of the C language implemented a shell to have a C-programming like syntax. This is called csh or C-shell. Today s most widely used form is the very popular tcsh Shells can run interactively or as a shell script
42 Customization Each shell supports some customization. user prompt settings environment variable settings aliases The customization takes place in startup files which are read by the shell when it starts up Global files are read first - these are provided by the system administrators (eg. /etc/profile) Local files are then read in the user s HOME directory to allow for additional customization
43 Shell Startup Files sh,ksh: ~/.profile bash: ~/.bash_profile ~/.bash_login ~/.profile ~/.bashrc ~/.bash_logout csh: ~/.cshrc ~/.login ~/.logout tcsh: ~/.tshrc ~/.cshrc ~/.login ~/.logout Note: on TACC production systems, we provide an alternative location for customization files to avoid over-riding system defaults: BASH: ~/.profile_user CSH/TCSH: ~/.login_user ~/.cshrc_user
44 Wildcards for Filename Abbreviation When you type in a command line the shell treats some characters as special (metacharacters) These special characters make it easy to specify filenames The shell processes what you give it, using the special characters to replace your command line with one that includes a bunch of file names
45 The special character * * matches anything. If you give the shell * by itself (as a command line argument), the shell will remove the * and replace it with all the filenames in the current directory. a*b matches all files in the current directory that start with a and end with b.
46 Understanding * The echo command prints out whatever you tell it: > echo hi hi > ls dir1 foo foo2 What will the following command do? > echo * dir1 foo foo2
47 Shell Stream Redirection A very powerful function in Unix is redirection for input and output: The shell can attach things other than your keyboard to standard input (stdin) A file (the contents of the file are fed to a program as if you typed it) - common in scientific programming A pipe (the output of another program is fed as input as if you typed it) The shell can attach things other than your screen to standard output (stderr) A file (the output of a program is stored in file) A pipe (the output of a program is fed as input to another program
48 Stream Redirection To tell the shell to store the output of your program in a file, follow the command line for the program with the > character followed by the filename: ls > lsout The command above will create a file named lsout and place the output of the ls command in the file
49 Stream Redirection To have the shell get standard input from a file, use the < character: sort < nums The command above would sort the lines in the file nums and send the result to stdout Beauty of redirection is that you can do both forms together: sort < nums > sortednums
50 Modes of Output Redirection There are two modes of output redirections: > the create mode >> the append mode For example: the command ls > foo will create a new file named foo (deleting any existing file named foo). if you use >> instead, the output will be appended to foo: ls /etc >> foo ls /usr >> foo
51 Stream Redirection Many commands send error messages to standard error (stderr) which is different from stdout. However, the > output redirection only applies to stdout (not stderr) To redirect stderr to a file you need to know what shell you are using: BASH 2> redirects stderr (eg. ls foo blah gork 2> erroroutput ) &> redirects stdout and stderr (eg. ls foo &> /dev/null ) TCSH >& merges stdout and stderr and sends to a file: ls foo blah >& saveboth >>& merges stdout and stderr and appends to a file: ls foo blah >>& saveboth
52 References/Acknowledgements National Research Council Canada (Rob Hutten, Canadian Bioinformatics Resource) Intro. to Unix, Dave Hollinger, Rensselaer Polytechnic Institute Unix in a Nutshell, A. Robbins, O Reilly Media, Regular expression info (
Crash Course in Unix. For more info check out the Unix man pages -orhttp://www.cs.rpi.edu/~hollingd/unix. -or- Unix in a Nutshell (an O Reilly book).
Crash Course in Unix For more info check out the Unix man pages -orhttp://www.cs.rpi.edu/~hollingd/unix -or- Unix in a Nutshell (an O Reilly book). 1 Unix Accounts To access a Unix system you need to have
More informationTable of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs
Summer 2010 Department of Computer Science and Engineering York University Toronto June 29, 2010 1 / 36 Table of contents 1 2 3 4 2 / 36 Our goal Our goal is to see how we can use Unix as a tool for developing
More informationCS246 Spring14 Programming Paradigm Notes on Linux
1 Unix History 1965: Researchers from Bell Labs and other organizations begin work on Multics, a state-of-the-art interactive, multi-user operating system. 1969: Bell Labs researchers, losing hope for
More informationUnix Handouts. Shantanu N Kulkarni
Unix Handouts Shantanu N Kulkarni Abstract These handouts are meant to be used as a study aid during my class. They are neither complete nor sincerely accurate. The idea is that the participants should
More informationThe UNIX Shells. Computer Center, CS, NCTU. How shell works. Unix shells. Fetch command Analyze Execute
Shells The UNIX Shells How shell works Fetch command Analyze Execute Unix shells Shell Originator System Name Prompt Bourne Shell S. R. Bourne /bin/sh $ Csh Bill Joy /bin/csh % Tcsh Ken Greer /bin/tcsh
More informationEECS2301. Lab 1 Winter 2016
EECS2301 Lab 1 Winter 2016 Lab Objectives In this lab, you will be introduced to the Linux operating system. The basic commands will be presented in this lab. By the end of you alb, you will be asked to
More informationIntroduction to Linux
Introduction to Linux January 2011 Don Bahls User Consultant (Group Leader) bahls@arsc.edu (907) 450-8674 Overview The shell Common Commands File System Organization Permissions Environment Variables I/O
More informationBasic Linux (Bash) Commands
Basic Linux (Bash) Commands Hint: Run commands in the emacs shell (emacs -nw, then M-x shell) instead of the terminal. It eases searching for and revising commands and navigating and copying-and-pasting
More informationIntroduction: What is Unix?
Introduction Introduction: What is Unix? An operating system Developed at AT&T Bell Labs in the 1960 s Command Line Interpreter GUIs (Window systems) are now available Introduction: Unix vs. Linux Unix
More informationA Brief Introduction to Unix
A Brief Introduction to Unix Sean Barag Drexel University March 30, 2011 Sean Barag (Drexel University) CS 265 - A Brief Introduction to Unix March 30, 2011 1 / 17 Outline 1 Directories
More informationPerl and R Scripting for Biologists
Perl and R Scripting for Biologists Lukas Mueller PLBR 4092 Course overview Linux basics (today) Linux advanced (Aure, next week) Why Linux? Free open source operating system based on UNIX specifications
More informationEssential Linux Shell Commands
Essential Linux Shell Commands Special Characters Quoting and Escaping Change Directory Show Current Directory List Directory Contents Working with Files Working with Directories Special Characters There
More information5/20/2007. Touring Essential Programs
Touring Essential Programs Employing fundamental utilities. Managing input and output. Using special characters in the command-line. Managing user environment. Surveying elements of a functioning system.
More informationWeek 2 Lecture 3. Unix
Lecture 3 Unix Terminal and Shell 2 Terminal Prompt Command Argument Result 3 Shell Intro A system program that allows a user to execute: shell functions (e.g., ls -la) other programs (e.g., eclipse) shell
More informationLinux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester
Linux Essentials Programming and Data Structures Lab M Tech CS First Year, First Semester Adapted from PDS Lab 2014 and 2015 Login, Logout, Password $ ssh mtc16xx@192.168.---.--- $ ssh X mtc16xx@192.168.---.---
More informationOperating Systems. Copyleft 2005, Binnur Kurt
3 Operating Systems Copyleft 2005, Binnur Kurt Content The concept of an operating system. The internal architecture of an operating system. The architecture of the Linux operating system in more detail.
More informationOperating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing
Content 3 Operating Systems The concept of an operating system. The internal architecture of an operating system. The architecture of the Linux operating system in more detail. How to log into (and out
More informationIntroduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines
Introduction to UNIX Logging in Basic system architecture Getting help Intro to shell (tcsh) Basic UNIX File Maintenance Intro to emacs I/O Redirection Shell scripts Logging in most systems have graphical
More informationAssume that username is cse. The user s home directory will be /home/cse. You may remember what the relative pathname for users home directory is: ~
Introduction to Open Source Software Development Spring semester, 2017 School of Computer Science and Engineering, Pusan National University Joon-Seok Kim LINUX: COMMANDS Review Lab #1 2 Create Directories
More information3/8/2017. Unix/Linux Introduction. In this part, we introduce. What does an OS do? Examples
EECS2301 Title Unix/Linux Introduction These slides are based on slides by Prof. Wolfgang Stuerzlinger at York University Warning: These notes are not complete, it is a Skelton that will be modified/add-to
More informationMills HPC Tutorial Series. Linux Basics I
Mills HPC Tutorial Series Linux Basics I Objectives Command Line Window Anatomy Command Structure Command Examples Help Files and Directories Permissions Wildcards and Home (~) Redirection and Pipe Create
More informationCSCI 2132 Software Development. Lecture 5: File Permissions
CSCI 2132 Software Development Lecture 5: File Permissions Instructor: Vlado Keselj Faculty of Computer Science Dalhousie University 14-Sep-2018 (5) CSCI 2132 1 Files and Directories Pathnames Previous
More informationUsing UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program
Using UNIX. UNIX is mainly a command line interface. This means that you write the commands you want executed. In the beginning that will seem inferior to windows point-and-click, but in the long run the
More information(a) About Unix. History
Part 1: The Unix Operating System (a) About Unix History First roots in the Bell Laboratories, early 60s Kernel rewrite in C by Ritchie / Thompson in the early 70s Source code licenses for Universities
More informationIntroduction to Unix: Fundamental Commands
Introduction to Unix: Fundamental Commands Ricky Patterson UVA Library Based on slides from Turgut Yilmaz Istanbul Teknik University 1 What We Will Learn The fundamental commands of the Unix operating
More informationEECS 2031E. Software Tools Prof. Mokhtar Aboelaze
EECS 2031 Software Tools Prof. Mokhtar Aboelaze Footer Text 1 EECS 2031E Instructor: Mokhtar Aboelaze Room 2026 CSEB lastname@cse.yorku.ca x40607 Office hours TTH 12:00-3:00 or by appointment 1 Grading
More informationCS395T: Introduction to Scientific and Technical Computing
CS395T: Introduction to Scientific and Technical Computing Instructors: Dr. Karl W. Schulz, Research Associate, TACC Dr. Bill Barth, Research Associate, TACC Outline What is Unix anyway? historical background
More informationLecture 3. Unix. Question? b. The world s best restaurant. c. Being in the top three happiest countries in the world.
Lecture 3 Unix Question? Denmark is famous for? a. LEGO. b. The world s best restaurant. c. Being in the top three happiest countries in the world. d. Having the highest taxes in Europe (57%). e. All of
More informationUNIX Shell Programming
$!... 5:13 $$ and $!... 5:13.profile File... 7:4 /etc/bashrc... 10:13 /etc/profile... 10:12 /etc/profile File... 7:5 ~/.bash_login... 10:15 ~/.bash_logout... 10:18 ~/.bash_profile... 10:14 ~/.bashrc...
More informationITST Searching, Extracting & Archiving Data
ITST 1136 - Searching, Extracting & Archiving Data Name: Step 1 Sign into a Pi UN = pi PW = raspberry Step 2 - Grep - One of the most useful and versatile commands in a Linux terminal environment is the
More informationWhen talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used:
Linux Tutorial How to read the examples When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used: $ application file.txt
More informationLec 1 add-on: Linux Intro
Lec 1 add-on: Linux Intro Readings: - Unix Power Tools, Powers et al., O Reilly - Linux in a Nutshell, Siever et al., O Reilly Summary: - Linux File System - Users and Groups - Shell - Text Editors - Misc
More informationContents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...
Contents Note: pay attention to where you are........................................... 1 Note: Plaintext version................................................... 1 Hello World of the Bash shell 2 Accessing
More informationCSC209H Lecture 1. Dan Zingaro. January 7, 2015
CSC209H Lecture 1 Dan Zingaro January 7, 2015 Welcome! Welcome to CSC209 Comments or questions during class? Let me know! Topics: shell and Unix, pipes and filters, C programming, processes, system calls,
More informationUseful Unix Commands Cheat Sheet
Useful Unix Commands Cheat Sheet The Chinese University of Hong Kong SIGSC Training (Fall 2016) FILE AND DIRECTORY pwd Return path to current directory. ls List directories and files here. ls dir List
More informationBasic UNIX commands. HORT Lab 2 Instructor: Kranthi Varala
Basic UNIX commands HORT 59000 Lab 2 Instructor: Kranthi Varala Client/Server architecture User1 User2 User3 Server (UNIX/ Web/ Database etc..) User4 High Performance Compute (HPC) cluster User1 Compute
More informationUnix as a Platform Exercises + Solutions. Course Code: OS 01 UNXPLAT
Unix as a Platform Exercises + Solutions Course Code: OS 01 UNXPLAT Working with Unix Most if not all of these will require some investigation in the man pages. That's the idea, to get them used to looking
More informationWelcome to Linux. Lecture 1.1
Welcome to Linux Lecture 1.1 Some history 1969 - the Unix operating system by Ken Thompson and Dennis Ritchie Unix became widely adopted by academics and businesses 1977 - the Berkeley Software Distribution
More informationOutline. Structure of a UNIX command
Outline Structure of Unix Commands Command help (man) Log on (terminal vs. graphical) System information (utility) File and directory structure (path) Permission (owner, group, rwx) File and directory
More informationcommandname flags arguments
Unix Review, additional Unix commands CS101, Mock Introduction This handout/lecture reviews some basic UNIX commands that you should know how to use. A more detailed description of this and other commands
More informationIntroduction to Linux
Introduction to Linux M Tech CS I 2015-16 Arijit Bishnu Debapriyo Majumdar Sourav Sengupta Mandar Mitra Login, Logout, Change password $ ssh, ssh X secure shell $ ssh www.isical.ac.in $ ssh 192.168 $ logout,
More informationCISC 220 fall 2011, set 1: Linux basics
CISC 220: System-Level Programming instructor: Margaret Lamb e-mail: malamb@cs.queensu.ca office: Goodwin 554 office phone: 533-6059 (internal extension 36059) office hours: Tues/Wed/Thurs 2-3 (this week
More informationAnswers to AWK problems. Shell-Programming. Future: Using loops to automate tasks. Download and Install: Python (Windows only.) R
Today s Class Answers to AWK problems Shell-Programming Using loops to automate tasks Future: Download and Install: Python (Windows only.) R Awk basics From the command line: $ awk '$1>20' filename Command
More informationBasic Survival UNIX.
Basic Survival UNIX Many Unix based operating systems make available a Graphical User Interface for the sake of providing an easy way for less experienced users to work with the system. Some examples are
More informationChapter 9. Shell and Kernel
Chapter 9 Linux Shell 1 Shell and Kernel Shell and desktop enviroment provide user interface 2 1 Shell Shell is a Unix term for the interactive user interface with an operating system A shell usually implies
More informationCSCI 2132 Software Development. Lecture 4: Files and Directories
CSCI 2132 Software Development Lecture 4: Files and Directories Instructor: Vlado Keselj Faculty of Computer Science Dalhousie University 12-Sep-2018 (4) CSCI 2132 1 Previous Lecture Some hardware concepts
More informationUnix Filesystem. January 26 th, 2004 Class Meeting 2
Unix Filesystem January 26 th, 2004 Class Meeting 2 * Notes adapted by Christian Allgood from previous work by other members of the CS faculty at Virginia Tech Unix Filesystem! The filesystem is your interface
More informationIntroduction to UNIX Part II
T H E U N I V E R S I T Y of T E X A S H E A L T H S C I E N C E C E N T E R A T H O U S T O N S C H O O L of H E A L T H I N F O R M A T I O N S C I E N C E S Introduction to UNIX Part II For students
More informationFiles and Directories
CSCI 2132: Software Development Files and Directories Norbert Zeh Faculty of Computer Science Dalhousie University Winter 2019 Files and Directories Much of the operation of Unix and programs running on
More informationOperating Systems. Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000) alphapeeler.sf.net/pubkeys/pkey.htm
Operating Systems Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000) armahmood786@yahoo.com alphasecure@gmail.com alphapeeler.sf.net/pubkeys/pkey.htm http://alphapeeler.sourceforge.net pk.linkedin.com/in/armahmood
More informationUnix basics exercise MBV-INFX410
Unix basics exercise MBV-INFX410 In order to start this exercise, you need to be logged in on a UNIX computer with a terminal window open on your computer. It is best if you are logged in on freebee.abel.uio.no.
More informationFiles
http://www.cs.fsu.edu/~langley/cop3353-2013-1/reveal.js-2013-02-11/02.html?print-pdf 02/11/2013 10:55 AM Files A normal "flat" file is a collection of information. It's usually stored somewhere reasonably
More informationScazLab. Linux Scripting. Core Skills That Every Roboticist Must Have. Alex Litoiu Thursday, November 14, 13
Linux Scripting Core Skills That Every Roboticist Must Have Alex Litoiu alex.litoiu@yale.edu 1 Scazlab Topics Covered Linux Intro - Basic Concepts Advanced Bash Scripting - Job scheduling - File system
More informationIntroduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p.
Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p. 2 Conventions Used in This Book p. 2 Introduction to UNIX p. 5 An Overview
More informationChapter 1 - Introduction. September 8, 2016
Chapter 1 - Introduction September 8, 2016 Introduction Overview of Linux/Unix Shells Commands: built-in, aliases, program invocations, alternation and iteration Finding more information: man, info Help
More informationUnderstanding bash. Prof. Chris GauthierDickey COMP 2400, Fall 2008
Understanding bash Prof. Chris GauthierDickey COMP 2400, Fall 2008 How does bash start? It begins by reading your configuration files: If it s an interactive login-shell, first /etc/profile is executed,
More informationCommand-line interpreters
Command-line interpreters shell Wiki: A command-line interface (CLI) is a means of interaction with a computer program where the user (or client) issues commands to the program in the form of successive
More informationUNIX File Hierarchy: Structure and Commands
UNIX File Hierarchy: Structure and Commands The UNIX operating system organizes files into a tree structure with a root named by the character /. An example of the directory tree is shown below. / bin
More informationExploring UNIX: Session 3
Exploring UNIX: Session 3 UNIX file system permissions UNIX is a multi user operating system. This means several users can be logged in simultaneously. For obvious reasons UNIX makes sure users cannot
More informationUnix as a Platform Exercises. Course Code: OS-01-UNXPLAT
Unix as a Platform Exercises Course Code: OS-01-UNXPLAT Working with Unix 1. Use the on-line manual page to determine the option for cat, which causes nonprintable characters to be displayed. Run the command
More informationUnix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech
Unix File System Class Meeting 2 * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech Unix File System The file system is your interface to: physical
More informationIntroduction to the Linux Command Line
Introduction to the Linux Command Line May, 2015 How to Connect (securely) ssh sftp scp Basic Unix or Linux Commands Files & directories Environment variables Not necessarily in this order.? Getting Connected
More informationScripting Languages Course 1. Diana Trandabăț
Scripting Languages Course 1 Diana Trandabăț Master in Computational Linguistics - 1 st year 2017-2018 Today s lecture Introduction to scripting languages What is a script? What is a scripting language
More informationLinux Refresher (1) 310/ Fourth Workshop on Distributed Laboratory Instrumentation Systems (30 October - 24 November 2006)
310/1779-4 Fourth Workshop on Distributed Laboratory Instrumentation Systems (30 October - 24 November 2006) Linux Refresher (1) Razaq Babalola IJADUOLA These lecture notes are intended only for distribution
More informationsottotitolo A.A. 2016/17 Federico Reghenzani, Alessandro Barenghi
Titolo presentazione Piattaforme Software per la Rete sottotitolo BASH Scripting Milano, XX mese 20XX A.A. 2016/17, Alessandro Barenghi Outline 1) Introduction to BASH 2) Helper commands 3) Control Flow
More informationLecture 4. Log into Linux Reminder: Homework 1 due today, 4:30pm Homework 2 out, due next Tuesday Project 1 out, due next Thursday Questions?
Lecture 4 Log into Linux Reminder: Homework 1 due today, 4:30pm Homework 2 out, due next Tuesday Project 1 out, due next Thursday Questions? Tuesday, September 7 CS 375 UNIX System Programming - Lecture
More informationIntroduction to Unix and Linux. Workshop 1: Directories and Files
Introduction to Unix and Linux Workshop 1: Directories and Files Genomics Core Lab TEXAS A&M UNIVERSITY CORPUS CHRISTI Anvesh Paidipala, Evan Krell, Kelly Pennoyer, Chris Bird Genomics Core Lab Informatics
More informationMultiple Choice - 58 Questions - 10 of 15%
CST 8129 Ian Allen Fall 2005-1- 110 minutes Evaluation: Part I - 58 M/C Questions Name: Important Instructions 1. Read all the instructions and both sides (back and front) of all pages. 2. Manage your
More informationLinux for Beginners. Windows users should download putty or bitvise:
Linux for Beginners Windows users should download putty or bitvise: https://putty.org/ Brief History UNIX (1969) written in PDP-7 assembly, not portable, and designed for programmers as a reaction by Bell
More informationIntroduction to Linux
Introduction to Linux Phil Mercurio The Scripps Research Institute mercurio@scripps.edu 1 Session Overview What is Linux Shells & Windows The Linux File System Assorted Commands 2 What Is Linux? Linux
More informationCSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209
CSC209 Software Tools and Systems Programming https://mcs.utm.utoronto.ca/~209 What is this Course About? Software Tools Using them Building them Systems Programming Quirks of C The file system System
More informationIntroduction to Linux Workshop 1
Introduction to Linux Workshop 1 The George Washington University SEAS Computing Facility Created by Jason Hurlburt, Hadi Mohammadi, Marco Suarez hurlburj@gwu.edu Logging In The lab computers will authenticate
More informationModule 8 Pipes, Redirection and REGEX
Module 8 Pipes, Redirection and REGEX Exam Objective 3.2 Searching and Extracting Data from Files Objective Summary Piping and redirection Partial POSIX Command Line and Redirection Command Line Pipes
More informationCS4350 Unix Programming. Outline
Outline Unix Management Files and file systems Structure of Unix Commands Command help (man) Log on (terminal vs. graphical) System information (utility) File and directory structure (path) Permission
More informationAppendix B WORKSHOP. SYS-ED/ Computer Education Techniques, Inc.
Appendix B WORKSHOP SYS-ED/ Computer Education Techniques, Inc. 1 Introduction There are no workshops for this chapter. The instructor will provide demonstrations and examples. SYS-ED/COMPUTER EDUCATION
More informationLinux shell programming for Raspberry Pi Users - 2
Linux shell programming for Raspberry Pi Users - 2 Sarwan Singh Assistant Director(S) NIELIT Chandigarh 1 SarwanSingh.com Education is the kindling of a flame, not the filling of a vessel. - Socrates SHELL
More informationPractical 4. Linux Commands: Working with Directories
Practical 4 Linux Commands: Working with Directories 1. pwd: pwd stands for Print Working Directory. As the name states, command pwd prints the current working directory or simply the directory user is,
More informationCSCI 2132 Software Development. Lecture 3: Unix Shells and Other Basic Concepts
CSCI 2132 Software Development Lecture 3: Unix Shells and Other Basic Concepts Instructor: Vlado Keselj Faculty of Computer Science Dalhousie University 10-Sep-2018 (3) CSCI 2132 1 Introduction to UNIX
More informationUnix Introduction to UNIX
Unix Introduction to UNIX Get Started Introduction The UNIX operating system Set of programs that act as a link between the computer and the user. Developed in 1969 by a group of AT&T employees Various
More informationCourse 144 Supplementary Materials. UNIX Fundamentals
Course 144 Supplementary Materials UNIX Fundamentals 1 Background to UNIX Command Fundamentals This appendix provides a overview of critical commands and concepts Prerequisite knowledge attendees should
More informationCS 307: UNIX PROGRAMMING ENVIRONMENT KATAS FOR EXAM 1
CS 307: UNIX PROGRAMMING ENVIRONMENT KATAS FOR EXAM 1 Prof. Michael J. Reale Fall 2014 COMMAND KATA 0 Command Kata 0: Preparation First, go to ~/cs307 cd ~/cs307 Make directory dkata0 and go to it mkdir
More informationGetting to grips with Unix and the Linux family
Getting to grips with Unix and the Linux family David Chiappini, Giulio Pasqualetti, Tommaso Redaelli Torino, International Conference of Physics Students August 10, 2017 According to the booklet At this
More informationOxford University Computing Services. Getting Started with Unix
Oxford University Computing Services Getting Started with Unix Unix c3.1/2 Typographical Conventions Listed below are the typographical conventions used in this guide. Names of keys on the keyboard are
More informationToday s Lecture. The Unix Shell. Unix Architecture (simplified) Lecture 3: Unix Shell, Pattern Matching, Regular Expressions
Lecture 3: Unix Shell, Pattern Matching, Regular Expressions Today s Lecture Review Lab 0 s info on the shell Discuss pattern matching Discuss regular expressions Kenneth M. Anderson Software Methods and
More informationSTATS Data Analysis using Python. Lecture 15: Advanced Command Line
STATS 700-002 Data Analysis using Python Lecture 15: Advanced Command Line Why UNIX/Linux? As a data scientist, you will spend most of your time dealing with data Data sets never arrive ready to analyze
More informationStudent Remote Login Procedure (see picture below): 1. Start SSH Secure Shell 2. Click the computer icon (4 th on the toolbar) 3.
Student Remote Login Procedure (see picture below): 1. Start SSH Secure Shell 2. Click the computer icon (4 th on the toolbar) 3. Enter stargate.ncc.edu in the text field labeled Host Name: 4. Enter the
More informationUsing LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12)
Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12) Objective: Learn some basic aspects of the UNIX operating system and how to use it. What is UNIX? UNIX is the operating system used by most computers
More informationbash startup files Linux/Unix files stty Todd Kelley CST8207 Todd Kelley 1
bash startup files Linux/Unix files stty Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 midterms (Feb 27 and April 10) bash startup files More Linux Files review stty 2 We customize our
More informationUnix Tools / Command Line
Unix Tools / Command Line An Intro 1 Basic Commands / Utilities I expect you already know most of these: ls list directories common options: -l, -F, -a mkdir, rmdir make or remove a directory mv move/rename
More informationShell. SSE2034: System Software Experiment 3, Fall 2018, Jinkyu Jeong
Shell Prof. Jinkyu Jeong (Jinkyu@skku.edu) TA -- Minwoo Ahn (minwoo.ahn@csl.skku.edu) TA -- Donghyun Kim (donghyun.kim@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu
More informationProcesses. Shell Commands. a Command Line Interface accepts typed (textual) inputs and provides textual outputs. Synonyms:
Processes The Operating System, Shells, and Python Shell Commands a Command Line Interface accepts typed (textual) inputs and provides textual outputs. Synonyms: - Command prompt - Shell - CLI Shell commands
More informationIntroduction. Let s start with the first set of slides
Tux Wars Class - 1 Table of Contents 1) Introduction to Linux and its history 2) Booting process of a linux system 3) Linux Kernel 4) What is a shell 5) Bash Shell 6) Anatomy of command 7) Let s make our
More informationCSE 303 Lecture 4. users/groups; permissions; intro to shell scripting. read Linux Pocket Guide pp , 25-27, 61-65, , 176
CSE 303 Lecture 4 users/groups; permissions; intro to shell scripting read Linux Pocket Guide pp. 19-20, 25-27, 61-65, 118-119, 176 slides created by Marty Stepp http://www.cs.washington.edu/303/ 1 Lecture
More informationChapter-3. Introduction to Unix: Fundamental Commands
Chapter-3 Introduction to Unix: Fundamental Commands What You Will Learn The fundamental commands of the Unix operating system. Everything told for Unix here is applicable to the Linux operating system
More informationCS 25200: Systems Programming. Lecture 10: Shell Scripting in Bash
CS 25200: Systems Programming Lecture 10: Shell Scripting in Bash Dr. Jef Turkstra 2018 Dr. Jeffrey A. Turkstra 1 Lecture 10 Getting started with Bash Data types Reading and writing Control loops Decision
More informationIntroduction to Linux Organizing Files
Introduction to Linux Organizing Files Computational Science and Engineering North Carolina A&T State University Instructor: Dr. K. M. Flurchick Email: kmflurch@ncat.edu Arranging, Organizing, Packing
More informationLab 2: Linux/Unix shell
Lab 2: Linux/Unix shell Comp Sci 1585 Data Structures Lab: Tools for Computer Scientists Outline 1 2 3 4 5 6 7 What is a shell? What is a shell? login is a program that logs users in to a computer. When
More informationUnix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University
Unix/Linux Basics 1 Some basics to remember Everything is case sensitive Eg., you can have two different files of the same name but different case in the same folder Console-driven (same as terminal )
More informationSystem Programming. Unix Shells
Content : Unix shells by Dr. A. Habed School of Computer Science University of Windsor adlane@cs.uwindsor.ca http://cs.uwindsor.ca/ adlane/60-256 Content Content 1 Introduction 2 Interactive and non-interactive
More informationUnix Shell Environments. February 23rd, 2004 Class Meeting 6
Unix Shell Environments February 23rd, 2004 Class Meeting 6 Shell Characteristics Command-line interface between the user and the system Automatically starts when you log in, waits for user to type in
More information