DOC PREVIEW
UIUC CS 101 - lect08

This preview shows page 1-2-22-23 out of 23 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 23 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 23 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 23 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 23 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 23 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

8-2 What is a program? What is a “Window Manager” ? What is a “GUI” ? How do you navigate the Unix directory tree? What is a wildcard? Readings: See CCSO’s Unix pages andEngineering Workstations Unix Applications UNIX- operating system / C- programming language / Matlab Facilitate machine independent program development8-4 Computer program(software): a sequence of instructions that tells the computer what to do. A program takes raw data as input and produces information as output. System Software: • Operating Systems Unix,Windows,MacOS,VM/CMS,... • Editor Programs gedit, pico, vi Applications Software: • Translators and Interpreters gcc--gnu c compiler matlab – interpreter • User created Programs!!!X-windows-a Window Manager and GUI(Graphical User Interface) Click Applications and follow the menus or click on an icon to run a program.Click Terminal to produce a command line interface. When the following slides refer to Unix commands it is assumed that these are entered on the command line that begins with the symbol “>” (prompt symbol).Data, information, computer instructions, etc. are saved in secondary storage (auxiliary storage) in files. Files are collected or organized in directories. Each user on a multi-user system has his/her own home directory. In Unix users and system administrators organize files and directories in a hierarchical tree. secondary storage Home Directory When a user first logs in on a computer, the user will be “in” the users home directory. To find the name of the directory type > pwd (this is an acronym for print working directory) So the user is in the directory “gambill”The string “/home/gambill” is called a path. The path defines the location of a file or directory in the tree known by the Unix system. For this example we know that the directory tree contains the following: The directory “ / ” is called the root directory. / home gambill8-9 We can navigate through the directories using the “cd” command. For example, typing in cd .. gives8-10 We are now in the home directory. To go back to the gambill directory : > cd ~ (tilde) or > cd or > cd gambill (relative path) or > cd /home/gambill (absolute path) To go to a particular directory we can always list a path starting with the root “ / ” and going down directory by directory using the “ / ” as in the last example. This is an example of an absolute path. However since “gambill” is the name of a subdirectory of “home” we can use a relative path “gambill” . Here, the symbol “ / ” does not appear before gambill. Absolute and Relative Paths8-11 Use the “ls” (list) command to view the contents of a directory. Note that the contents of a directory are files and subdirectories, however using “ls” alone does not distinguish between the two.8-12 ls options arguments where options are any combinations of -a List all entries, including dot entries -c List by time of last file change -l List in long format, giving links, owner, size in bytes, and time of the last file change. -F Marks directories with a / -R Also lists each subdirectory found and arguments is a list of directories and / or filenames separated by blanks.8-13 > ls -la produces the output8-14 The last two lines of output from the ls -la command are described below. Note: to set permissions use the chmod command. Directory(d) /File(-)PermissionsLinksOwner’s logingroupsizeDate of last changeFile/Dir name- rwx --- --- 1 gambill ews 214Mar 31 2011cg.md rwxr-x--- 2 gambill ews 5 May 2 2011 cheating8-15 Permissions r - read w - write x - execute Permissions are assigned to the user, a group and other users.8-16 Given the above directory tree. Assume that your pwd is named jsmith. Use the ls command to list the contents of the mp1 directory. jsmith mp1 > ls mp1 pwd8-17 Given the files listed in the mp1 directory. Use the ls command to list just the files with the .m suffix. jsmith mp1 > ls mp1/*.m {FILES: main.m , final_graphs.m, test.fig, input.mat} pwd8-18 Given the files listed in the jsmith directory. Use the ls command to list just the files with the .mat suffix. Assume that mp1 is the pwd jsmith mp1 > ls ../*.mat {FILES: data.mat, a.out, } pwd8-19 List all the files in the cs101/data directory. cs101 data > ls ~cs101/data/* {FILES: mp1_data.m, mp1.m } jsmith mp1 pwd The tilde (~) character is shorthand for the absolute path to any home directory.8-20 From slide 14, if we want others to be able to read or run files in the ‘tom’ directory we would type: > chmod o+rx tom To change back to the original status, restricting permissions to just the user we would type: > chmod o-rx tom r - read w - write x - execute Permissions are assigned to the u user, g group and o other users.8-21 In matlab function files will have names like f.m or test.m and workspace variables and data are stored in files like my.mat . C files will have names like f.c or test.c . If you forget the exact name of a file use > ls *.m The “ * “ is a wildcard character meaning, match zero or more characters. Another wildcard is “ ? “ which means match exactly one character.8-22 To see the contents of a file (without using the editor program gedit) on the terminal use the more command. > more time_to_impact.m8-23 A program is a sequence of instructions that tells the computer what to do. X-Windows is an example of a “Window Manager”. “GUI” means graphical user interface. You navigate the Unix directory tree by using the cd command. A wildcard is a character such as “ * ” or “ ? ” (in UNIX) that are used to match filenames or directory


View Full Document

UIUC CS 101 - lect08

Documents in this Course
Notes

Notes

114 pages

lect2223

lect2223

35 pages

lect2223

lect2223

35 pages

lect1920

lect1920

23 pages

lect1920

lect1920

23 pages

lect1617

lect1617

25 pages

lect1617

lect1617

25 pages

lect1314

lect1314

34 pages

lect1314

lect1314

34 pages

lect0607

lect0607

25 pages

lect0607

lect0607

25 pages

lect25

lect25

31 pages

lect24

lect24

15 pages

lect21

lect21

25 pages

lect21

lect21

25 pages

lect18

lect18

22 pages

lect18

lect18

22 pages

lect15

lect15

37 pages

lect15

lect15

37 pages

lect12

lect12

31 pages

lect12

lect12

31 pages

lect11

lect11

28 pages

lect11

lect11

28 pages

lect10

lect10

28 pages

lect09

lect09

24 pages

lect09

lect09

6 pages

lect08

lect08

23 pages

lect05

lect05

26 pages

lect05

lect05

26 pages

lect04

lect04

36 pages

lect04

lect04

36 pages

lect03

lect03

26 pages

lect03

lect03

26 pages

lect02

lect02

36 pages

lect02

lect02

36 pages

lect01

lect01

32 pages

lect01

lect01

32 pages

lect00

lect00

23 pages

lect00

lect00

23 pages

Load more
Download lect08
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 lect08 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 lect08 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?