DOC PREVIEW
UI STAT 5400 - Computing in Statistics

This preview shows page 1-2 out of 5 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

122S:166Computing in StatisticsIntroductionLecture 2August 26, 2009Kate Cowles374 SH, [email protected] of Linux environment: likean upside-down tree• directories• subdirectories• files3Home directories• smart for multi-user system to provide eachuser private place to store files– called “home directory” in Linux• you are only regular user who can access filesin your home directory– system administrator also ca n– we will see later how to use chmod com-mand to give access to other peopl e• when you log in to Linux, you automaticallyend up with your h o me directory as the cur-rent directory4The “shell”• shell: program th a t sends co mmands typedat the keyboard to the operating system toperform• several shells available in UNIX and Linux– C shell ( csh )∗ developed for Berkeley UNIX– T C shell (tcsh)∗ default in our Linux network∗ enhanced version of C shell– Bourne Shell (sh) and its extensions∗ Bourne Again Shell (bash)∗ highly programmable Korn shell (ksh )• you can run a shell other than default shellsimply by typing its name– e.g., if you start up in tcsh and wish toswitch to ksh, type ksh, and a Korn shellwill start up5shell command to list the contents ofa directory• ls command lists the contents of a Linuxdirectory– unless options are used, ls gives just namesof files and subdirectorie s– all options start with an “-”– example: ls -l gives “long listing”– here’s part of its output for the contentsof my directory for this coursedrwx------ 2 kcowles faculty 8192 Aug 20 14:09 hwdrwx------ 2 kcowles faculty 96 Aug 20 14:21 labs2005drwx------ 2 kcowles faculty 96 Aug 11 14:43 lectsdrwx------ 2 kcowles faculty 8192 Aug 22 13:24 lects2005-rw------- 1 kcowles faculty 1013 Jul 30 16:24 online.resources-rw------- 1 kcowles faculty 8 Aug 22 12:46 questionnaire.aux-rw------- 1 kcowles faculty 1492 Aug 22 12:46 questionnaire.dvi-rw------- 1 kcowles faculty 5348 Aug 22 12:46 questionnaire.log-rw------- 1 kcowles faculty 1497 Aug 22 12:46 questionnaire.tex– first character of an entry is almost alwayseither∗ “-” — entry is a file∗ “d” — entry is a directory6– next nine characters show the security mo de(explained i n next section)– username o f owner of file– group owner of file∗ subset of peo ple with accounts on thesystem to which the owner belongs∗ we may choose to give them special ac-cess to this file– size of file in bytes– date a nd time when file was last modified– filename7File security in Linux• many PC users unfamiliar with the idea o ffile secu ri ty• Windows didn’t use to need security becauseit i s a sin g le-user OS• Linux is a multi-user O S, so it has securityto prevent people from accessing each o ther’sconfidential files• Linux computers a re not vulnera ble to virusesand worms that infect a computer by alteringfiles or writing ne w ones8Security characters in long listing• three sets of three characters– first set for user– second set for group– third set for other (everyone in the world)• letters r, w, and x mean different opera ti onsone can perform on a file– r — you can read the file’s contents– w — you can write or change the fil e ’scontents– x — you can execute the file (given onlyfor programs and directories)• 9 security characters as a group are called thesecurity mode of the file9Changing file p ermissions: “chmod”• chmod stands for “change mode”• first argument specifies which set(s) (user,group, or other) of 3 characters you want tomodify• second argument is a + (if you wish to addpermissions) or a - (if you want to take themaway• third argument is which permission(s) youwant to change10• examples:chmod g+r questionnaire.tex– would give the gro up (in this case facultyread permission for this filechmod a+rx hw– would give “all” (user, group, and other)read and execute permission for the direc-tory hw11Using “wildcards” to save typing• wildcard allows you to specify more than onefile i n one command• * matches any number of characters• to execute command on al l files in the cur-rent directory, specify * as the filen ame; e.g.chmod o-rx *• to execute a command on all the files withfilename questionnaire rega rd less of theirextension, use questionnaire.* as the file-name• other filename character is ?, which matchesexactly 1 character12Limitation of Linux security• to be able to give specia l access permissionsto a certain group of people, must get systemadministrator to create a group containingthose people• impossible to give different sets of access per-missions to a different groups o f peopl e be-cause any file or directory can have only o negroup owner• fix will be implemented in futu re version ofLinuxLearning which groups you are in• entergroups13Printing• basic Linux print commands– lpr — send file to printer– lpq — display print queu e– lprm — remove file from print queue• examples:– lpr thoughtssends file named “thoughts” to default printer– lpr -Pp346 thoughtssends same file to a printer called p346names of printers are determined by sys-tem administraor14lpq• lpq is used to check status of print jobs• lpq without any arguments produces statusof all print jobs in default print queue[kcowles@p-lnx402 ~]$ lpqp374 is readyno entries[kcowles@p-lnx402 lects2005]$ lpr root.ps[kcowles@p-lnx402 lects2005]$ lpr lect01.ps[kcowles@p-lnx402 lects2005]$ lpqp374 is ready and printingRank Owner Job File(s) Total Sizeactive kcowles 127 root.ps 99328 bytes1st kcowles 128 lect01.ps 116736 bytes• can use -P option to get status o f print jobsin a different queuelpq -P p346p346 is readyno entries15Canceling print jobs with lprm• lprm is short for “line printer remove”• use the job number to specify which one tocancel[kcowles@p-lnx402 lects2005]$ lprm 127[kcowles@p-lnx402 lects2005]$ lpqp374 is ready and printingRank Owner Job File(s) Total Sizeactive kcowles 128 lect01.ps 116736 bytes16Canceling other kinds of jobs• Use ps to list running jobs• u option restricts to your own (th e user’s)jobs[kcowles@p-lnx402 ~]$ ps uUSER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMANDkcowles 4277 0.0 0.0 44720 1468 pts/0 Ss 09:01 0:00 -cshkcowles 4299 0.0 0.2 63740 5860 pts/0 S+ 09:01 0:00 pinekcowles 4307 0.0 0.0 44720 1476 pts/1 Ss 09:10 0:00 -cshkcowles 4374 0.0 0.1 58936 3096 pts/1 S+ 09:36 0:01 vim lect2a.texkcowles


View Full Document

UI STAT 5400 - Computing in Statistics

Documents in this Course
Load more
Download Computing in Statistics
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 Computing in Statistics 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 Computing in Statistics 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?