Upload
athlondekany
View
238
Download
0
Embed Size (px)
DESCRIPTION
Good
Citation preview
22-2 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Relevance
3 Present the following question to stimulate the students and get them thinking about theissues and topics presented in this module. While they are not expected to know theanswer to the question, the answer should be of interest to them and inspire them to learnthe content presented in this module.
Discussion Passwords are a major key to a secure system. Whatcharacteristics would a good password have?
Additional Resources
Additional resources The following reference can provide additionaldetails on the topics discussed in this module:
l Solaris Common Desktop Environment: Users Guide,Starting a Desktop Session, Part Number 802-6485
2Accessing Your System 2-3Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
User Accounts
You must have a user account on the system to log in. The user accountis defined in the /etc/passwd file and contains the elements whichidentify each unique user to the system.
System administrators are responsible for creating and maintaininguser accounts.
The Root Account
The root account is the system administration account and is set up bythe installation process. The root login account owns all system filesand has access to all files.
22-4 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
User Accounts
The /etc/passwdEntry
Each entry in the /etc/passwd file is made up of seven fieldsseparated by a colon.
Figure 2-1 Example /etc/passwd Entry
l Login ID Is the identification required by the operating systemfor a successful login. It is the users public name. Depending onthe system administrator, login IDs are usually some combinationof a users first and last names. For example, user Bob Woodslogin ID might be bobw, bwood, woodb, or bw2.
The login ID must:
t Be limited to eight alphanumeric characters
t Use lowercase characters only
t Be unique
l Placeholder Maintains the field for the password, which is kept inthe /etc/shadow file. The /etc/shadow file contains encryptedpasswords and password aging information (for example, howlong before a user must change a password and how long apassword must be in use before it can be changed). This file canonly be read by the system administrator.
l UID Identifies the user to the operating system.
l GID Identifies the primary group to which the user belongs.
user2:x:102:10:JohnDelany:/home/user2:/bin/ksh
UID
GID
Comment
Login directory Default shell
Placeholder
Login ID
2Accessing Your System 2-5Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
User Accounts
The /etc/passwdEntry
l Comment Is usually the full name of the user.
l Login directory Is commonly referred to as the home directory,where users store their files.
l Default shell Defines which shell the user will have upon login.
22-6 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Password Requirements
Your password protects your account from unauthorized access.
In the Solaris 7 computing environment, a password
l Must be six to eight characters in length
l Should contain at least two alphabetic characters and one numericor special character
l Must differ from the login ID
l Must differ from the previous password by at least threecharacters
l May contain spaces
These password requirements do not apply to the systemadministrator (superuser).
2Accessing Your System 2-7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
The Mouse Buttons
The mouse settings can be modified to suit a users preferences. Oncea setting has been modified, that setting can be stored into a user-specific file. This means that any personalized settings will be thedefault whenever a CDE session is initiated.
The Left Mouse Button
Most actions use the left mouse button, alternatively known asbutton 1 or the SELECT button. This button is used to make selectionsin any of the following ways:
l Make a window active by clicking the left mouse button while themouse pointer is in that window area
l Invoke a window menu by clicking on the left mouse button whilethe mouse pointer is on the windows menu box area
l Select an option from the Front Panel
l Select a File or Folder icon while working with the File Manager
22-8 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
The Mouse Buttons
The Left Mouse Button
l Open an icon by double-clicking the left mouse button while thepointer is over the icon
l Highlight text to be selected by dragging over the text area, whilethe left mouse button is being pressed
The Middle Mouse Button
Button 2, also known as the ADJUST button, is used to paste selectedtext. The text must have been selected using the left mouse button asdescribed previously.
The Right Mouse Button
When the right mouse button, or MENU button, is clicked or helddown, a menu of choices will appear. The options available on themenu will be determined by the position of the mouse pointer whenbutton 3 was pressed.
Note For the purposes of this course, you will be instructed to left orright click to perform a specific action. This assumes the standardright-hand configuration of the buttons. These notes will instruct youwhen a double-click is required.
2Accessing Your System 2-9Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Logging In
Logging in identifies you to the system. Before logging in to youraccount, CDE displays the Login Manager.
You can log in using the login screen shown, or at the command line.
The host name of your workstation
Menu of login options
22-10 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Logging in
The Options Button
The Options button on the CDE login screen provides a set of choices.
These are
Language Main Language-set Language Sub-set Session
Common Desktop Environment (CDE) OpenWindows Desktop Users Last Desktop Failsafe Session
Remote Login Command Line Login Reset Login Screen
2Accessing Your System 2-11Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Logging in
The Options Button
If a user chooses to work with a different windowing environment, thegraphics display to the right of the login, and password entry boxeswill display a graphic appropriate to the chosen windowingenvironment. The Failsafe session, where only the minimum servicesare available, is used for troubleshooting.
As an alternative to the CDE login display, the user can choose to login from a conventional login prompt.
Note If the Command Line Login option is chosen, you must pressthe Return key within 10 seconds of making this choice, otherwise theCDE login screen will restart.
When the user successfully logs out from a command-line prompt, theCDE login screen will be restarted.
22-12 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Logging in
Logging in Using the Login Screen
The CDE login screen replaces the usual login prompt.
You must enter your login name into the appropriate boxed area, thenpress the Return key or left click on the OK button.
If you log in incorrectly, you must repeat the procedure of enteringyour login name and password.
Note If you make a mistake when entering either your login name oryour password, you will be required to reenter both pieces ofinformation. Alternatively, you can left click on the Start Over buttonto return to the login display. The Start Over button will completelyrefresh the screen and remove any typed entry.
2Accessing Your System 2-13Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Logging in
Logging in Using the Command Line
To log in at the command line, follow these steps:
1. Display the Options pull-down menu and select Command LineLogin.
2. Press Return to get a prompt for user name entry.
Note You need to press Return fairly quickly or the Login Managerwill restart.
3. Type your user name (login ID) at the prompt and press Return.
3 Assign user names and have the students log in to their systems.
4. Type your password at the password prompt and press Return.
22-14 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Logging in
Logging in Using the Command Line
Note Your password does not appear as you type it. By default, ifyou do not have a password, you are automatically prompted for oneduring the initial login.
Exiting From the Command Line
To log out, at the prompt type:
$ exit
This will exit you from the system and display the CDE LoginManager.
2Accessing Your System 2-15Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Changing Your Password
Changing your password frequently helps prevent unauthorizedaccess to your system.
To change your password:
1. If you are logged into a CDE session, right click on the backgroundto bring up the Workspace Manager, click on Programs, and opena terminal window. (On some systems, the Workspace Managerwill have a menu selection labelled Windows. If that is the case,click on this instead of Programs to access a terminal window.)
2. Type the passwd command after the system prompt and pressReturn.
3. When the prompt Enter login password: appears, type yourcurrent password and press Return.
4. When the prompt New password appears, type your newpassword and press Return.
5. When prompted, retype the new password and press Return. (Thisis required for verification of the new password by the system.)
22-16 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Changing Your Password
Example
$ passwdpasswd: Changing password for user2Enter login password:New password:Re-enter new passwd:$
3 If the users are unable to change their passwords due to cred table errors, use thefollowing command on the Network Information Service Plus (NIS+) server:
newkey -u username -s nisplus
This puts the user login password in the NIS+ cred table.
2Accessing Your System 2-17Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
The CDE Workspaces
When you log in to a CDE session, four workspaces are available toyou by default. Each workspace is equivalent to a desktopenvironment.
You can independently set the characteristics of each workspace andadd more workspaces (desktops).
Alternate among your workspaces by left clicking on the appropriateworkspace button or by using the keyboard metakey (diamond)combined with the left or right arrow keys. In the illustration above,workspace One is selected.
Note In some locations the function of the metakey differs. It may benecessary to use the Alt key or space bar with the arrow keys toperform the function described here.
22-18 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Managing Windows
Overlapping Windows
When an icon is selected from the Front Panel, a window will open onyour workspace screen. Normally, windows on the workspace willoverlap each other, with the most recently opened windowoverlapping previously opened windows.
2Accessing Your System 2-19Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Managing Windows
Lowering a Window
To choose the window menu, position the mouse pointer on thewindow title area and press the right mouse button. One option in theresulting menu is to lower the window. This option will force thewindow to the back of the overlapping windows on your screendisplay.
The alternative keyboard action is to hold down the Alt key and pressfunction key 3 (Alt-F3).
Note There is no alternative to raising a window to the front of a setof overlapping windows. When selected, a window automaticallycomes to the front of any overlapping windows in a CDE display. TheFront key on the keyboard will also bring a window to the front of thedisplay.
Window title area
22-20 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Managing Windows
Moving a Window
To move a window, you can do either of the following:
l Choose the Move option from the window menu. The mousepointer will change from an arrow to a small cross. Drag the crosspointer to move the window. As the cross moves, an outline of thewindow will be displayed on your screen. When the outline is inthe desired position, click once with the left mouse button and thewindow will move there.
2Accessing Your System 2-21Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Managing Windows
Moving a Window
l Place the mouse pointer over the windows title area, hold downthe left mouse button, and drag the window to its new screenlocation.
When the window is being moved, a pair of numbers will bedisplayed on your screen. These are the X and Y axis values whichshow the new position of the window on your workspace display. Thenumber on the left (385) represents the horizontal (X) position. Thenumber on the right (231) represents the vertical (Y) position.
These numbers are useful to developers and programmers who wantto have a window appear in the same position every time anapplication is invoked.
22-22 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Managing Windows
Minimizing a Window
At the top right side of the window is a Minimize button. Clicking onthis button will convert the window into an icon.
The icon of a minimized window will be placed at the left edge of theworkspace display by default. However, it can be moved to anydesktop location by dragging the icon to the desired position.
Single left click
Double-click left button
2Accessing Your System 2-23Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Managing Windows
Minimizing a Window
Only one click of the left button is required to change a window to anicon.
To change the icon back into a window, you must double-click on theicon with the left button.
Clicking once on an icon will invoke the window menu. SelectingRestore will then change the icon back into a window.
22-24 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Managing Windows
Maximizing a Window
To make a window fill the entire workspace display, you must leftclick on the box button at the top right side of the window.
To reduce the full-display window to its previous window size, selectthe box button again. .
The box area represents the workspace display area
2Accessing Your System 2-25Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Managing Windows
Maximizing a Window
When the window is reduced to its previous size, it is placed in itsprevious display position on the workspace.
Note When a window occupies all of the workspace display, noother windows can be seen (as they are covered up). To switch toanother window, you must either lower the full-display window orreduce it to its previous size.
You can use the F9 and F10 function keys with the Alt key, as keyboardalternatives to using the mouse.
The Minimize and Maximize buttons are shown along with thewindow menu equivalents in the above figure.
22-26 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Managing Windows
Closing a Window
To close a window, double-click with the left mouse button in theupper left corner of the window. A window can also be closed bysingle clicking with the left mouse button in the upper left corner andthen selecting the Close option.
Double-click left button
Single left click
2Accessing Your System 2-27Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Managing Windows
Closing a Window
The keyboard alternative to close a window is Alt+F4.
Most applications will request that you confirm the closure of awindow that contains unsaved data.
22-28 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Leaving the CDE Session
Logging out prevents unauthorized users from gaining access to yourfiles.
Using the Exit Button
The Exit Button, on the Front Panel, is used to log out from your CDEsession.
By default, you will be asked to confirm that you want to log out.Confirmation is done by clicking on the OK button or by pressingReturn when the OK button is highlighted.
2Accessing Your System 2-29Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Leaving the CDE Session
Using the Exit Button
The current CDE session will be saved automatically so that you canreturn to the same workspace windows at your next CDE session.However, any data contained in the current set of open windows willbe lost. You must therefore save all data before exiting from your CDEsession.
It is possible to change the default activities of the Exit button so thatconfirmation is not required. This is discussed in a later module.
Single left click
22-30 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Notes
2Accessing Your System 2-31Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Exercise: Accessing Your System
Exercise objective In this exercise, you will practice logging in onthe command line, changing your password, logging out, and otherbasic CDE skills.
Tasks
Complete the following steps:
1. Obtain a user name and password from your instructor.
2. Log in to the system using the Command Line Login option.
3. Change the password to mypass1.
4. Log out of the system.
5. Log back in to the system using the Command Line Login optionand the new password, then log back out.
6. At the CDE login screen, enter the following (incorrect) details:
Login Name: nosuchuserPassword: wrong
Observe the information displayed on the screen.
7. At the CDE login screen, enter your own (correct) details and login to a CDE session.
8. Using the correct mouse and Front Panel buttons, switch from thedefault workspace display to Workspace Three. From WorkspaceThree, switch back to Workspace One.
9. Click on the Text Note icon on the Front Panel to open a Text Notewindow.
10. Once the Text Note window has been opened, convert the windowto an icon.
11. Convert the Text Note icon back to a Text Note window.
22-32 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Exercise: Accessing Your System
Tasks
12. Move the Text Note window to another position on yourworkspace display.
13. Make the Text Note window take up all of your workspace displayarea.
14. Reduce the Text Note window back to its previous size.
15. Type some text into the Text Note window, then attempt to closethe window.
16. Confirm that you want to close the window without saving thetext.
17. Exit from your current CDE session.
18. Confirm that you want to log out.
19. Once you are back at the CDE Login Screen, log in again usingyour allocated login name and password.
Workshop Labs
Use what you have learned so far in this course to work through thefollowing:
1. A new employee is given a Sun workstation to log in to. Afterrepeated attempts, the login fails. Why might this have happened?
2. A user would like to be able to do some command-line aliasing tomake issuing commands easier. What would the systemadministrator have to have done to make this work every time theuser logs in?
2Accessing Your System 2-33Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Exercise: Accessing Your System
Exercise Summary
Discussion Take a few minutes to discuss what experiences, issues,or discoveries you had during the lab exercises.
3 Manage the discussion here based on the time allowed for this module, which was givenin the About This Course module. If you find you do not have time to spend ondiscussion, then just highlight the key concepts students should have learned from thelab exercise.
l Experiences
3 Ask students what their overall experiences with this exercise have been. You might wantto go over any trouble spots or especially confusing areas at this time.
l Interpretations
3 Ask students to interpret what they observed during any aspects of this exercise.
l Conclusions
3 Have students articulate any conclusions they reached as a result of this exerciseexperience.
l Applications
3 Explore with students how they might apply what they learned in this exercise tosituations at their workplace.
22-34 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Exercise: Accessing Your System
Exercise Solutions
2. Log in to the system using the Command Line Login option.
Click on Option button on CDE Login screen. Click on Command LineLogin. Press Return and enter your login name at the prompt, followedby the assigned password.
3. Change the password to mypass1.
$ passwdold password:new password:re-enter new password:
4. Log out of the system.
$exit
2Accessing Your System 2-35Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Check Your Progress
Before continuing on to the next module, check that you are able toaccomplish or answer the following:
q List the characteristics of an effective password
q Change your password
q Describe the function of a mouse button
q Log in and log out of a system from the command line
q Log in and out of a CDE session
q Manipulate windows within the CDE
q Invoke and use menus and menu bars
22-36 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Think Beyond
On a UNIX system, it is not unusual for users to be forced to changetheir passwords on a regular basis. What are some reasons for this?
3-1Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Featuresof theCommonDesktopEnvironment 3
Objectives
Upon completion of this module, you should be able to
l Describe the arrangement of the Front Panel
l Add workspaces to the Front Panel
l Remove workspaces from the Front Panel
l Rename workspaces
l Minimize the Front Panel
l Open the Front Panel window from the icon
l Lock your workstation
l Add an application to a Front Panel subpanel
l Customize your workspace
33-2 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Relevance
3 Present the following question to stimulate the students and get them thinking about theissues and topics presented in this module. While they are not expected to know theanswer to the question, the answer should be of interest to them and inspire them to learnthe content presented in this module.
Discussion What tasks do you complete most often? How do youaccess the necessary tools?
Does your screen typically provide enough room for you to arrangeyour open applications? How do you manage all the applications youneed running or open?
3Features of the Common Desktop Environment 3-3Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
The Front Panel Arrangement
Browser CalendarFile Manager
Text NotesMailer Display Lock
Mailsubpanel
Applicationssubpanel
Filessubpanel
Cardssubpanel
Linkssubpanel
Workspacebuttons
Workspacebuttons
Session ExitPrinter Style Manager
Perf MeterHelp
Trash Can
Trashsubpanel
Helpsubpanel
Hostssubpanel
PersonalPrinterssubpanel
Toolssubpanel
33-4 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
The Front Panel Arrangement
The Front Panel allows you to manage applications, files, and networkservices easily. The Front Panel has been organized to include icons fora web browser, text notes, and a performance meter. The subpanelscontain cascading submenus for ease of navigation. Click on an up-arrow button to open a subpanel; click on an item in a subpanel torun it.
The spinning globe above the Exit button indicates the system is busy.When it is clicked on, it will prompt you for a uniform resource locator(URL), pathname, host, email address, and so forth to open.
3Features of the Common Desktop Environment 3-5Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Front Panel Menu Button
At the top left side of the Front Panel is the Front Panel window menubutton. If this is selected, a menu of choices is displayed.
33-6 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Front Panel Menu Button
From this menu, it is possible to perform the following actions:
l Move the Front Panel to another location on screen. This can alsobe done by dragging the Front Panel to a new position by one ofthe move handles.
l Minimize the Front Panel display.
l Lower the Front Panel display behind overlapping windows.
l Refresh the entire workspace display.
l Log out from the CDE session.
Alternate ways of minimizing, restoring, and logging out arediscussed later in this module.
3Features of the Common Desktop Environment 3-7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Locking the Display
LockButton
33-8 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Locking the Display
Left clicking on the Display Lock button on the Front Panel locks thescreen. The backdrop will be blank, by default, and the PasswordPrompt box will be displayed for only a short time.
To bring the password prompt back to the display, move the mouse orpress a key on the keyboard. Once the display has been locked, it canonly be unlocked by entering the correct password for the user wholocked the screen.
Note If a user locks the display and has forgotten the password, theroot user (superuser) can enter the root password to unlock the display.
The Style Manager, discussed later, enables you to allocate programsto run on the screen while the display is locked.
3Features of the Common Desktop Environment 3-9Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Workspace Buttons
33-10 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Workspace Buttons
As mentioned in Module 2, Accessing Your System, there are fourworkspaces available when you start your first CDE session. You canadd a number of additional workspaces, each of which takes up thewhole display area of the screen.
If you click the right mouse button while the pointer is situated overthe workspace buttons area, you will be given a menu of options. Oneof these options is to add a workspace. A limited menu will appear ifthe pointer is positioned over the area between the workspace buttons,instead of over the button itself.
When a new workspace is added, it will be given the name New.
3Features of the Common Desktop Environment 3-11Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Workspace Buttons
You can change the name of a workspace by either of the followingtwo methods:
l Choose the Workspace Buttons Menu option Rename.
or
l Double-click on the workspace name in the central area of theFront Panel display.
Be careful not to give the workspace a name which is too long to befully displayed. If the name is too wide for the display, only the left-most characters will be displayed in the Front Panel display area.
Workspaces can be deleted from the Front Panel area by using theWorkspace Buttons menus Delete option.
33-12 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Minimizing the Front Panel
Single clickto minimizethe Front
Panel
Double-clickto openthe Front
Panel
Workspace name
3Features of the Common Desktop Environment 3-13Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Minimizing the Front Panel
Minimize the Front Panel by clicking on the Minimize button at thetop right corner of the Front Panel window. The resulting icon willshow the name of the current workspace immediately below it. Torestore the Front Panel display, double-click on the Front Panel icon.
If the icon is hidden behind another window, you can either:
l Lower the overlapping windows until you can see the Front Panelicon
or
l Keep pressing the Alt-Tab keys until the Front Panel icon isbrought to the front of the overlapping windows displayed onyour screen
33-14 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
The Workspace Menu
Note The Workspace Menu on your system may look different thanthat pictured above.
3Features of the Common Desktop Environment 3-15Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
The Workspace Menu
The Workspace menu provides easy mouse access to all yourapplications, tools, and files through cascading submenus. Move thepointer to the backdrop, then press the right mouse button to displaythe Workspace menu; choose any submenu.
33-16 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Voice and Text Note Applications
3Features of the Common Desktop Environment 3-17Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Voice and Text Note Applications
The Voice Notes application lets you personalize your mail messages.Select Voice Note from the Applications subpanel to record voiceinput. Note that selecting Voice Note starts up Audio in record mode.A microphone or voice input device is necessary for this application towork.
Text Notes lets you create Post-It style notes on your workspace.Select Text Note from the Applications subpanel to record text input.The note can then be minimized and left on your workspace as areminder. You can drag notes into mail messages as mail attachments.
33-18 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Address Manager
3Features of the Common Desktop Environment 3-19Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Address Manager
Address Manager enables you to search corporate name databases andorganize your contacts in electronic cards. You can scheduleappointments, send email, and dial telephone numbers directly fromthe electronic cards.
33-20 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Customizing Your Workspace With Style Manager
The Style Manager enables you to customize the following workspaceattributes:
l Color Set the color attributes of the windows and the workspacebackground
l Font Set the size of the font display (in points)
3Features of the Common Desktop Environment 3-21Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Customizing Your Workspace With Style Manager
l Backdrop Set the workspace backdrop display
l Keyboard Set key-click and key-repeat characteristics
l Mouse Set mouse button positions, acceleration, and thresholdvalues
l Beep Set the tone and duration of the beep
l Screen Set screen blanking characteristics and lock backgroundprograms
l Window Set the behavior controls for windows and icons
l Startup Set the logout and CDE session startup controls
33-22 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Style Manager Options
Color Control
The color controls enable you to select a color system for the backdrop,window borders, window pane, and menu areas of the display. Eachwill be set to a color based on the palette chosen from the list. Once apalette is chosen, it can be modified to suit your needs by clicking onModify. Color changes will apply to all workspaces.
3Features of the Common Desktop Environment 3-23Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Style Manager Options
Font
Changing the font size will alter the display character size of the nextand subsequent windows opened. The text size in the Help Viewerdocuments are not affected by changing font size.
Different font sets can be added to the list of Font Groups by clickingon the Add button. The Attributes button enables you to choosealternate character sets.
33-24 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Style Manager Options
Backdrop
The Backdrop choice enables you to change the background for thecurrent workspace. Color choices you make will also affect thebackdrop appearance.
Each workspace can have a different backdrop applied to it.
3Features of the Common Desktop Environment 3-25Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Style Manager Options
Keyboard
The Keyboard controls enable you to turn key repeating on or off.
If you want to have the keys make a sound when they are pressed,you can adjust the click volume to be as loud as possible.
If the value is set to zero (0), the keyclick is effectively turned off.
If any changes have been made to the settings, selecting the Defaultbutton will set the values back to those shown in the Style Managerillustration (page 3-22).
33-26 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Style Manager Options
Mouse
Changing handedness of the mouse will reverse mouse buttons 1 and3. Button 2 can be used to select text or objects (Adjust) or drag-and-drop objects (Transfer). If Adjust is selected, transfer actions (drag) willrequire the use of mouse button 1.
The maximum time between clicks of a double-click can be adjusted.Changes to this will become effective with a new login session.Acceleration changes how fast the mouse pointer moves across thedisplay. Threshold determines the distance in pixels the pointer movesat slow speed before moving at the accelerated rate.
3Features of the Common Desktop Environment 3-27Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Style Manager Options
Beep
The volume of the beep noise can be set to a value between 0 and 100.If set to 0, the beep noise will effectively be turned off.
Tone will determine the pitch of the beep, from 82 to 9000 Hertz.
The duration of the beep noise can be set to last up to 2.5 seconds.
33-28 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Style Manager Options
Screen
The Screen controls enable you to designate which screensaverprogram will run when you lock your workstation display. You candesignate a number of screensavers to run, in succession, and haveeach of them run for a period between 0 and 120 minutes.
You can also set the period of screen inactivity (in the above example,15 minutes) at which the screensaver will automatically be invoked.
3Features of the Common Desktop Environment 3-29Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Style Manager Options
Window
This control allows you to designate how windows and icons can bemanipulated.
33-30 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Style Manager Options
Startup
Setting the Home Session saves the current work session windows asthe default windows to open when the next Home session is started. Ifyou choose Set Home Session, this will override any previously savedinformation. You can choose to either return to the session as it iswhen you log out (Current session) or to your Home session whenyou log back in.
Turning off the Logout Confirmation Dialog option means that youwill automatically be logged out when the Exit button is selected,without any further confirmation being requested. If the LogoutConfirmation Dialog option is set to on, you will be asked to confirmthat you do want to log out when you choose to exit. When you startyour next work session, the data contained in any windows will eitherbe gone or be set to default values.
3Features of the Common Desktop Environment 3-31Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Notes
33-32 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Customizing Subpanels
ApplicationManagerIcon
3Features of the Common Desktop Environment 3-33Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Customizing Subpanels
The subpanels or pull-up menus located on the Front Panel enable youto add desired applications for easier access. It is easy to add anddelete new action buttons for launching your most frequently usedapplications or scripts. You can add applications to the subpanel menulist by dragging the appropriate icon from the Application Managerwindow display and dropping it on the Install Icon area of thesubpanel. Many frequently used applications can be found by clickingon the Applications icon on the Applications subpanel.
To manipulate an icon on a subpanel or delete it from the subpanel,right click on the desired icon. This displays a menu of options relatingto the icon. Subpanels can be torn off and placed on the workspaceby using the same method you use to move a window.
You can place the most frequently used icons on your Front Paneldisplay by clicking on the Promote to Front Panel choice in the menuof options. This will speed up access to the most commonly usedprograms and help to reduce the need to open subpanel lists.
33-34 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Application Manager
3Features of the Common Desktop Environment 3-35Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Application Manager
The Application Manager window contains six folders.
Open the Desktop folders to see icons which can be added to asubpanel. This is achieved by dragging and dropping the desired iconon the Install Icon area of the subpanel. Once the icon has been addedto the subpanel, that application can be invoked from the subpanelitself.
Icons can also be added to the Front Panel by right clicking in a blankarea of the Front Panel and then clicking Add Icon.
Note An application icon can be placed on the workspace display inthe same way. The application is then available directly from theworkspace.
The System_Admin folder contains icons which are useful for systemadministrators. The OpenWindows folder contains icons which can beused to open OpenWindows programs while working in a CDEenvironment.
33-36 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Exercise: Using the Front Panel
Exercise objective In this lab you will customize the Front Panelusing the skills you have learned in this module.
Tasks
Complete these steps:
1. Switch between each workspace by clicking on the appropriateworkspace button.
2. Lock your display so that only you can return to your CDEsession.
3. Invoke the Style Manager and undertake each of the followingtasks:
t Increase the size of your font display
t Change the backdrop of your current workspace
t Change the backdrop of workspace Three
t Turn on the keyboard click capability
t Change your Startup controls so that you are not requested toconfirm when you log out
t Set your Home Session to the current active windows
t Set CDE to return to your Home Session
4. Log out from your CDE session, then log back in to see what haschanged.
3Features of the Common Desktop Environment 3-37Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Exercise: Using the Front Panel
Tasks
5. Open the Application Manager from the Applications subpaneland add the following two objects to the Applications subpanel.(You will have to find the appropriate icons in the ApplicationManagers folders.)
Workshop Labs
Use what you have learned so far in this course to work through thefollowing:
1. Your desktops can be used to display different projects orprograms you work with every day.
a. Customize your desktops so that their names reflect projectsor programs you work with.
b. Make each backdrop different and make any othercustomizations that you prefer (for instance, whether awindow is active when clicked in or when the pointer is in thewindow, font size, screen locking characteristics).
c. Have all minimized icons be displayed in an icon box on thedesktop.
d. Once you have made your changes, log out in such a way thatyou will return to your home session and log back in.
2. Add icons for the calculator and a terminal window to a subpanel.Place the icon you would use the most in this subpanel on theFront Panel for easier access.
3. Add the calculator icon to the Front Panel.
33-38 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Exercise: Using the Front Panel
Exercise Summary
Discussion Take a few minutes to discuss what experiences, issues,or discoveries you had during the lab exercises.
3 Manage the discussion here based on the time allowed for this module, which was givenin the About This Course module. If you find you do not have time to spend ondiscussion, then just highlight the key concepts students should have learned from thelab exercise.
l Experiences
3 Ask students what their overall experiences with this exercise have been. You might wantto go over any trouble spots or especially confusing areas at this time.
l Interpretations
3 Ask students to interpret what they observed during any aspects of this exercise.
l Conclusions
3 Have students articulate any conclusions they reached as a result of this exerciseexperience.
l Applications
3 Explore with students how they might apply what they learned in this exercise tosituations at their workplace.
3Features of the Common Desktop Environment 3-39Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Check Your Progress
Before continuing on to the next module, check that you are able toaccomplish or answer the following:
q Describe the arrangement of the Front Panel
q Add workspaces to the Front Panel
q Remove workspaces from the Front Panel
q Rename workspaces
q Minimize the Front Panel
q Open the Front Panel window from the icon
q Lock your workstation
q Add an application to a Front Panel subpanel
q Customize your workspace
33-40 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Think Beyond
What application would you put on your Front Panel? How wouldyou customize the different workspaces? What are some of the waysyou might customize the Front Panel for your work environment?
4-1Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
GettingHelp 4
Objectives
Upon completion of this module, you should be able to:
l Describe how to obtain help from the Front Panel
l Describe how to obtain application-specific help
l Invoke the Help Viewer from the Front Panel
l Invoke help from an application window
l Display on-line manual pages, including different sections of themanual
l Search the on-line manual pages by keyword
3 In order for the man -k command to work, the MANPATH variable must be set to:/usr/local/man:/usr/share/man:/usr/openwin/share/man:/usr/dt/man and the catmanutility must be run by root. Depending on the processor, running this utility may take upto one hour and should be done before teaching this section.
44-2 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Relevance
3 Present the following question to stimulate the students and get them thinking about theissues and topics presented in this module. While they are not expected to know theanswer to the question, the answer should be of interest to them and inspire them to learnthe content presented in this module.
Discussion How do you typically get information about how tocomplete computer tasks?
What types of information do you usually need?
4Getting Help 4-3Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Front Panel Help
The Help Manager icon is situated at the right side of the Front Panel.
Clicking on the icon with the left mouse button will open up a HelpViewer window.
44-4 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Front Panel Help
Help Managersubpanel
4Getting Help 4-5Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Help Viewer
The hypertext links, shown as underlined text or boxed graphics, canbe used to quickly move to a related help page by clicking on theappropriate area of text in the Help window.
The Backtrack option allows you to retrace the path you followedthrough the help screens.
44-6 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Searching the Help Index
The Index Search enables you to see all volumes of help. Thesevolumes are displayed as hyperlinks, which can be used to referenceany help page. You can also search for specific help items based on akeyword search.
4Getting Help 4-7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
AnswerBook2
If installed, an icon on the Help subpanel will enable you to access theAnswerBook2 system.
The AnswerBook2 system enables you to view an on-linerepresentation of the printed manuals. As with the Help Viewer, thereare hyperlinks that can be used to skip to the relevant pages of the on-line manual.
By default AnswerBook2 uses the HotJava browser to displayinformation. You can perform searches of parts of the AnswerBook orof the entire collection installed on your system.
Due to the amount of disk space which is taken up by theAnswerBook2 pages, your system administrator may not haveinstalled AnswerBook2 on the computers hard disk. However, it ispossible to access AnswerBook2 files from a compact disc-read onlymemory (CD-ROM) or hard disk device connected to a remote host onyour computer network.
44-8 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
AnswerBook2
If AnswerBook2 is accessible through your network, be aware thatthere will be a delay between requesting and displaying AnswerBook2pages. The speed with which the pages are collected from the remotehard drive or CD-ROM device is dependent on network configurationand activity.
4Getting Help 4-9Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
On Item Help
The On Item Help icon is situated in the subpanel. When this functionis selected, the mouse pointer will change from an arrow pointer to aquestion mark with an arrowhead at its base. The pointer can then bepositioned over a Front Panel icon to access the appropriate help pagefor that item, which will be displayed in a Help Viewer window. Themouse pointer will revert back to an arrow pointer at this time.
44-10 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
On Item Help
The On-Item Help function will only work on icons or within theApplication Manager windows.
Note The Information menu item accesses the Application ManagerInformation README files.
The On ItemHelp icon
4Getting Help 4-11Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Other Ways to Access Help
Right clicking in any free space on the desktop will display theWorkspace menu. From the Workspace menu, you can select the Helpoption from the Programs submenu.
This is another method for invoking the Help Viewer displayed byclicking on the Front Panel Help icon. Once the Help Viewer has beeninvoked, you can use it as described previously.
44-12 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Other Ways to Access Help
Most windows also have a Help menu option specific to the currentapplication.
Help menu
4Getting Help 4-13Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Displaying Man Pages
The UNIX Programmers Manual (also called man pages) describeswhat you need to know about the systems on-line commands, systemcalls, file formats, and system maintenance. The on-line man pages arepart of the Solaris computing environment.
Using the manCommand
Use the man command to display on-line man pages for commands.
Command Format
man name
man -k keywordman -s section name
44-14 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Displaying Man Pages
Using the manCommand Without Options
$ man cdReformatting page. Wait... done
CD(1) User Commands CD(1)
NAME cd, chdir, pushd, popd, dirs - change working directory
SYNOPSIS /usr/bin/cd [ directory ]
sh cd [ argument ]
chdir [ argument ]DESCRIPTION /usr/bin/cd
The cd utility will change the working directory of thecurrent shell execution environment. When invoked with nooperands, and the HOME environment variable is set to anon-empty value, the directory named in the HOME environment
variable will become the new working directory.
OPERANDS The following operands are supported:
directory An absolute or relative pathname of the directorythat becomes the new working directory. Theinterpretation of a relative pathname by cd
depends on the CDPATH environment variable.
SEE ALSOcsh(1), ksh(1), pwd(1), sh(1), chdir(2), attributes(5),
environ(5)
SunOS 5.7 Last change: 28 Mar 1995 4
4Getting Help 4-15Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Displaying Man Pages
Scrolling in Man Pages
Use the following keys to control the scrolling capabilities while usingthe man command:
Spacebar Scroll through a manual page one screen at atime
Return Scroll through a manual page one line at a time
b Move back one screen
f Move forward one screen
q Quit the man command
/string Search forward for information
n Find the next occurrence of string
h Give a description of all scrolling capabilities
44-16 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Displaying Man Pages
Searching Man Pages by Section
There are multiple sections in the man pages. The SEE ALSO part atthe bottom of a man page lists alternate references that pertain to thetopic addressed. When these references are followed by a numberother than 1 in parentheses, it indicates a section of the man pageswhich can be accessed using the -s option with the man command.
For example, executing $ man passwdwill display information on thepasswd command and give instructions on how to change a password.The SEE ALSO section of this man page reads in part as follows:
SEE ALSOfinger(1), login(1), nispasswd(1), crypt(3C),passwd(4)
Executing $ man -s 4 passwd will display information on the/etc/passwd file and $ man -s 3C crypt will display informationon password encryption.
4Getting Help 4-17Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Displaying Man Pages
Searching Man Pages by Keyword
If you are not sure of the command name, use the -k option to specifya keyword as a subject.
Note Using $ whatis command will display the header line fromthe manual section. The man page itself can then be displayed with byusing the man command.
an -k calendarcm (1) - calendar manager, appointment and
resource scheduling tooldelete cm_delete (1) - delete appointments from Calendar
Manager databaseinsert cm_insert (1) - insert appointments into Calendar
Manager databaselookup cm_lookup (1) - look up appointments from Calendar
Manager database.cmsd rpc.cmsd (1) - calendar manager service daemonrade_cm upgrade_cm (1) - script for upgrading Calendar Manager
from SVOL to Openwindowscal (1) - display a calendar
endar calendar (1) - reminder serviceftime difftime (3c) - computes the difference between two
calendar timesime mktime (3c) - converts a tm structure to a calendar
time
44-18 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Exercise: Getting Help
Exercise objective In this lab you will practice using the helpfunctions available with CDE and the command-line man pages.
Tasks
Complete the following steps:
1. Open a Help Viewer window by clicking on the appropriate FrontPanel icon.
2. In the Help Viewer window, select Index and choose All Volumes.
3. Find information on how to play an audio file. After reading thisinformation, open the Audio player from the Workspace menuand play the /usr/demo/SOUND/sounds/spacemusic.au audiofile.
4. Display the on-line manual (man) page for the ls command.
5. Display the on-line manual pages for the passwd command andthe passwd file.
6. Find the on-line manual page that describes how to clear theterminal screen (use the keyword clear).
7. Display the Help subpanel and determine whether AnswerBook2has been made available on your system.
8. If you do have AnswerBook2, invoke it from the subpanel andlook through the Solaris CDE Users Guide.
9. When you are finished, close the AnswerBook2 window.
4Getting Help 4-19Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Exercise: Getting Help
Workshop Labs
Use what you have learned so far in this course to work through thefollowing:
1. Using the Calendar Manager, add an appointment for lunchtimeon every Wednesday for the next month. Have the system sendyou an email message 30 minutes before the appointment andplace a reminder on your desktop 10 minutes before theappointment. Use any version of help you need to perform thistask.
2. What meaning would an ampersand & in the gcos field of apassword file entry carry for the system?
44-20 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Exercise: Getting Help
Exercise Summary
Discussion Take a few minutes to discuss what experiences, issues,or discoveries you had during the lab exercises.
3 Manage the discussion here based on the time allowed for this module, which was givenin the About This Course module. If you find you do not have time to spend ondiscussion, then just highlight the key concepts students should have learned from thelab exercise.
l Experiences
3 Ask students what their overall experiences with this exercise have been. You might wantto go over any trouble spots or especially confusing areas at this time.
l Interpretations
3 Ask students to interpret what they observed during any aspects of this exercise.
l Conclusions
3 Have students articulate any conclusions they reached as a result of this exerciseexperience.
l Applications
3 Explore with students how they might apply what they learned in this exercise tosituations at their workplace.
4Getting Help 4-21Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Exercise: Getting Help
Exercise Solutions
4. Display the on-line manual (man) page for the ls command.
man ls
5. Display the on-line manual pages for the passwd command andthe passwd file.
man passwdman -s 4 passwd
6. Find the on-line manual page that describes how to clear theterminal screen (use the keyword clear).
man -k clear
44-22 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Check Your Progress
Before continuing on to the next module, check that you are able toaccomplish or answer the following:
q Describe how to obtain help from the Front Panel
q Describe how to obtain application-specific help
q Invoke the Help Viewer from the Front Panel
q Invoke help from an application window
q Display on-line manual pages, including different sections of themanual
q Search the on-line manual pages by keyword
4Getting Help 4-23Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Think Beyond
Which type of help would you be most likely to use? Would thischange depend on what you needed help on?
5-1Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
AccessingFiles andDirectories 5
Objectives
Upon completion of this module you should be able to:
l Contrast absolute and relative pathnames
l Access files and directories within the file structure using absoluteand relative pathnames
l Identify and describe the parts of a command line
l Access files and directories within the file structure usingpathname abbreviations
l List the contents of directories and their file types
l Identify various metacharacters
l Enter more than one command on a single command line
l Demonstrate the use of wildcard characters
55-2 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Relevance
3 Present the following question to stimulate the students and get them thinking about theissues and topics presented in this module. While they are not expected to know theanswer to the question, the answer should be of interest to them and inspire them to learnthe content presented in this module.
Discussion How does the Solaris system know how to find files anddirectories?
Additional Resources
Additional resources The following reference can provide additionaldetails on the topics discussed in this module:
l Solaris Users Guide, Part Number 802-6499
5Accessing Files and Directories 5-3Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
File System Structure
Figure 5-1 shows a typical Solaris system file structure; you will referto this again later in this course.
Figure 5-1 Solaris File System Structure
user2
dir1
dir2
dir3
dir4
practice file1 file4 fruit2
file3 fruit
file2
dante_1
dante
trees
fruit
coffees
beans nuts
recipes
beans
notes
planets
mars pluto
flowers
home
/
55-4 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Pathnames
A pathname uniquely identifies a particular file or directory byspecifying its location. Pathnames are similar to a road map or a set ofdirections that tells you how to get from one place in the directoryhierarchy to another.
Note Depending on the setup of your system, home directories canbe found in either /home or /export/home. For the purposes of thisdiscussion, /home is used.
The slashes within the pathnames are delimiters between objectnames. A slash in the first position represents the / (root) directory.For example:
/home/user2/dir1/coffees
Figure 5-2 Pathname With Delimiters
Delimitersroot directory
5Accessing Files and Directories 5-5Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Notes
3 The concept of pathnames is critical to the students understanding of how to access filesin the file structure. Pathnames identify every file in the file structure.
3 Briefly describe the Solaris file structure in terms of a hierarchy of directories,subdirectories, and files. The file cabinet analogy works well with the Solaris computingenvironment file structure. If the file cabinet analogy does not work for everyone, youmight draw a tree structure. Use root (/) and some directories to illustrate the root,branches, limbs, and so on.
3 At some point it should be noted that this is not what the students file structure will looklike back at the office. In other words, the file names, and possibly the location of thehome directory, will be different in their work environment. The structure shown is anexample only.
3 If the classroom lab is set up in such a way that students home directories are under/export/home, explain that when home directories reside on the local system they are put,by convention, under /export/home. When home directories are provided by a homedirectory server, by convention, they are found under /home.
55-6 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Pathnames
There are two types of pathnames: absolute and relative.
Absolute Pathname
An absolute pathname specifies a file or directory in relation to the entireSolaris file hierarchy. The hierarchy begins at the / (root) directory.Absolute pathnames always:
l Start at the root (/) directory and list each directory along the pathto the destination file (or directory)
l Use a slash (/) between each directory name in the path to indicatedifferent directories
5Accessing Files and Directories 5-7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Pathnames
Absolute Pathname
Refer to Figure 5-1 on page 5-3 for a visual representation of thefollowing pathnames:
l Absolute pathname to user2
/home/user2
l Absolute pathname to dir1
/home/user2/dir1
l Absolute pathname to coffees
/home/user2/dir1/coffees
55-8 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Pathnames
Relative Pathname
A relative pathname describes the location of a file or directory as itrelates to the current directory. If you are in a directory and you wantto move down the directory tree, it is not necessary to type theabsolute pathname. You can just type the path starting with the nameof the next directory in the directory structure. If a pathname does notbegin with a slash, it is a relative pathname.
Relative pathnames are useful because they are shorter than absolutepathnames.
5Accessing Files and Directories 5-9Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Pathnames
Relative Pathname
Use Figure 5-1 on page 5-3 to support these examples:
l The current directory
/home
l Relative pathname to user2
user2
l Relative pathname to dir1
user2/dir1
l Relative pathname to coffees
user2/dir1/coffees
55-10 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Command-Line Syntax
When using a terminal window, a shell prompt appears on the screen.For the Bourne and Korn shells, the shell prompt for a user is a dollarsign ($). For a C shell user, the prompt is a percent sign (%).
At the shell prompt, you can type commands. Commands areinstructions which tell the system to perform an action.
The general format for Solaris 7 commands is:
command Executable (specifies what you want the system to do)
options Modify the executable (specifies how you want thecommand run)
argument File or directory, including the path name, or text. If apathname is not specified for a file or directoryargument, then the operating system will use thecurrent directory.
$ command [option(s)] [argument[s]]
5Accessing Files and Directories 5-11Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Command-Line Syntax
l A space must be used as a delimiter between each part of thecommand line.
l Up to 256 characters can be entered on a single command line.
l Many commands do not require all three parts.
Some examples are:
$ cal (Command only)$ cal 1987 (Command and argument)$ date (Command only)$ date -u (Command and option)$ banner "hi there" (Command and argument)
55-12 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Changing Directories Using the cdCommand
Files you need to access are often stored in subdirectories below yourhome directory. Because of the way in which a UNIX file system is setup, it is often desirable to change directory locations.
Use the cd command to change to a new current directory. Thiscommand, like all UNIX commands, accepts both absolute and relativepathnames.
Command Format
cd [directory_name]
5Accessing Files and Directories 5-13Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Changing Directories Using the cdCommand
Moving Around the Directory Hierarchy
You can use cd with:
t An absolute pathname
$ cd /home
t A relative pathname
$ cd user2/dir1
Use the cd command without a directory name to return to your homedirectory.
$ cd
55-14 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Displaying the Current Directory Using the pwdCommand
Remembering which directory you are currently working in is oftendifficult. Use the pwd (print working directory) command to displaythe absolute pathname of your current directory.
Command Format
pwd
5Accessing Files and Directories 5-15Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Displaying the Current Directory Using the pwdCommand
Determining Your Current Directory
$ pwd/home/user2$
$ cd /home$ pwd/home$
$ cd$ cd practice$ pwd/home/user2/practice$
3 Directories always contain a link to their parent directory (..) and a link to themselves (.).
55-16 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Displaying the Current Directory Using the pwdCommand
Pathname abbreviations are a form of shorthand when movingbetween or referring to directories.
Table 5-1 Pathname Abbreviations
3 The symbol ~+ refers to the current working diretory ($PWD). It is used mostly whenwriting scripts.
Symbol Meaning
. Current (working) directory
.. Parent directory; the directory directlyabove the current directory
~ Users home directory (Korn and Cshells)
~- The full path to the previous workingdirectory (Korn shell only)
~logname The home directory of the userspecified by logname
5Accessing Files and Directories 5-17Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Displaying the Current Directory Using the pwdCommand
Use pathname abbreviations with the cd command to move aroundthe file structure. For example:
$ pwd/home/user2/dir1
$ cd ..$ pwd/home/user2
$ cd ../..$ pwd/
$ cd ~/practice$ pwd/home/user2/practice
$ cd ~-$ pwd/
$ cd ~guest$ pwd/home/guest
55-18 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Using the lsCommand
To determine the contents of a directory, use the ls command. Thiscommand will display a listing of all files and directories withinspecified directories. If no pathname is given as an argument, ls willdisplay the contents of the current directory.
Command Format
ls [-option(s)] [pathname[s]]
5Accessing Files and Directories 5-19Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Using the lsCommand
Listing the Contents of a Directory
$ cd$ pwd/home/user2$
$ lsdante dir1 dir3 file1 file3 practicedante_1 dir2 dir4 file2 file4$
$ ls dir1coffees fruit trees$
$ ls /var/mailuser1 user2 user3 user4 user5$
3 Have the students try using absolute and relative pathnames.
Displaying Hidden Files
File names that begin with a dot (.) are called hidden files. Hidden filesare frequently used to customize a users work environment. They arenot shown by default because they are infrequently edited.
Use ls -a to list all files in a directory, including hidden (.) files.
Using ls to Display Hidden Files
$ pwd/home/user2$ ls -a. .kshrc dante1 dir2 dir4 file2 file4.. dante dir1 dir3 file1 file3 practice$
55-20 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Using the lsCommand
Displaying File Types
Use ls -F to display file types. The various file types are displayedusing the following symbols:
Showing File Type
$ pwd/home/user2$$ ls -Fdante dir1/ dir3/ file1 file3 practice/dante_1 dir2/ dir4/ file2 file4$$ ls -F /etccron@ asppp.cf* shadow uucp/
$
3 Links will be discussed more fully later in the course. If necessary, introduce symboliclinks here by explaining that they are a way to give an alternate name to a file. Furtherdiscussion of both hard and symbolic links, along with how to create them, is contained inModule 14, File and User Information Utilities."
Table 5-2 File Type Symbols
File Type Symbol
Directory /
Executable *
Plain text file/ASCII (none)
Symbolic link @
5Accessing Files and Directories 5-21Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Using the lsCommand
Displaying a Long Listing
To see detailed information about the contents of a directory use thels -l command.
Getting Detailed Information Using the lsCommand
$ ls -ltotal 8-rw-r--r-- 1 user2 staff 320Dec 7 11:43 dante-rw-r--r-- 1 user2 staff 368Dec 7 11:45 dante_1drwxr-xr-x 5 user2 staff 512Dec 4 13:43 dir1drwxr-xr-x 4 user2 staff 512Dec 4 13:36 dir2drwxr-xr-x 3 user2 staff 512Dec 4 13:44 dir3drwxr-xr-x 3 user2 staff 512Dec 4 13:44 dir4-rw-r--r-- 1 user2 staff 0Dec 2 09:05 file1$
3 total 8 indicates the number of 512-byte blocks used at this level of the directorystructure.
This command provides the following file information:
Note Using ls -t will list files with the most recently modified atthe top of the list.
File type ( for regular file or d for directory, for example)PermissionsLinksOwnerGroupSizeLast modification date and timeFile name
drwxr-xr-x 5 user2 staff 512 Dec 4 13:43 dir1-rw-r--r-- 1 user2 staff 0 Dec 2 09:05 file1
55-22 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Using the lsCommand
Listing Individual Directories
Use ls -ld to display detailed information about a directory, but notits contents. This is useful when you want to see the permissions on adirectory and not the information about its contents. (Permissions arediscussed in detail in Module 8.)
Obtaining Detailed Directory Information
$ cd$ ls -l dir1total 6drwxr-xr-x 2 user2 other 512 Dec 9 11:10 coffeesdrwxr-xr-x 2 user2 other 512 Dec 9 11:10 fruitdrwxr-xr-x 2 user2 other 512 Dec 9 11:10 trees$ ls -ld dir1drwxr-xr-x 5 user2 other 512 Dec 4 13:43 dir1$
Use ls -R to display the contents of a directory and all of itssubdirectories.
Displaying a Recursive Listing
$ pwd/home/user2$ ls -R dir1coffees fruit trees
dir1/coffees:beans nuts
dir1/fruit:
dir1/trees:
Note The R (or sometimes r) option is commonly used with manyUNIX commands to indicate a recursive action. Recursive generallyrefers to the contents of a directory and all of its subdirectories.
5Accessing Files and Directories 5-23Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Metacharacters
Metacharacters are keyboard characters with special meaning to theshell. They are a powerful feature of any shell. A general definition ofa metacharacter is any keyboard character that is not alphanumeric;for example:
; $ % ! ~ * ? [] < > |
It is very important not to use metacharacters when naming files anddirectories. The dot (.) and underscore (_) are the only two non-alphanumeric characters that are not metacharacters. This is why youcan use the dot (.) and the underscore (_) in file names. A hyphen (-),even though it is a metacharacter (used to delineate options in acommand line), can also be used in file names.
55-24 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Metacharacters
Asterisk
The asterisk (*) represents zero or more characters, except the leadingdot on a hidden file. The asterisk is often referred to as a wildcardcharacter.
5Accessing Files and Directories 5-25Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Metacharacters
Asterisk
Examples
$ lsdante dir1 dir3 file1 file3 fruit practicedante_1 dir2 dir4 file2 file4 fruit2
$ ls d*dante dante_1dir1:coffees fruit treesdir2:beans notes recipesdir3:planetsdir4:flowers
$
55-26 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Metacharacters
Question Mark
The question mark (?) matches any single character, except for theleading dot on a hidden file.
5Accessing Files and Directories 5-27Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Metacharacters
Question Mark
Examples
$ lsdante dir1 dir3 file1 file3 fruit practicedante_1 dir2 dir4 file2 file4 fruit2
$ ls dir?
dir1:coffees fruit trees
dir2:beans notes recipes
dir3:planets
dir4:flowers
$
The following example illustrates the message you will receive if nofile name matches the wildcard character:
$ ls z?z?: No such file or directory$
55-28 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Metacharacters
Square Brackets
Use square brackets ([ ]) to match a set or range of characters for asingle character position. The characters inside the brackets do notgenerally need to be in any order; for example, [abc] is the same as[cab]. However, if you are looking for a range of characters, theymust be in proper order (for example, [az] or [39]). If you want tosearch for all alphabetic characters, whether lowercase or uppercase,use [Az] for the pattern to match. You can use alphabetic or numericcharacters for the search pattern.
5Accessing Files and Directories 5-29Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Metacharacters
Square Brackets
Examples
$ ls [b-f]*dante dir1 dir3 file1 file3 fruit practicedante_1 dir2 dir4 file2 file4 fruit2$$ ls [af]*file1 file2 file3 file4 fruit fruit2$
55-30 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Metacharacters
Semicolon
The semicolon (;) enables you to enter multiple commands on a singlecommand line. The semicolon is also referred to as the commandseparator.
Command Format
command;command
5Accessing Files and Directories 5-31Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Metacharacters
Semicolon
Using the Semicolon
$ cd;lsdante dir1 dir3 file1 file3 fruit practicedante_1 dir2 dir4 file2 file4 fruit2$
$ date;cal;pwdSun Jul 18 11:05:39 MDT 1999 July 1999 S M Tu W Th F S 1 2 3 4 5 6 7 8 9 1011 12 13 14 15 16 1718 19 20 21 22 23 2425 26 27 28 29 30 31
/home/user2$
55-32 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
File System Structure
Figure 5-3 Solaris File System Structure
user2
dir1
dir2
dir3
dir4
practice file1 file4 fruit2
file3 fruit
file2
dante_1
dante
trees
fruit
coffees
beans nuts
recipes
beans
notes
planets
mars pluto
flowers
home
/
5Accessing Files and Directories 5-33Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Exercise: Accessing Files and Directories
Exercise objective In this lab you will use the commands discussedin this module to change directories and list directories.
Tasks
Use Figure 5-3 on page 5-32 to identify the pathnames for thefollowing objects:
1. Specify the absolute pathnames for:
t user2_____________________________________________
t coffees_______________________________________________
t dir4__________________________________________________
Assume /home/user2 is the current directory for the next twoquestions.
2. Specify the relative pathnames for:
t dir3___________________________________
t flowers___________________________________________
t recipes___________________________________________
3. Specify the relative pathnames for the dir1 subdirectories andfiles.
__________________________________________________
__________________________________________________
__________________________________________________
__________________________________________________
__________________________________________________
55-34 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Exercise: Accessing Files and Directories
Tasks
Using Figure 5-3 on page 5-32 as reference, perform each of thefollowing tasks on your system. Use pathname abbreviationswhenever possible.
4. Change to the your home directory.
5. Change to the dir1 directory.
6. Change to the fruit directory.
7. Change to the planets directory.
8. Change to the your home directory.
9. Change to the /etc directory.
10. Change to the recipes directory.
11. Change to the flowers directory.
Use the ls and cd commands to complete the following steps. Refer toFigure 5-2 on page 5-4 for the first six steps as needed.
12. Return to your home directory.
13. Change to the dir1 directory.
14. List the contents of the dir1 directory.
5Accessing Files and Directories 5-35Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Exercise: Accessing Files and Directories
Tasks
15. Display a recursive listing of the contents of the dir2 directory.
16. Use the ls command to display a detailed listing of your homedirectory, including hidden files.
17. Use the ls option that will recursively display all subdirectories inyour home directory.
Is there a directory in the root directory (/) called kernel?
_________
Is there a directory in /var/spool called cron?
18. Without changing directories, type the ls command that willdisplay all file names that end with the number 1 in your homedirectory.
19. On one command line, change to your home directory and list thecontents of the directory.
20. Issue an ls command that will display file and directory names ofany length beginning with the letters d or f.
21. Issue an ls command that will display all files starting with filefollowed by any one character.
55-36 Fundamentals of Solaris 7Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Exercise: Accessing Files and Directories
Workshop Labs
Use what you have learned so far in this course to work through thefollowing:
1. The system administrator has created a common project directorycalled Projects. This directory is a subdirectory to the rootdirectory. You would like to display a listing of the files in thisdirectory and see when they were last accessed. The default displaywould be for when each file was last modified. How can you getthe desired display?
2. User commands generally reside in the /usr/bin directory. A fewdays ago the system administrator showed you how to display acalendar and you remember that the command started with a c.You need to use this command again to find out what day of theweek the first of January 2000 falls on. Using the skills you havelearned, find the information you require.
5Accessing Files and Directories 5-37Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1999, Revision D
Exercise: Accessing Files and Directories
Exercise Summary
Discussion Take a few minutes to discuss what experiences, issues,or discoveries you had during the lab exercises.
3 Manage the discussion here based on the time allowed for this module, which was givenin the About This Course module. If you find you do not have time to spend ondiscussion, then just highlight the key concepts students should have learned from thelab exercise.
l Experiences
3 Ask students what their overall experiences with this exercise have been. You might wantto go over any trouble spots or especially confusing areas at this time.
l Interpretations
3 Ask students to interpret what they observed during any aspects of this exercise.
l Conclusi