Finding files and directories (advanced), standard streams, piping
|
|
- Claude Higgins
- 6 years ago
- Views:
Transcription
1 Finding files and directories (advanced), standard streams, piping Laboratory of Genomics & Bioinformatics in Parasitology Department of Parasitology, ICB, USP
2 Finding files or directories When you have lots of fles (potentially thousands!) in you system, fnding that one fle that you hno you have, but cantt remember here, can be a daunting tash There are t o diferent commands for fnding fles in Linux systems: locate find The find command is probably al ays present, hile locate might or might not be installed (although it is common) As The Linux Command Line booh says: locate Find Files The Easy Way find Find Files The Hard Way
3 locate locate fnd fles exclusively by name The locate program performs a rapid database search of path names, and then outputs every name that matches a given query Let s say e ant to fnd every fle that contains.zip in the name (including directories in its path); the command for locate ould be: locate.zip locate, as implied above, uses a pre-made database to looh up names The problem ith that is that a newly created fle ill not be found before the database is updated. Want proof, list the contents lihe this: ls ~jmalves
4 locate As you can see, there is a fle (testtest.zip) ith.zip in the name that as not found by locate That is because the database to locate is only updated at certain intervals typically once a day Thus, any fles created/deleted/renamed/etc. before the next update to the database ill not be seen by locate That, of course, can be a disadvantage The advantage of using the database is the speed of the loohup This was last week! How about now?
5 find The expression that find uses to select fles consists of one or more primaries, each of hich is a separate command line argument find evaluates the expression each time it processes a fle An expression can contain any of the follo ing types of primaries: Options Tests Actions For example: Operators find ~ -maxdepth 3 -name '*.pdf' -and -perm 777 -delete
6 find find ~ -maxdepth 3 -name '*.pdf' -and -perm 777 -delete command (find) option (-maxdepth 3) tests (-name '*.pdf' and -perm 777) action (-delete) path where the search should start (user s home: ~) logical operator (-and)
7 find find ~ -maxdepth 3 -name '*.pdf' -and -perm 777 -delete This search ill: Looh for fles and directories in the user s home directory (and its subdirectories, but ) Go do n at most three subdirectory levels (e.g., it ill search directories ~/dir1/subdir1/ and ~dir1/subdir1/subsub2/, but not ~/dir1/subdir2/subsub1/subsubsubx/) Looh for fles hose names end in.pdf AND hose permissions are 777 Finally, find ill delete fles that satisfy those conditions
8 find some tests -amin, -cmin, -mmin -anewer, -cnewer, -mnewer -atime, -ctime, -mtime -empty -executable -group -name, -iname -inum -newer -nogroup, -nouser -path -perm -readable -regex -samefile -size -type -user -writable etc. etc. etc.
9 find actions -delete -exec, execdir -fls, -ls -print, -fprint -print0, fprint0 -printf, fprintf -ok, -okdir -prune -quit
10 find operators \( \) -not,! -a, -and -o, -or
11 find Let s try! First, log into the remote server ( ) Use find to perform the follo ing searches: find /data/genomas -name '*contigs*' find /data/genomas -iname '*contigs*' find /data/genomas -name 'Try*' find /data/genomas -iname 'Try*' -type f find /data/genomas -iname 'Try*' -type f -exec ls -l {} \; find /data/genomas -iname 'Try*' -type f -exec ls -l {} + Characters lihe ; and ( and ) have special meaning to the shell, so they must be escaped ith a preceding \ (bachslash): \; \( \)
12 find We can group diferent tests in a search command To do that, e use the logical operators mentioned earlier (-and, -or, -not) If no operator is given, -and is applied by default in most cases Grouping is performed ith parantheses, hich have to be escaped (since they have special meaning for the shell) by using a backslash Examples: find /data/ -name '*contigs*' -and -type d find /data/ -name '*contigs*' -type d (same as previous one) find /data/ \( -name 'Try*' -or -name 'Lc*' \) -and -type f find /data/ -iname 'Try*' -not -type d
13 Quiz time! Go to the Moodle site and choose Quiz 17 (beware time limits!)
14 Now you do it! Go to the Moodle site, Practical Exercise 17 Follo the instructions to ans er the questions in the exercise (and beware time limits!) Remember: in the PE, you should do things in practice before ans ering the question!
15 Standard streams Standard streams (for data fo ) are automatically connected input and output communication channels bet een a computer program and its environment, available hen the program begins execution They are considered a special hind of virtual text fles One of the most important concepts in the use of the command line! There are three such streams: Standard input (stdin) Standard output (stdout) Standard error (stderr)
16 Standard streams In most operating systems before UNIX, programs had to be explicitly connected (by the programmer) to the appropriate input and output devices One of the advances introduced by UNIX ere abstract devices, hich eliminated the need for the program to hno (or going into) here data as coming from UNIX also implemented automatic connection of each running program to the standard data streams ( hich tie the program to actual physical devices) Standard input (stdin): here data comes from to enter the program Standard output (stdout): here data goes hen it gets out of the program Standard error (stderr): here program errors (or arnings or diagnostic messages) go to hen issued
17 Standard streams Some programs do not require standard input, e.g., ls, pwd Some others do not require standard output, e.g., mkdir, cd Standard input is represented by number 0 Standard output is represented by number 1 Standard error is represented by number 2
18 By default: Standard streams Standard input (stdin): Standard output (stdout): heyboard screen Standard error (stderr): #0 stdin screen Text terminal Keyboard Process #1 stdout #2 stderr Display
19 Standard streams Let's try! Log into the remote server, in case you ere not there already If you ere in class previously, you must have a program called average hose fle has been placed in your $HOME/bin directory If you dontt have that fle, copy it from ~dummy/bin/ to your home directory The average program accepts data from the standard input and sends its output to standard output Start the program (remember: if itts not in a directory from your $PATH, you must give the relative or absolute path to be able to run it! Also mahe sure your copy of the program has execute permissions for your user) average (or./average or bin/average etc.) Notice that the program started, and it is no aiting for data!
20 Data is coming from the standard input, hich is the keyboard, by default So, type a number, and then ENTER Keep doing that until you are done To signal the end of fle (after all, STDIN is a virtual fle ), press Ctrl+d by itself, at the start of a ne line Since the average program aits for the hole input before performing any calculation, no output appears until the end of input Other programs could behave diferently; for example: head This program return the top 10 (by default) lines of a fle. Try it with STDIN! Enter lines until the program exits
21 Standard streams Just by existing, standard streams are already very useful But the capability of redirection mahes them even more versatile That ay, data can come from (or go to) diferent places than just the heyboard (or the screen) Redirection can be done between a program and input and output fles or between diferent programs This is the main enabler of the modularity displayed by UNIX, specially at the command line! Remember the frst lecture? The Unix philosophy: combining small programs that each do only one thing (but do it ell), instead of having large programs that do a lot of things (but not as ell done): the po er of a system comes more from the relationships among programs than from the programs themselves Brian W. Kernighan e Rob Pihe, 1984
22 Quiz time! Go to the Moodle site and choose Quiz 18 (beware time limits!)
23 Redirecting to (and from) files Typing a lot of data for the program ould not be practical Reading a large amount of output on the screen ouldn t either actually, it ould be impossible in many cases To redirect the streams, e use redirection operators The redirection operators are: > >> < << <<< To determine hich stream you are redirecting, you can prepend its number to the operator; e.g., 2> ( ill redirect STDERR)
24 Redirecting to (and from) files The redirection operators are: > : redirect STDOUT to fle named on the right 2> : redirect STDERR to fle named on the right >> : redirect, appending STDOUT to fle named on the right 2>> : redirect, appending STDERR to fle named on the right < : redirect STDIN from fle named on the right << : redirect STDIN as a here-document <<< : redirect STDIN as a here-string The operators that redirect to STDOUT and STDERR create the fle if it does not exist Careful! The single version of the operator (e.g., 2>) ill al ays over rite the fle named on the right (if it exists)!
25 Redirecting to (and from) files Notice that it is not necessary to use the fle handle numbers for the STDIN and STDOUT streams If nothing is given, these are the default choices for the < and > redirection operators It is possible to merge STDOUT and STDERR and send them to the same fle by using the construct: command > file 2>&1 command &> file Both versions do the same thing: send the t o streams to the same fle (overwriting the fle!) To add to the fle ithout over riting, use the >> file 2>&1 and &>> versions
26 Redirecting to (and from) files Let s try! In the remote server, run the follo ing: ls -l /usr/local/bin/ /usr/blah If you typed correctly, you should see one error and the listings of a directory No run: ls -l /usr/local/bin/ /usr/blah > ls_f1 2> ls_f2 Where did all the stuf go? List the contents of your directory and see you no have t o ne fles ls -ltr (That is: list ith long format, sorting by time, ith ne est fles last)
27 No, try: Redirecting to (and from) files ls -l /usr/local/bin/ > ls_f3 Use the more command to see hat is inside of the fle ls_f3 that you just created No run: ls -l /usr/local/lib/ > ls_f3 Looh again at the contents of fle ls_f3 Where did all the data from the frst run go? We actually anted to append the results from the second run to the fle! ls -l /usr/local/bin > ls_f3 ls -l /usr/local/lib >> ls_f3
28 Here-documents Here-documents are multi-line string literals That is, they are a ay of passing multiple lines of text to standard input The << operator specifes that a here-document is about to start Here-docs are of the follo ing general format command << MARK MARK Everything bet een the t o instances of the ord MARK (or hatever you choose) ill be redirected to the STDIN of the command to the left of << Variables can be expanded inside the bloch of text, or not (depending on hether e use quotes around the delimiter ord)
29 Here-documents Example: wc << EOF A quick brown fox jumps over the lazy dog $PATH EOF Since the delimiting identifer (in this case, EOF) appearing by itself on a line marhs the end of the here-doc, it is a good idea to choose something that is not a real word The output of the command above ill be something lihe: No, put quotations marks (single or double, it does not matter) around the frst EOF and see hat happens No more expansion!
30 Here-strings Here-strings are a shortened version of a here-doc Here-strings are limited to one line (containing one or more ords) The <<< operator specifes that a here-string follo s Here-strings have a very simple format command <<< STRING Variables can be expanded inside the string, or not (depending on what kind of quotes, single or double, e use around the string) For example: wc <<< "A quick brown fox jumps over the lazy dog $PATH" Run the command lihe that, ith double quotes, and then ith single quotes. Diferent output? Why?
31 Quiz time! Go to the Moodle site and choose Quiz 19 (beware time limits!)
32 Now you do it! Go to the Moodle site, Practical Exercise 18 Follo the instructions to ans er the questions in the exercise (and beware time limits!) Remember: in the PE, you should do things in practice before ans ering the question!
33 Piping Another pioneering UNIX concept, the pipeline is a sequence of processes chained together by their standard streams The standard output of the frst process goes directly into the standard input of the second process, then the STDOUT of the second goes into the STDIN of the third, and so on and so forth
34 Piping The output of one process......becomes the input to another
35 Piping Another pioneering UNIX concept, the pipeline is a sequence of processes chained together by their standard streams The standard output of the frst process goes directly into the standard input of the second process, then the STDOUT of the second goes into the STDIN of the third, and so on and so forth The operator for the pipe is the vertical bar: command1 command2 command3 The STDERR does not get in the pipe, by default To have STDERR go along ith STDOUT in the pipe, use the & construct: command1 & command2 & command3 No space bet een and & there! This construct is not used much though
36 Piping The pipeline is the crucial feature enabling the UNIX philosophy The chaining allo ed by standard streams and pipe redirection is hat leads to the combination of small, generic, single purpose command line tools into very specifc, sophisticated commands
37 Piping The t o diferent hinds of redirection can be used in the same chained command, of course For example: ls -l /usr/bin wc -l > out_file This command ill: List all fles from /usr/bin (left side of the pipe) Count ho many fles there are (right side of the pipe) Save the results in fle out_file (redirection of STDOUT on the right) Right no, e haven t seen enough data-munching commands to be able to explore the full po er of piping That s for after the midterm exam!
38 Now you do it! Go to the Moodle site, Practical Exercise 19 Follo the instructions to ans er the questions in the exercise (and beware time limits!) Remember: in the PE, you should do things in practice before ans ering the question!
39 Recap The find program is very po erful and can fnd fles based on a large number of criteria, and also includes logical operators for greater fexibility Standard streams (STDIN, STDOUT, and STDERR) are an essential feature of UNIX, and mahe it very easy to redirect data fo s bet een programs and fles or programs and other programs The main redirection operators are <, >, 2>, >>, and 2>> Redirection of standard streams bet een programs, called piping, allo s us to concatenate diferent programs to create more specifc ones The pipe character,, redirects STDOUT from the command to its left to STDIN of the command to its right (STDERR by default goes to the screen) Standard streams and piping are responsible for most of the UNIX philosophy
Removing files and directories, finding files and directories, controlling programs
Removing files and directories, finding files and directories, controlling programs Laboratory of Genomics & Bioinformatics in Parasitology Department of Parasitology, ICB, USP Removing files Files can
More informationMore regular expressions, synchronizing data, comparing files
More regular expressions, synchronizing data, comparing files Laboratory of Genomics & Bioinformatics in Parasitology Department of Parasitology, ICB, USP Regular expressions POSIX regular expressions
More informationCS 307: UNIX PROGRAMMING ENVIRONMENT FIND COMMAND
CS 307: UNIX PROGRAMMING ENVIRONMENT FIND COMMAND Prof. Michael J. Reale Fall 2014 Finding Files in a Directory Tree Suppose you want to find a file with a certain filename (or with a filename matching
More informationMore text file manipulation: sorting, cutting, pasting, joining, subsetting,
More text file manipulation: sorting, cutting, pasting, joining, subsetting, Laboratory of Genomics & Bioinformatics in Parasitology Department of Parasitology, ICB, USP Inverse cat Last week we learned
More informationLinks, basic file manipulation, environmental variables, executing programs out of $PATH
Links, basic file manipulation, environmental variables, executing programs out of $PATH Laboratory of Genomics & Bioinformatics in Parasitology Department of Parasitology, ICB, USP The $PATH PATH (which
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 informationWeek Overview. Simple filter commands: head, tail, cut, sort, tr, wc grep utility stdin, stdout, stderr Redirection and piping /dev/null file
ULI101 Week 05 Week Overview Simple filter commands: head, tail, cut, sort, tr, wc grep utility stdin, stdout, stderr Redirection and piping /dev/null file head and tail commands These commands display
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 informationReview of Fundamentals
Review of Fundamentals 1 The shell vi General shell review 2 http://teaching.idallen.com/cst8207/14f/notes/120_shell_basics.html The shell is a program that is executed for us automatically when we log
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 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 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 informationCSC UNIX System, Spring 2015
CSC 352 - UNIX System, Spring 2015 Study guide for the CSC352 midterm exam (20% of grade). Dr. Dale E. Parson, http://faculty.kutztown.edu/parson We will have a midterm on March 19 on material we have
More informationShells and Shell Programming
Shells and Shell Programming 1 Shells A shell is a command line interpreter that is the interface between the user and the OS. The shell: analyzes each command determines what actions are to be performed
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 informationLecture 3 Tonight we dine in shell. Hands-On Unix System Administration DeCal
Lecture 3 Tonight we dine in shell Hands-On Unix System Administration DeCal 2012-09-17 Review $1, $2,...; $@, $*, $#, $0, $? environment variables env, export $HOME, $PATH $PS1=n\[\e[0;31m\]\u\[\e[m\]@\[\e[1;34m\]\w
More informationFile Commands. Objectives
File Commands Chapter 2 SYS-ED/Computer Education Techniques, Inc. 2: 1 Objectives You will learn: Purpose and function of file commands. Interrelated usage of commands. SYS-ED/Computer Education Techniques,
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 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 informationThe input can also be taken from a file and similarly the output can be redirected to another file.
Filter A filter is defined as a special program, which takes input from standard input device and sends output to standard output device. The input can also be taken from a file and similarly the output
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 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 information6 Redirection. Standard Input, Output, And Error. 6 Redirection
6 Redirection In this lesson we are going to unleash what may be the coolest feature of the command line. It's called I/O redirection. The I/O stands for input/output and with this facility you can redirect
More informationShells and Shell Programming
Shells and Shell Programming Shells A shell is a command line interpreter that is the interface between the user and the OS. The shell: analyzes each command determines what actions are to be performed
More informationIntroduction to Linux
Introduction to Linux The command-line interface A command-line interface (CLI) is a type of interface, that is, a way to interact with a computer. Window systems, punched cards or a bunch of dials, buttons
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 informationBashed One Too Many Times. Features of the Bash Shell St. Louis Unix Users Group Jeff Muse, Jan 14, 2009
Bashed One Too Many Times Features of the Bash Shell St. Louis Unix Users Group Jeff Muse, Jan 14, 2009 What is a Shell? The shell interprets commands and executes them It provides you with an environment
More informationIntroduc)on to Linux Session 2 Files/Filesystems/Data. Pete Ruprecht Research Compu)ng Group University of Colorado Boulder
Introduc)on to Linux Session 2 Files/Filesystems/Data Pete Ruprecht Research Compu)ng Group University of Colorado Boulder www.rc.colorado.edu Outline LeHover from last week redirec)on Filesystem layout
More informationShell Scripting. Todd Kelley CST8207 Todd Kelley 1
Shell Scripting Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 If we have a set of commands that we want to run on a regular basis, we could write a script A script acts as a Linux command,
More informationTutorial 8: Practice Exam Questions
Tutorial 8: Practice Exam Questions Informatics 1 Data & Analysis Notes on Solutions Week 10, Semester 2, 2017/18 Read this first: it is not the same as the other tutorials Folloing the strike by university
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 informationCS 307: UNIX PROGRAMMING ENVIRONMENT KATAS FOR EXAM 2
CS 307: UNIX PROGRAMMING ENVIRONMENT KATAS FOR EXAM 2 Prof. Michael J. Reale Fall 2014 COMMAND KATA 7: VARIABLES Command Kata 7: Preparation First, go to ~/cs307 cd ~/cs307 Make directory dkata7 and go
More informationSystems Programming/ C and UNIX
Systems Programming/ C and UNIX December 7-10, 2017 1/17 December 7-10, 2017 1 / 17 Outline 1 2 Using find 2/17 December 7-10, 2017 2 / 17 String Pattern Matching Tools Regular Expressions Simple Examples
More informationThe Unix Shell. Pipes and Filters
The Unix Shell Copyright Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See http://software-carpentry.org/license.html for more information. shell shell pwd
More informationA shell can be used in one of two ways:
Shell Scripting 1 A shell can be used in one of two ways: A command interpreter, used interactively A programming language, to write shell scripts (your own custom commands) 2 If we have a set of commands
More informationReview of Fundamentals. Todd Kelley CST8207 Todd Kelley 1
Review of Fundamentals Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 The CST8207 course notes GPL the shell SSH (secure shell) the Course Linux Server RTFM vi general shell review 2 Linux
More informationCS246 Spring14 Programming Paradigm Files, Pipes and Redirection
1 Files 1.1 File functions Opening Files : The function fopen opens a file and returns a FILE pointer. FILE *fopen( const char * filename, const char * mode ); The allowed modes for fopen are as follows
More informationECE 364 Software Engineering Tools Lab. Lecture 2 Bash II
ECE 364 Software Engineering Tools Lab Lecture 2 Bash II 1 Lecture 2 Summary Arrays I/O Redirection Pipes Quotes Capturing Command Output Commands: cat, head, tail, cut, paste, wc 2 Array Variables Declaring
More informationUser Commands find ( 1 )
NAME find find files SYNOPSIS /usr/bin/find path... expression /usr/xpg4/bin/find path... expression DESCRIPTION The find utility recursively descends the directory hierarchy for each path seeking files
More informationRecap From Last Time:
Recap From Last Time: BGGN 213 Working with UNIX Barry Grant http://thegrantlab.org/bggn213 Motivation: Why we use UNIX for bioinformatics. Modularity, Programmability, Infrastructure, Reliability and
More informationBGGN 213 Working with UNIX Barry Grant
BGGN 213 Working with UNIX Barry Grant http://thegrantlab.org/bggn213 Recap From Last Time: Motivation: Why we use UNIX for bioinformatics. Modularity, Programmability, Infrastructure, Reliability and
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 informationIntroduction in Unix. Linus Torvalds Ken Thompson & Dennis Ritchie
Introduction in Unix Linus Torvalds Ken Thompson & Dennis Ritchie My name: John Donners John.Donners@surfsara.nl Consultant at SURFsara And Cedric Nugteren Cedric.Nugteren@surfsara.nl Consultant at SURFsara
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 informationReview of Fundamentals. Todd Kelley CST8207 Todd Kelley 1
Review of Fundamentals Todd Kelley kelleyt@algonquincollege.com CST8207 Todd Kelley 1 GPL the shell SSH (secure shell) the Course Linux Server RTFM vi general shell review 2 These notes are available on
More informationSystem Administration
Süsteemihaldus MTAT.08.021 System Administration UNIX shell basics Name service DNS 1/69 Command Line Read detailed manual for specific command using UNIX online documentation or so called manual (man)
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 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 informationIntroduction To. Barry Grant
Introduction To Barry Grant bjgrant@umich.edu http://thegrantlab.org Working with Unix How do we actually use Unix? Inspecting text files less - visualize a text file: use arrow keys page down/page up
More informationShells. A shell is a command line interpreter that is the interface between the user and the OS. The shell:
Shells A shell is a command line interpreter that is the interface between the user and the OS. The shell: analyzes each command determines what actions are to be performed performs the actions Example:
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 informationUNIX Essentials Featuring Solaris 10 Op System
A Active Window... 7:11 Application Development Tools... 7:7 Application Manager... 7:4 Architectures - Supported - UNIX... 1:13 Arithmetic Expansion... 9:10 B Background Processing... 3:14 Background
More informationIntroduction to UNIX. Introduction. Processes. ps command. The File System. Directory Structure. UNIX is an operating system (OS).
Introduction Introduction to UNIX CSE 2031 Fall 2012 UNIX is an operating system (OS). Our goals: Learn how to use UNIX OS. Use UNIX tools for developing programs/ software, specifically shell programming.
More informationIntroduction to UNIX. CSE 2031 Fall November 5, 2012
Introduction to UNIX CSE 2031 Fall 2012 November 5, 2012 Introduction UNIX is an operating system (OS). Our goals: Learn how to use UNIX OS. Use UNIX tools for developing programs/ software, specifically
More informationEECS 470 Lab 5. Linux Shell Scripting. Friday, 1 st February, 2018
EECS 470 Lab 5 Linux Shell Scripting Department of Electrical Engineering and Computer Science College of Engineering University of Michigan Friday, 1 st February, 2018 (University of Michigan) Lab 5:
More informationIT 341: Introduction to System Administration Using sed
IT 341: Introduction to System Administration Using sed Maintaining Configuration Files The sed Stream Editor Instructions to sed o Replacing a String with sed o Adding a Line with sed o Deleting a Line
More informationIT441. Network Services Administration. Perl: File Handles
IT441 Network Services Administration Perl: File Handles Comment Blocks Perl normally treats lines beginning with a # as a comment. Get in the habit of including comments with your code. Put a comment
More informationIntroduction to Linux Basics Part II. Georgia Advanced Computing Resource Center University of Georgia Suchitra Pakala
Introduction to Linux Basics Part II 1 Georgia Advanced Computing Resource Center University of Georgia Suchitra Pakala pakala@uga.edu 2 Variables in Shell HOW DOES LINUX WORK? Shell Arithmetic I/O and
More informationWeek 5 Lesson 5 02/28/18
Week 5 Lesson 5 02/28/18 Important Announcements Extra Credits If you haven t done so, send your pictures to risimms@cabrillo.edu for 3 points EXTRA CREDIT. Join LinkedIn for 3 points Perkins/VTEA Survey
More informationCSE 390a Lecture 1. introduction to Linux/Unix environment
1 CSE 390a Lecture 1 introduction to Linux/Unix environment slides created by Marty Stepp, modified by Jessica Miller & Ruth Anderson http://www.cs.washington.edu/390a/ 2 Lecture summary Course introduction
More informationCMPS 12A Introduction to Programming Lab Assignment 7
CMPS 12A Introduction to Programming Lab Assignment 7 In this assignment you will write a bash script that interacts with the user and does some simple calculations, emulating the functionality of programming
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 informationCSE 391 Lecture 1. introduction to Linux/Unix environment
CSE 391 Lecture 1 introduction to Linux/Unix environment slides created by Marty Stepp, modified by Jessica Miller & Ruth Anderson http://www.cs.washington.edu/391/ 1 2 Lecture summary Course introduction
More informationBourne Shell Reference
> Linux Reviews > Beginners: Learn Linux > Bourne Shell Reference Bourne Shell Reference found at Br. David Carlson, O.S.B. pages, cis.stvincent.edu/carlsond/cs330/unix/bshellref - Converted to txt2tags
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 informationIntroduction to UNIX. SURF Research Boot Camp April Jeroen Engelberts Consultant Supercomputing
Introduction to UNIX SURF Research Boot Camp April 2018 Jeroen Engelberts jeroen.engelberts@surfsara.nl Consultant Supercomputing Outline Introduction to UNIX What is UNIX? (Short) history of UNIX Cartesius
More information: the User (owner) for this file (your cruzid, when you do it) Position: directory flag. read Group.
CMPS 12L Introduction to Programming Lab Assignment 2 We have three goals in this assignment: to learn about file permissions in Unix, to get a basic introduction to the Andrew File System and it s directory
More informationIntroduction to the Shell
[Software Development] Introduction to the Shell Davide Balzarotti Eurecom Sophia Antipolis, France What a Linux Desktop Installation looks like What you need Few Words about the Graphic Interface Unlike
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 informationDATA 301 Introduction to Data Analytics Command Line. Dr. Ramon Lawrence University of British Columbia Okanagan
DATA 301 Introduction to Data Analytics Command Line Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Why learn the Command Line? The command line is the text interface
More informationWhy learn the Command Line? The command line is the text interface to the computer. DATA 301 Introduction to Data Analytics Command Line
DATA 301 Introduction to Data Analytics Command Line Why learn the Command Line? The command line is the text interface to the computer. DATA 301: Data Analytics (2) Understanding the command line allows
More informationThe Unix Shell & Shell Scripts
The Unix Shell & Shell Scripts You should do steps 1 to 7 before going to the lab. Use the Linux system you installed in the previous lab. In the lab do step 8, the TA may give you additional exercises
More informationA Brief Introduction to the Linux Shell for Data Science
A Brief Introduction to the Linux Shell for Data Science Aris Anagnostopoulos 1 Introduction Here we will see a brief introduction of the Linux command line or shell as it is called. Linux is a Unix-like
More informationExploring the system, investigating hardware & system resources
Exploring the system, investigating hardware & system resources Laboratory of Genomics & Bioinformatics in Parasitology Department of Parasitology, ICB, USP Ctrl+c/Ctrl+v in the shell? Paste, in Gnome
More informationCS 25200: Systems Programming. Lecture 11: *nix Commands and Shell Internals
CS 25200: Systems Programming Lecture 11: *nix Commands and Shell Internals Dr. Jef Turkstra 2018 Dr. Jeffrey A. Turkstra 1 Lecture 11 Shell commands Basic shell internals 2018 Dr. Jeffrey A. Turkstra
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 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 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 informationEssential Unix and Linux! Perl for Bioinformatics, ! F. Pineda
Essential Unix and Linux! Perl for Bioinformatics, 140.636! F. Pineda Generic computer architecture Memory Storage Fig. 1.2 From Designing Embedded Hardware, 2 nd Ed. by John Catsoulis OS concepts Shell
More informationCreating a Shell or Command Interperter Program CSCI411 Lab
Creating a Shell or Command Interperter Program CSCI411 Lab Adapted from Linux Kernel Projects by Gary Nutt and Operating Systems by Tannenbaum Exercise Goal: You will learn how to write a LINUX shell
More informationUNIX files searching, and other interrogation techniques
UNIX files searching, and other interrogation techniques Ways to examine the contents of files. How to find files when you don't know how their exact location. Ways of searching files for text patterns.
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 informationLinux shell scripting Getting started *
Linux shell scripting Getting started * David Morgan *based on chapter by the same name in Classic Shell Scripting by Robbins and Beebe What s s a script? text file containing commands executed as a unit
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 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 informationIntroduction to Programming in C Department of Computer Science and Engineering. Lecture No. #47. File Handling
Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #47 File Handling In this video, we will look at a few basic things about file handling in C. This is a vast
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 informationCS Unix Tools. Lecture 2 Fall Hussam Abu-Libdeh based on slides by David Slater. September 10, 2010
Lecture 2 Fall 2010 Hussam Abu-Libdeh based on slides by David Slater September 10, 2010 Last Time We had a brief discussion On The Origin of Species *nix systems Today We roll our sleeves and get our
More informationIntroduction to UNIX command-line
Introduction to UNIX command-line Boyce Thompson Institute March 17, 2015 Lukas Mueller & Noe Fernandez Class Content Terminal file system navigation Wildcards, shortcuts and special characters File permissions
More informationPrinciples of Bioinformatics. BIO540/STA569/CSI660 Fall 2010
Principles of Bioinformatics BIO540/STA569/CSI660 Fall 2010 Lecture Five Practical Computing Skills Emphasis This time it s concrete, not abstract. Fall 2010 BIO540/STA569/CSI660 3 Administrivia Monday
More informationAffine Transformations Computer Graphics Scott D. Anderson
Affine Transformations Computer Graphics Scott D. Anderson 1 Linear Combinations To understand the poer of an affine transformation, it s helpful to understand the idea of a linear combination. If e have
More informationfind Command as Admin Security Tool
find Command as Admin Security Tool Dr. Bill Mihajlovic INCS-620 Operating Systems Security find Command find command searches for the file or files that meet certain condition. like: Certain name Certain
More informationUNIX Kernel. UNIX History
UNIX History UNIX Kernel 1965-1969 Bell Labs participates in the Multics project. 1969 Ken Thomson develops the first UNIX version in assembly for an DEC PDP-7 1973 Dennis Ritchie helps to rewrite UNIX
More informationBasics. I think that the later is better.
Basics Before we take up shell scripting, let s review some of the basic features and syntax of the shell, specifically the major shells in the sh lineage. Command Editing If you like vi, put your shell
More informationUNIX Tutorial One
1.1 Listing files and directories ls (list) When you first login, your current working directory is your home directory. Your home directory has the same name as your user-name, for example, ee91ab, and
More informationTutorial 5: XML. Informatics 1 Data & Analysis. Week 7, Semester 2,
Tutorial 5: XML Informatics 1 Data & Analysis Week 7, Semester 2, 2013 2014 This orksheet has three parts: tutorial Questions, folloed by some Examples and their Solutions. Before your tutorial, ork through
More informationAssignment clarifications
Assignment clarifications How many errors to print? at most 1 per token. Interpretation of white space in { } treat as a valid extension, involving white space characters. Assignment FAQs have been updated.
More informationCSE 391 Lecture 1. introduction to Linux/Unix environment
CSE 391 Lecture 1 introduction to Linux/Unix environment slides created by Marty Stepp, modified by Jessica Miller & Ruth Anderson http://www.cs.washington.edu/391/ 1 2 Lecture summary Course introduction
More informationLinux Command Line Primer. By: Scott Marshall
Linux Command Line Primer By: Scott Marshall Draft: 10/21/2007 Table of Contents Topic Page(s) Preface 1 General Filesystem Background Information 2 General Filesystem Commands 2 Working with Files and
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 information