Introduction to Unix Shell Accounts at Lancaster University
Total Page:16
File Type:pdf, Size:1020Kb
Introduction To Unix Shell Accounts at Lancaster University Tabitha Tipper [email protected] March 13, 2017 Copyright (c) 2004,2005,2006 TABITHA TIPPER. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled \GNU Free Documentation License". WARNING: While the following document makes every effort to be factually correct some er- rors may be present, this document was only written by humans. Be sure to understand what you're typing before you press enter as no responsibility will be taken for incorrect information or loss of data caused by use or reference to this document. 1 Contents 1 Welcome to the Unix System at Lancaster (unix.lancs.ac.uk) 6 1.1 What this document tells you . 6 1.2 What is the point of the Unix systems . 6 1.3 Primer on the concepts involved . 6 1.4 About this document . 6 1.5 About the author . 8 1.6 Acknowledgements . 8 2 User Accounts 9 2.1 What? Why? What can it do? . 9 2.2 Home directories (∼)................................... 10 2.3 Details . 10 2.4 groups . 10 2.5 Passwords and why they matter . 10 2.6 Finding out other peoples usernames . 11 2.7 Seeing who else is logged on and what they're doing . 11 2.8 Finding out who's been logging in when . 12 3 Getting Help 13 3.1 man . 13 3.2 info . 13 3.3 apropos . 13 3.4 whatis . 14 3.5 -help (dash help) and {help (dash dash help) . 14 3.6 The Library . 14 3.7 Google / Linux . 14 3.8 LuBBs (http://www.lancs.ac.uk/socs/lubbs) . 15 4 File Management 16 4.1 Configuration files . 16 4.2 Basic Commands . 16 4.2.1 Your current directory . 16 4.2.2 Finding out what files there are . 16 4.2.3 Viewing a file . 17 4.2.4 Copying a file . 17 4.2.5 Moving or Renaming a file . 18 4.2.6 Deleting a file . 18 4.2.7 Finding out how big a file is . 18 4.2.8 Concatenating files . 19 4.3 Directories . 19 4.3.1 Making new directories . 19 4.3.2 Removing Directories . 19 4.3.3 Changing directory . 20 4.3.4 Copying and moving with relation to directories . 20 4.4 Finding files . 22 4.5 Paths, relative and absolute . 23 4.5.1 Absolute paths . 23 4.5.2 Relative paths . 23 4.5.3 What can be done with ∼ ............................ 24 4.6 tar and tarfiles . 25 4.7 gzip/gunzip . 26 4.8 Permissions . 26 2 4.9 Quota . 28 4.10 H: Drive . 28 4.11 Moving files to and from the Unix systems from off campus . 29 4.12 scratch ($scratch) . 30 4.13 webspace ($WWWHOME) . 30 4.14 mailspace ($MAILHOME) . 30 4.15 Dealing with awkward files . 30 5 Editing Text 32 5.1 why is this important? . 32 5.2 vi and vim http://hedgehog:8080/help/vi.html . 32 5.3 emacs http://hedgehog:8080/help/emacs.html . 33 5.4 pico http://hedgehog:8080/help/pico.html . 34 5.5 ue (Lancaster Version) http://hedgehog:8080/help/ue-master.ps . 34 5.6 Line Counting (wc) . 34 5.7 spell checking (ispell) . 35 6 Prompts and Shells 36 6.1 What is a shell? . 36 6.2 Name completion . 36 6.3 Environment variables . 36 6.3.1 Changing environment variables . 37 6.3.2 Using environment variables inside setenv . 37 6.4 What is a terminal? . 38 6.4.1 Changing your terminal . 38 6.5 Prompts . 38 6.5.1 Using the output of other commands in your prompt . 39 6.6 What happens when you log in . 40 6.7 What happens when you log out . 40 6.8 running programs . 40 6.8.1 Working out where programs are . 41 6.9 useful things your shell can do: . 41 6.9.1 alias . 41 6.9.2 Running multiple programs one after the other . 41 6.9.3 clear and redrawing . 42 6.9.4 reset . 42 6.9.5 mesg . 42 6.9.6 MOTD . 43 6.10 Gotchas . 43 6.10.1 Backspaces . 43 6.10.2 Changing the size of your terminal . 43 6.10.3 Suspend and Resume . 44 6.10.4 \There are suspended jobs." . 44 7 Processes 45 7.1 What is a process . 45 7.2 Running multiple jobs . 45 7.3 Kill . 46 7.4 ps ............................................. 46 7.5 top . 47 3 8 Email and Unix 48 8.1 A general overview of email under Unix . 48 8.2 Forwarding Email . 48 8.3 Mail User Agent . 48 8.3.1 mutt . 49 8.3.2 pine . ..