
Introduction to the Unix Command Line Bob Dowling [email protected] David Carter [email protected] Latest updates by Stuart Rankin [email protected]. 13 May 2019 Copies of these notes may be found at https://www.hpc.cam.ac.uk/training-courses Table of Contents Notation............................................................................................................................................................ 3 Warnings...................................................................................................................................................... 3 Exercises..................................................................................................................................................... 3 Input and output........................................................................................................................................... 3 Keys on the keyboard.................................................................................................................................. 3 Content of files............................................................................................................................................. 3 Booting & logging in.......................................................................................................................................... 4 Rebooting from Windows to Linux on a DS workstation..............................................................................5 Terminal windows and text consoles.................................................................................................................6 Logging out.................................................................................................................................................. 7 Close the window.................................................................................................................................... 7 The exit command.................................................................................................................................. 7 [Ctrl]+[D]................................................................................................................................................. 7 Just for interest............................................................................................................................................ 8 Navigating the file system in the CLI.................................................................................................................9 Directories.................................................................................................................................................... 9 Working directory.................................................................................................................................... 9 Directory contents................................................................................................................................... 9 Changing directory................................................................................................................................ 11 Quoting...................................................................................................................................................... 11 Escaping.................................................................................................................................................... 11 File name completion................................................................................................................................. 12 Directories again........................................................................................................................................ 13 File paths................................................................................................................................................... 14 Renaming, creating and deleting file and directories.................................................................................16 Renaming and moving items................................................................................................................17 Copying files......................................................................................................................................... 17 Creating directories............................................................................................................................... 19 Removing files and directories..............................................................................................................19 Anatomy of a command.................................................................................................................................. 21 Long options.............................................................................................................................................. 22 Reading the fine manual................................................................................................................................. 24 Launching graphical applications from the command line...............................................................................26 Background commands............................................................................................................................. 26 Job control................................................................................................................................................. 27 Killing background jobs..............................................................................................................................28 Why would you want job control?..............................................................................................................29 What would the GUI do?............................................................................................................................29 Command line editing..................................................................................................................................... 31 Changing the command line......................................................................................................................31 History....................................................................................................................................................... 32 Clearing the screen.................................................................................................................................... 33 Running applications in the CLI...................................................................................................................... 35 Reading plain text files...............................................................................................................................35 Searching plain text files............................................................................................................................ 36 Counting text.............................................................................................................................................. 38 Editing plain text files................................................................................................................................. 38 Telling the time........................................................................................................................................... 38 Repeating the command line.....................................................................................................................39 A command line calculator.........................................................................................................................40 Just for interest.......................................................................................................................................... 41 Redirecting data and piping commands..........................................................................................................43 Standard output......................................................................................................................................... 43 Standard input........................................................................................................................................... 44 Piping......................................................................................................................................................... 45 File name globbing......................................................................................................................................... 47 Asterisk...................................................................................................................................................... 47 Question mark........................................................................................................................................... 48 Square brackets — only for the keen.........................................................................................................48 The “new” globs — only for the very keen.................................................................................................48 Environment variables...................................................................................................................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages66 Page
-
File Size-