
Unix I Documentation Release 1.0 Eric Deveaud & Bertrand Neron Apr 04, 2019 CONTENTS 1 Introduction 3 1.1 What is Unix?..............................................3 1.2 Why use Unix on the computing servers of the Institut Pasteur?....................3 1.3 What is the Unix shell?..........................................3 1.4 Commands................................................3 1.5 How the shell executes your command line...............................4 2 Connection 5 2.1 How to connect to the central cluster at the Institut............................5 2.2 Network accessibility at Pasteur......................................5 2.3 remote computer available at Pasteur..................................5 2.4 Put data from your PC to remote server.................................6 2.5 get data from server to your PC.....................................6 3 File system 7 3.1 What is the file system..........................................7 3.2 what is a “tree structure”?........................................7 3.3 file sytem tree structure.........................................7 3.4 what directory ?.............................................9 3.5 where am I on the map?.........................................9 3.6 let’s go for exploration..........................................9 3.7 absolute path............................................... 10 3.8 relative path............................................... 10 3.9 shortcuts................................................. 11 3.10 Exploration................................................ 11 3.11 special characters............................................. 11 3.12 wildcards exercises............................................ 12 3.13 create directories............................................. 12 3.14 copy file and directory.......................................... 12 3.15 mv/rename file/directories........................................ 12 3.16 remove file................................................ 13 3.17 link.................................................... 13 4 Rights and Permissions 15 4.1 Permissions................................................ 15 4.2 3 classes of permissions......................................... 15 4.3 rwx what does it really mean?...................................... 16 4.4 who am I?................................................ 16 4.5 change permissions............................................ 16 4.6 change permissions syntax 2....................................... 16 i 4.7 octal notation............................................... 17 4.8 permissions by default.......................................... 17 4.9 octal codes meaning........................................... 18 4.10 setting the umask............................................. 18 4.11 change owner/group........................................... 18 5 Display file content 19 5.1 cat.................................................... 19 5.2 more................................................... 19 5.3 less.................................................... 19 5.4 head.................................................... 20 5.5 tail.................................................... 20 6 Chain commands 21 6.1 stdin/stderr/stdout............................................ 21 6.2 File descriptors.............................................. 21 6.3 File descriptor (example)......................................... 22 6.4 redirection................................................ 22 6.5 Redirecting Standard Input........................................ 22 6.6 Redirecting Standard Output....................................... 22 6.7 Redirecting Standard Output....................................... 23 6.8 Redirecting Standard Error........................................ 23 6.9 The chain command........................................... 23 6.10 tee (Duplicate Streams)......................................... 24 6.11 How do I run several commands in Sequence or all at once?...................... 24 6.12 limitation................................................. 25 6.13 return values / exit status......................................... 25 6.14 chain commands............................................. 25 7 Wild cards 27 7.1 Asterisk Wildcard “*”.......................................... 27 7.2 Question Mark Wildcard “?”....................................... 27 7.3 Square Brackets Wildcard “[]”...................................... 27 7.4 Curly Brackets Wildcard “{}”...................................... 28 7.5 Common use and examples....................................... 29 7.6 Escaping characters........................................... 30 7.7 Exercises:................................................. 30 8 Finding files 31 8.1 Find a file on the file system....................................... 31 8.2 Find a file or a directory......................................... 31 8.3 Find files by name............................................ 31 8.4 Find files by date............................................. 32 8.5 Find files by owner............................................ 32 8.6 Find files and execute a command on the result............................. 32 8.7 Find a program in the PATH....................................... 32 8.8 Exercises................................................. 33 8.9 Find files on a file system........................................ 33 9 Searching and Filtering 35 9.1 Searching In Files............................................ 35 9.2 Filtering/sorting results.......................................... 37 10 replace pattern 39 10.1 tr..................................................... 39 ii 10.2 newlines nigthmare............................................ 39 10.3 sed..................................................... 40 10.4 basename................................................. 42 10.5 dirname.................................................. 43 11 Jobs control 45 11.1 Job control commands.......................................... 45 11.2 Job control commands, continued.................................... 45 11.3 Job control................................................ 45 11.4 Screen multiplexer: GNU screen..................................... 46 11.5 Commands................................................ 46 12 some tips to work faster 47 12.1 naming files................................................ 47 12.2 command line edition.......................................... 47 12.3 history edition.............................................. 47 12.4 file system navigation.......................................... 47 12.5 Shell special characters (as reference).................................. 48 12.6 Use plain text file............................................. 48 13 Where to find documentation 49 13.1 Get help................................................. 49 13.2 man vs info vs help............................................ 49 13.3 Program builtin help........................................... 49 13.4 External documentation:......................................... 49 13.5 Books ?.................................................. 50 14 Misc tools that can help you 51 14.1 xargs................................................... 51 14.2 wget................................................... 51 15 Archives and Compression 53 15.1 zip.................................................... 53 15.2 unzip................................................... 53 15.3 gzip.................................................... 53 15.4 gunzip.................................................. 54 15.5 bzip2................................................... 54 15.6 create archive............................................... 54 15.7 create archive............................................... 54 15.8 create and compress an archive..................................... 55 15.9 create and compress an archive..................................... 55 15.10 list the content of an archive....................................... 55 15.11 uncompress and restore an archive.................................... 55 15.12 send an archive by mail......................................... 56 15.13 send an archive by mail......................................... 56 16 How to find and use scientific ressources on the cluster 57 16.1 Module................................................... 57 16.2 why module............................................... 57 16.3 what is module.............................................. 57 16.4 what is available............................................. 58 16.5 do a program available.......................................... 58 16.6 get help on a module........................................... 58 16.7 what this module does.......................................... 58 16.8 your own modulefiles.......................................... 58 iii 16.9 use your own private modulefiles.................................... 58 16.10 use shared private modulefiles...................................... 59 16.11 whatprovides............................................... 59 16.12 What if I need a specific tool or some specific scientific datas on the cluster?............. 59 17 variables and Environment variable 61 17.1 variables................................................. 61 17.2 Environement variable.......................................... 62 17.3 Common environment variables..................................... 62 17.4 Command as value............................................ 62 17.5 Variable
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages71 Page
-
File Size-