UE CS 215 - CS 215 ­ Fundamentals of Programming II

Unformatted text preview:

CS 215 - Fundamentals of Programming IIFall 2010 - Very Basic UNIXThis handout very briefly describes how to use Unix and how to use the Linux server and client machines in the CS (Project) Lab (KC-265) and the Computer Systems Lab (KC-267). For more information, ask a CS Lab worker, look at the links on the CS 215 course page, or buy a book. CS Lab (KC-265) and Computer Systems Lab (KC-267)CS Lab & KC-267 consist of client machines that dual-boot Windows 7 and Ubuntu Linux. On boot up, the machines will give a menu to choose an operating system. Please reboot the machines properly if you need to switch to the other operating system. There is a Linux server machine named csserver.evansville.edu, that provides login and home directory service for the Linux sides of the client machines. Users with accounts on csserver also may map their Linux home directory as a network drive on any Windows machine inside the UE firewall.Both labs are open 24/7 to authorized students with access provided by a cipher lock. Authorized students are those in current CS courses with need to access the labs and students working on projects for the CS program. A list of authorized students is sent to Security at the beginning of each semester. The combination to the locks are available from instructors and labworkers During each semester, there are labworkers with schedules posted outside the CS Lab who can answer questions regarding how to do things in the lab. Students are allowed to log into csserver remotely using any terminal client supporting the SSH (secure shell) protocol, such as ssh (Linux) or putty (Windows). While you can log into csserver from a lab client machine using a terminal client, we prefer that you use the Linux side directly (unless a program must be run on csserver specifically) in order to keep the load low on csserver. More information on remote login is given at the end of this handout.Basic UNIX functionality UNIX is a command-line oriented operating system. This means that you interact with a computer through a interactive shell and programs are run by typing commands and their arguments at the shell prompt. (It is similar to DOS in this way.) The basic syntax of running any program is: command options arg1 arg2 arg3 ...where command is the name of the program and the options and arguments are whatever else it needs to run. Options are things that change the way a program behaves, typically they start with - ("dash") and may have arguments of their own (e.g. a file name). Arguments are things that the program will operate on, typically file and directory (folder) names. Note that UNIX is case-sensitive. Conventionally, most UNIX commands and file/directory names are in all lower case. The UNIX file system is hierarchical. The root directory/folder of the file system is called / ("slash"). Under the root are various subdirectories. Each user has a home directory under /home, e.g. /home/hwang. When you log in, you are put into your home directory where only you have access to read and write files initially. The default shell on the CS Lab Linux server is bash. This shell supports, 08/23/2010 Page 1 of 5 D. Hwangamong other things, using the up and down arrow keys to access previously typed commands, line editing using emacs style commands, and command completion using the TAB key. (The shell can be changed using the command chsh, if another is preferred.) Files and directories are named using either absolute or relative pathnames. An absolute pathname starts with /, the root directory. A relative pathname is relative to the current directory and can start with a subdirectory name, .. ("dot dot" - parent directory), . ("dot" - current directory) or ~ ("tilde" - home directory). Most commands also will take wild cards in pathnames. The most common ones used are: * (match 0 or more of any character) and ? (match exactly one character). For example, project1.* will match all files starting with project1. and having any extension (e.g., project1.cpp, project1.o, etc.). Likewise, project?.cpp will match any .cpp file that has the name project and one character (e.g., project1.cpp, project2.cpp, etc.). Basic UNIX commands Here is a very brief list of the most commonly used UNIX commands (more or less in the order presented in class) with the most commonly used options and arguments that you will need to know to get started. Unless otherwise noted, all commands may be used on csserver or the client machines.yppasswd Change password. The program will ask you for your current password, a new password, and then your new password again to confirm. (Please note that this is different than the traditional passwd command, which will change your password only on the machine you are logged into and not for the entire system.)smbpasswdChange Samba password (used only on csserver). Samba is a service that (among other things) exports a UNIX file system as a Windows file system. This password may be the same or different than the UNIX password and is the one used when mapping the Linux home directory as a network drive on Windows.mkdir subdir1 subdir2 ... Create subdirectories in the current directory. ls options directory List directory. Default is in alphabetical order ignoring hidden files (those starting with a dot). Options include -l (long listing format showing permission modes and sizes), -a (including hidden dot files), -d (directory only). Options can be combined, e.g., ls -la will list all files, including hidden files, in long format. chmod newmode name1 name2 ... Change permission mode. Permissions to access files and directories are granted in three groups (owner, group, world) of three rights (read, write, execute). They are represented in a long listing (ls -l) as:rwxrwxrwxThese permissions can be represented as a 3-digit octal (base 8) number where each right is a bit in the number. In the long listing, a letter (r, w, x) means the bit is set to 1, whereas - (minus) means the bit is 0. E.g., 777 would be all rights to all users (rwxrwxrwx), whereas 754 would be all access for the owner, read and execute access for the group, and read-only access for everyone else (rwxr-xr--). 08/23/2010 Page 2 of 5 D. HwangBy default, your home directory is open for all access to you and closed to all others, i.e., mode 700 (rwx------). All other directories and files are created with all access to you and read-only access for everyone, i.e., modes 755


View Full Document

UE CS 215 - CS 215 ­ Fundamentals of Programming II

Documents in this Course
Lecture 4

Lecture 4

14 pages

Lecture 5

Lecture 5

18 pages

Lecture 6

Lecture 6

17 pages

Lecture 7

Lecture 7

28 pages

Lecture 1

Lecture 1

16 pages

Lecture 5

Lecture 5

15 pages

Lecture 7

Lecture 7

28 pages

Load more
Download CS 215 ­ Fundamentals of Programming II
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view CS 215 ­ Fundamentals of Programming II and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view CS 215 ­ Fundamentals of Programming II 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?