Presentation is loading. Please wait.

Presentation is loading. Please wait.

CMSC 104, Version 8/061L03OperatingSystems.ppt Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux.

Similar presentations


Presentation on theme: "CMSC 104, Version 8/061L03OperatingSystems.ppt Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux."— Presentation transcript:

1 CMSC 104, Version 8/061L03OperatingSystems.ppt Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.

2 CMSC 104, Version 8/062L03OperatingSystems.ppt What is an Operating System (OS)? A computer program Performs many operations, such as: Allows you to communicate with the computer (tell it what to do) Controls access (login) to the computer Keeps track of all processes currently running At this point, your main concern is how to communicate with the computer using the OS

3 CMSC 104, Version 8/063L03OperatingSystems.ppt What Is A Process? A process is a task or program that you have requested the operating system do on your behalf. That process is given an identifying number, called a PID (process ID).

4 CMSC 104, Version 8/064L03OperatingSystems.ppt How Do I Communicate With the Computer Using the OS? You communicate using the operating system’s user interface. Graphical User Interface (GUI) – Microsoft Windows, Linux KDE Command-driven interface - DOS, UNIX, Linux, Microsoft Command Prompt We will be using the Linux operating system, which is very similar to UNIX.

5 CMSC 104, Version 8/065L03OperatingSystems.ppt How Do I Communicate With the Computer Using the OS? (con’t) When you log in to the Linux system here, a user prompt will be displayed: linux#[1]% _ where # is the number of the Linux server that you have connected to. You may use any of the Linux servers. The number in the brackets will change as you work. It is the “number” of the command that you are about to type. If this prompt is not on the screen at any time, you are not communicating with the OS.

6 CMSC 104, Version 8/066L03OperatingSystems.ppt User Prompt While the normal (or default) prompt is: linux#[1]% you can change this. To learn Linux well enough to do this, we recommend that you take CMSC121, a one credit course.

7 CMSC 104, Version 8/067L03OperatingSystems.ppt Linux Overview Files and Filenames Directories and Subdirectories Frequently Used Commands

8 CMSC 104, Version 8/068L03OperatingSystems.ppt Files A file is a sequence of bytes. It can be created by o a text editor (xemacs or pico) o a computer program (such as a C program) It may contain a program, data, a document, or other information. Files that contain other files are called directories (sometimes called folders).

