A Guide for Linux and the Department Computing Facilities 1

A Guide for Linux and the Department Computing Facilities 1

A Guide for Linux and the Department Computing Facilities 1 Amit Jain and John Rickerd Last Revised: May 11, 2015 1Please send any comments to [email protected]. This guide can be found on the web at http://cs.boisestate.edu/~amit/teaching/handouts/cs-linux/ c 2015 Amit Jain and John Rickerd Contents 1 Departmental Computing Facilities 5 2 Real Basics 7 2.1 Who to ask for help? .................................... 7 3 Beginner’s Guide 8 3.1 Getting started ....................................... 9 3.1.1 Logging in ...................................... 9 3.1.2 Changing your password .............................. 9 3.1.3 Logging out of the system ............................. 9 3.2 Some basics ......................................... 10 3.2.1 Correcting your typing ............................... 10 3.2.2 Special keys ..................................... 10 3.2.3 Case sensitivity ................................... 10 3.2.4 On-line help ..................................... 10 3.3 Files and directories .................................... 12 3.3.1 File names ..................................... 12 3.3.2 Creating files and directories ........................... 13 3.3.3 Your current directory ............................... 13 3.3.4 Your home directory ................................ 13 3.3.5 Changing directories ................................ 13 3.3.6 Special directories ................................. 13 3.3.7 Special files ..................................... 14 3.3.8 Other interesting directories ............................ 14 3.3.9 Viewing the contents of a text file ........................ 15 3.3.10 Listing files and directories ............................ 15 3.3.11 Wild-cards and file name completion ....................... 15 3.3.12 File protection ................................... 16 3.3.13 Copying files or directories ............................ 17 3.3.14 Renaming a file or directory: ........................... 17 3.3.15 Removing(Deleting) files or directories ...................... 17 3.3.16 Symbolic links and hard links ........................... 17 3.4 Editing files ......................................... 18 3.4.1 The Vim file editor ................................. 19 3.4.2 The GNU emacs file editor ............................ 19 2 3.5 Printing files ........................................ 19 3.6 Electronic mail ....................................... 20 3.6.1 Forwarding email .................................. 20 3.6.2 Text-based mail clients ............................... 20 3.6.3 Graphical mail clients ............................... 21 3.7 Working on the Internet .................................. 21 3.7.1 Host-names and Internet addresses ........................ 21 3.7.2 Surfing the Internet ................................ 21 3.7.3 File transfer ..................................... 21 3.7.4 Remote access ................................... 22 3.8 Linux graphical user interfaces .............................. 22 3.8.1 Cut and paste using a mouse ........................... 23 3.8.2 Working with the KDE desktop .......................... 23 3.8.3 Taking a Snapshot of your Desktop ........................ 23 3.8.4 Creating directories in the KDE file browser ................... 23 3.8.5 Creating shortcuts on the KDE desktop ..................... 24 3.8.6 Using CDs and DVDs ............................... 24 3.8.7 Copying a directory to a CD or DVD ...................... 24 3.8.8 Burning CDs or DVDs ............................... 24 3.8.9 Playing a movie .................................. 24 3.8.10 Viewing a collection of photos ........................... 24 3.8.11 Editing photos ................................... 25 3.8.12 Running remote graphical programs ....................... 26 3.9 Other useful GUI programs ................................ 27 3.9.1 Viewing postscript and PDF files ......................... 27 4 Advanced User’s Guide 28 4.1 Customizing your shell and improving productivity ................... 28 4.1.1 Startup or run control files ............................ 28 4.1.2 Changing your shell prompt ............................ 28 4.1.3 Setting the path: how the shell finds programs ................. 28 4.1.4 Aliases ........................................ 29 4.1.5 Customizing ls ................................... 29 4.1.6 Enhancing cd using a stack ............................ 30 4.1.7 Repeating and editing previous commands .................... 30 4.2 Packing up and backing up your files ........................... 31 4.2.1 Archiving files with tar .............................. 31 4.2.2 Compressing files with gzip ............................ 32 4.2.3 Compressing files with bzip2 ........................... 32 4.2.4 Backing up your files ................................ 32 4.3 Recovering lost files .................................... 33 4.4 Other useful commands .................................. 33 4.4.1 Finding the date and the time .......................... 33 4.4.2 Recording a terminal session ........................... 33 4.4.3 Obtaining information about other users ..................... 34 4.4.4 Changing your personal information ....................... 35 3 4.4.5 Changing your login shell ............................. 35 4.4.6 Disk quota ..................................... 35 4.4.7 Checking disk usage ................................ 35 4.4.8 Counting the number of characters, words and lines .............. 36 4.4.9 Finding patterns in files using your buddy grep ................. 36 4.4.10 Locating files in the system ............................ 37 4.4.11 Finding files in your home directory ....................... 37 4.4.12 Using find for useful tasks ............................ 38 4.4.13 Sorting files ..................................... 39 4.4.14 Displaying the last few lines in a file ....................... 39 4.4.15 Finding the differences between two text files .................. 40 4.4.16 Finding the differences between two binary files ................. 41 4.4.17 Time a command or a program .......................... 41 4.4.18 Spell checking .................................... 41 4.4.19 Watching a command ............................... 42 4.5 Filters: cool objects .................................... 42 4.5.1 Character transliteration with tr ......................... 42 4.5.2 Comparing sorted file with comm ......................... 43 4.5.3 Stream editing with sed .............................. 43 4.5.4 String processing with awk ............................ 44 4.6 Processes and Pipes .................................... 48 4.6.1 Input-Output redirection ............................. 48 4.6.2 Processes ...................................... 48 4.6.3 Playing Lego in Linux ............................... 50 4.7 Shell programming ..................................... 51 4.7.1 Creating new commands .............................. 52 4.7.2 Command arguments and parameters ...................... 53 4.7.3 Program output as an argument ......................... 53 4.7.4 Shell metacharacters ................................ 54 4.7.5 Shell variables ................................... 54 4.7.6 Loops and conditional statements in shell programs .............. 55 4.7.7 Arithmetic in shell scripts ............................. 56 4.7.8 Interactive programs in shell scripts ....................... 56 4.7.9 Useful commands for shell scripts ......................... 56 4.7.10 Functions ...................................... 58 4.7.11 More shell script examples ............................. 59 5 Further Exploration 67 4 Chapter 1 Departmental Computing Facilities The department Linux lab, named MetaGeek lab,(named in honor of a lab sponsorship by a local software company MetaGeek) is located in rooms ET 213 and ET 214. The CS Tutoring center in room ENGR 111 also runs the same software. All machines in the lab as well as departmental servers run Fedora 20 Linux. The lab uses a proximity card reader for access with your Boise State identity card. You will also need a login name and a password to use the machines. Normally your should get the login name and password from your instructor. Your instructor should also be able to help you with setting up lab access. The main server for the lab is named onyx.boisestate.edu. There are 62 workstations in the two labs, which are named node01, node02, ..., node62. The name node00 is an alias for the main server onyx. The workstations in the lab are connected with a private Gigabit Ethernet switch with the main server and each other. The lab is especially setup for Computer Science classes. Depending upon the Computer Science class you are taking, you will learn to use various features of the lab. The 62 machines in the labs are clustered together so you can use them as a single machine if need be! Since the machines in the lab are part of a cluster, it is important not to power off any machine or disconnect the network cables. You may disrupt the work of another student. The machine onyx is the main server and the only one that is on the public Internet, that is, visible from outside the lab. The figure below shows the layout of the MetaGeek Lab and the CS Tutoring Lab (in room ENGR 111). 5 (12 core 2.6 GHz Xeons, 32GB RAM, SCSI RAID disk drives) onyx node00 To Internet 1000 MBits/sec link 132.178.208.159 1000 MBits/sec 192.168.0.1 24−port HP switch 48 −port HP switch 24−port HP switch 24−port HP switch ENGR 213/214 ENGR 111 . node01 node32 node33 node47 node48 node62 192.168.0.101 192.168.0.132 192.168.0.133 192.168.0.133 192.168.0.133

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    69 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us