9 CMSC 104, Version 8/069L03OperatingSystems.ppt Linux Filenames Restrictions o May not contain blanks or other reserved characters. o Have a maximum length (however, make your filenames long enough to be useful and short enough to type without making a mistake. o Are case sensitive. It is best to stick with filenames that contain letters (uppercase or lowercase), numbers, and the underscore ( _ ) for now. Filenames that start with a period are hidden files, so that when see the files in a directory, they don’t show up.

10 CMSC 104, Version 8/0610L03OperatingSystems.ppt Directories Directories contain files or other directories called subdirectories. They may also be empty. Directories are organized in a hierarchical fashion, or directories can contain other directories. They help us to keep our files organized.

11 CMSC 104, Version 8/0611L03OperatingSystems.ppt Directories (con’t) /afs/umbc.edu/users/j/d/jdoe28 junkrecipes notes piescookies CMSC104 apple peach choc_chip

12 CMSC 104, Version 8/0612L03OperatingSystems.ppt Directories (con’t) One example is to have a directory for CMSC104. Inside you could have a directory for each project, and whatever. Rule of Thumb: Never have more files in one directory than fits on the screen when you list them.

13 CMSC 104, Version 8/0613L03OperatingSystems.ppt Directories (con’t) Your home directory is where you are located when you log in (e.g., /afs/umbc.edu/users/j/d/jdoe28 ). The current directory is where you are located at any time while you are using the system. Files within the same directory must be given unique names. Paths allow us to give the same name to different files located in different directories. Each running program has a current directory and all filenames are implicitly assumed to start with the name of that directory unless they begin with a slash.

14 CMSC 104, Version 8/0614L03OperatingSystems.ppt Subdirectories Are used for organizing your files For example, o make a subdirectory for CMSC104 o make subdirectories for each project CMSC104 project1 project2... project8

15 CMSC 104, Version 8/0615L03OperatingSystems.ppt Moving in the Directory Tree. (dot) is the current directory... (dot-dot) is the parent directory. Use the Linux command cd to change directories. Use dot-dot to move up the tree. Use the directory name to move down. Use the complete directory name (path name) to move anywhere.

16 CMSC 104, Version 8/0616L03OperatingSystems.ppt Pathnames Pathnames that start at the beginning (and start with a /): /afs/umbc.edu/users/j/d/jdoe28 are called absolute pathnames. Pathnames can be shorted, so that if jdoe28 is the current directory and we have a file in that directory call schedule, we can edit it with just the filename (a relative pathname): pico schedule

17 CMSC 104, Version 8/0617L03OperatingSystems.ppt Permissions Files and directories have permissions. There are three sets of permissions for three groups: o Read, write, execute (or, if a directory, access) o User, group, other You are the user, and can set and change permissions.

18 CMSC 104, Version 8/0618L03OperatingSystems.ppt Frequently Used Linux Commands passwd, man, lpr pwd, ls, cat, more, cd, cp, mv, rm mkdir, rmdir ctrl-c, ctrl-z References: Linux man pages Links from the 104 homepage Books and the Internet

19 CMSC 104, Version 8/0619L03OperatingSystems.ppt Linux Command Format Fromat: cmd options arguments Options and arguments are optional. Options start with - or - - Options are different for each command. Arguments are different for each command. When in doubt, look up the command in the on-line help, man.

20 CMSC 104, Version 8/0620L03OperatingSystems.ppt man On-line help. Argument is the command you wish to have help for. Option –k is most common, which looks for a description that contains the argument. When the description of a command takes more than one screen to display, press the space bar for more information and q to quit.

21 CMSC 104, Version 8/0621L03OperatingSystems.ppt man (cont’d) Example: [burt@linux1 ~]$ man -k passwd htpasswd htpasswd (1) - Create and update user authentication files kpasswd kpasswd (1) - change a user's Kerberos password mkpasswd mkpasswd (1) - generate new password, optionally apply it to a user passwd.nntp passwd.nntp (5) - passwords for connecting to remote NNTP servers saslpasswd saslpasswd (8) - set a user's sasl password saslpasswd2 saslpasswd2 (8) - set a user's sasl password v5passwd v5passwd (1) - change a user's Kerberos password

22 CMSC 104, Version 8/0622L03OperatingSystems.ppt passwd Used to change your password. NAME passwd - update a user's authentication tokens(s) SYNOPSIS passwd [-k] [-l] [-u [-f]] [-d] [-n mindays] [-x maxdays] [-w warndays] [-i inactivedays] [- S] [username]

23 CMSC 104, Version 8/0623L03OperatingSystems.ppt lpr Used to print something on the printer. You must pay per page. Pick up your print-out at ECS-019.

24 CMSC 104, Version 8/0624L03OperatingSystems.ppt cd Change directory. With no argument, it will take you back to your home directory. With a argument, it will set that directory to be your current working directory, assuming you have permission to access the directory.

25 CMSC 104, Version 8/0625L03OperatingSystems.ppt pwd Print the current working directory. Helpful when you forget where you are. Has no options or arguments.

26 CMSC 104, Version 8/0626L03OperatingSystems.ppt ls Lists the names of files in a directory. Arguments are name(s) of file(s) and/or director(ies). Normally, when you specify a directory, you get the contents of the directory.

27 CMSC 104, Version 8/0627L03OperatingSystems.ppt ls Options -aall (including hidden files) -djust show the directory, not the files in the directory -Fclassify files as ordinary, directory (/), or executable (*) --color classify with color -llong format -rshow in reverse order -Rrecursive, show the contents of all subdirectories.

28 CMSC 104, Version 8/0628L03OperatingSystems.ppt cat Used to display the contents of a file. If there is too much to fit on the screen, the first part scrolls off and leaves only the last screenful. Argument is the name of a file or files. Useful option is –n (or –number) to show the line numbers.

29 CMSC 104, Version 8/0629L03OperatingSystems.ppt more More shows a screen full of a file at a time. SYNOPSIS more [-dlfpcsu] [-num] [+/ pattern] [+ linenum] [file] DESCRIPTION More is a filter for paging through text one screenful at a time. This version is especially primitve. Users should realize that less(1) provides more(1) emulation and extensive enhancements. Less is a similar command with more features.

30 CMSC 104, Version 8/0630L03OperatingSystems.ppt cp This allows you to create a new copy of an existing file. Two mandatory arguments, source and destination. o Source is the name of the existing file. o Destination is the name for new file. If you change the contents of the new file, you do not change the contents of the old file.

31 CMSC 104, Version 8/0631L03OperatingSystems.ppt ln Allows you to create two names for one file by “linking” them, similar to a shortcut in Microsoft Windows. Two mandatory options are the source and destination, just like for cp. If you change the new version, you change the old version.

32 CMSC 104, Version 8/0632L03OperatingSystems.ppt mv This allows you to rename a file and/or move it to a new location. Two mandatory arguments, source and destination. o Source is the name of the existing file. o Destination is the new name and/or location for the existing file. At completion, there is only one file.

33 CMSC 104, Version 8/0633L03OperatingSystems.ppt rm Allows you to remove or delete a file. Normally, once a file is removed, it is gone forever! (UMBC has changed this and it moves the file to a backup directory, where you can recover it, if necessary. However, this is not a long-term option!)

34 CMSC 104, Version 8/0634L03OperatingSystems.ppt rm (cont’d) The argument(s) are a list of files to remove. Options include: o -iinteractive, ask first (UMBC has set this as the default) o -rrecursive, delete the files in the subdirectories and the subdirectories. NOTE: rm –r directory will remove directories that are not empty!

35 CMSC 104, Version 8/0635L03OperatingSystems.ppt mkdir Used to create a new directory. Argument(s) is/are the name(s) of the new directory(ies).

36 CMSC 104, Version 8/0636L03OperatingSystems.ppt Wildcard Characters You will find wildcard characters useful when manipulating files (e.g., listing or moving them). The wildcard characters are * and ? ? is used to represent any single character. * is used to represent 0 or more characters.


Download ppt "CMSC 104, Version 8/061L03OperatingSystems.ppt Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux."

Similar presentations


Ads by Google