From that folder, you can change to other folders,both up and down in the hierarchy, to view each directory’s contents.The path to the current folder is always displayed in the top area
Trang 1The File Manager
The File Manager enables you to graphically organize files into ahierarchical structure of folders and subfolders (directories)
Directories are displayed with folder icons Files are displayed withappropriate icons
The File Manager, by default, opens a view of a folder which is thecurrent directory From that folder, you can change to other folders,both up and down in the hierarchy, to view each directory’s contents.The path to the current folder is always displayed in the top area ofthe File Manager window
The path to the current folder
The pathname of the current folder
Trang 2File and Folder Icons
Trang 3File and Folder Icons
To help you identify files and directories more easily, the File Managerdisplays differing icons depending on the content of the file
The most common file icon you will see will be the standard file icon
If a file is a data file associated with a particular application, thatapplication will be automatically started when you double-click on theicon
If you double-click on a folder icon, the File Manager moves you intothat directory and displays its contents You can only move downthrough the file system hierarchy in this way
There is always a special icon displayed in the upper left corner of theFile Manager display
Double-clicking on this (go up) icon will move you to the next level up
in the hierarchy
Trang 4Moving and Copying Files Using Drag-and-Drop
File is selected then dragged
to the appropriate folder icon
Trang 5Moving and Copying Files Using Drag-and-Drop
Select + Drag + Drop
To move a file from one folder to another, position the mouse pointerover the file icon, hold down the left mouse button and drag the icon
to the appropriate folder icon
Once the file icon is positioned over the folder icon, release the mousebutton and the file will be moved to that folder
Control + Select + Drag + Drop
If you press the Control key before the file icon has been selected andkeep it held down while the drag-and-drop process takes place, the filewill be copied rather than just moved to the other folder
Note – You cannot move or copy file icons to the path icon display in
the top part of the File Manager window display
If you want to move or copy files to the parent directory of the currentfolder, you can drag and drop the file icon to the (go up) icon
Trang 6File Menu Options
The File Menu options enable you to perform the following tasks:
● Create a new folder (directory)
● Create a new file
● Change to your home directory (if your current folder is differentfrom your home folder)
● Go up one level of folder in the hierarchy
● Change to a specified directory
● Find files based on their name or content
● Open a Terminal window (in which to give UNIX commands)
Note – There are keyboard mnemonics which can be used as shortcuts
to the File menu options
Trang 7Creating a New Folder
Trang 8Creating a New Folder
When the New Folder option is chosen, a separate window isdisplayed Type the name of the new directory
Once the name has been applied, you have the choice of left clickingeither OK or Apply
● Clicking OK adds the new folder with the name you just typed,and closes the New Folder window
● Clicking Apply adds the new folder, and keeps the New Folderwindow on the screen display, ready for you to type in the name
of another new folder
If you want to create several new directories, click Apply for all newfolder names except the last When the last folder name has beentyped, click OK to remove the New Folder window
Note – When you click Apply, the name is retained in the typing area
Trang 9Creating a New File
As with the New Folder option, a window will be displayed in whichyou must type the name of the file to be created
If you click OK, the file will be created, with the name you typed, andthe New File window will close
However, if you click Apply, the file will be created and the New Filewindow will stay on the screen so you can create another new file By
Trang 10Folder or File Name Conflicts
If you attempt to create a folder or file with the same name as anexisting folder or file, you will be notified by the File ManipulationError window
Click OK, then type an alternative name for the folder or file which is
to be created
Trang 11Changing Folders
The Go To option on the File Manager’s File menu enables you tospecify which folder to change to by specifying a path name
Enter a valid pathname into the appropriate entry box, then click OK
If there are any permission controls which prevent you from changing
to the specified folder, you will be notified with the following windowdisplay:
Trang 12Finding Folders and Files
Trang 13Finding Folders and Files
The Find menu option enables you to search through the file systemhierarchy using search criteria The criteria can be either the name ofthe folder or file or, in the case of a file, the contents
Wildcard characters can be used when specifying the name of the file
to find For example:
a* Finds folder or file names which start with the letter “a”
*s Finds folder or file names which end with the letter “s”
??a Finds three-character folder or file names, where the last
character in the name is the letter “a”
[Aa]* Finds folder or file names which start with the letter “a”
(either uppercase or lowercase)
The search folder name is the starting point when searching the filesystem hierarchy
Note – If you start at the root of the file system (the / directory), the
Find operation may take a considerable amount of time to complete
Trang 14Selected Menu Options
The Selected Menu With a Folder Chosen
Trang 15Selected Menu Options
The Selected Menu With a File Chosen
Trang 16Selected Menu Options
File and Folder icons can be selected by clicking with the left mousebutton Once selected, the File Manager menu options enable you to:
● Move the selected object to another folder location
● Copy the selected object to another folder location or to a differentnamed folder or file
● Link the folder or file to another folder or file name (This optioncreates a symbolic link with the same name as the original file orfolder Links are covered in Module 14.)
● Place the object on the workspace area This placement makes thatobject available whether or not you have a File Manager windowopen
● Place the object in the trash can An alternative to this option is todrag and drop the object over the Trash Can icon on the Front
Trang 17Selected Menu Options
● Change the permissions of a folder or file (Permissions arecovered in Module 8.)
● Select or deselect all objects in the current folder Once selected,they can be moved, copied, or deleted as a complete group ofobjects
● Open a folder or file This menu option is the same as clicking on the object icon
double-● Print the file This is same as using drag and drop with the PrintManager icon on the Front Panel
Note – Different options display in the Selected menu, depending on
the type of file or folder selected
Trang 18View Menu Options
Clicking on Open New View in the View menu will open another FileManager window This facilitates moving files between differentdirectory hierarchies
The File Manager window can be set to Show Hidden Objects,allowing viewing of all objects in a directory Setting the Filter Optionsenables you to decide what objects will be hidden objects if you choosenot to have these objects displayed
The Update option of the View menu will redraw the File Managerwindow screen This is useful if objects have been hidden or movedaround during the current File Manager session
Trang 19View Menu Options
Set View Options enables you to choose the way in which the FileManager information is displayed in the window
The choices are as follows:
You can change the ordering of the display by name, file type, date, orsize
Trang 20View Menu Options
Tree Display for Folders
Trang 21View Menu Options
By using the Tree display for your folders, it becomes easier to movearound the file system hierarchy
When a folder is selected by double-clicking, another File Managerwindow will automatically be invoked and the contents of the selectedfolder will be displayed in the new File Manager window
Note – For every folder which is selected, a new File Manager window
will be invoked Close the File Manager windows if you have finishedworking with the contents of the folder; otherwise, the performance ofyour workstation will begin to degrade
Trang 22Exercise: Managing Files With File Manager
Exercise objective – In this lab you will use the commands introduced
in this module to create, move, and remove files and directories
Tasks
Complete the following exercises:
1 Open a File Manager window
2 Create a new folder and a new file Try giving the new file thesame name as the new folder (Correct as necessary.)
3 Change the View to a Tree view then back to the original view
4 Use the (go up) icon to change to the root folder (/)
5 Change to your home folder by double-clicking on the appropriatefolder objects
6 Use the Go To menu option change to the root folder
7 Use the appropriate menu option to change to your home folder
8 Delete your new file by dragging and dropping the new file objectonto the Trash Can icon on the Front Panel
Trang 23Exercise: Managing Files With File Manager
Exercise Summary
Discussion – Take a few minutes to discuss what experiences, issues,
or discoveries you had during the lab exercises
✓ Manage the discussion here based on the time allowed for this module, which was given
in the “About This Course” module If you find you do not have time to spend on
discussion, then just highlight the key concepts students should have learned from the lab exercise.
● Experiences
✓ Ask students what their overall experiences with this exercise have been You might want
to go over any trouble spots or especially confusing areas at this time.
✓ Explore with students how they might apply what they learned in this exercise to
situations at their workplace.
Trang 24Check Your Progress
Before continuing on to the next module, check that you are able toaccomplish or answer the following:
❑ Demonstrate the drag-and-drop capability of File Manager
❑ Create and remove folders
❑ Execute actions from the File Manager’s menu options
❑ Move a file or a folder onto the workspace
❑ Find a file using File Manager’s Locate facility
❑ Customize the manner in which file and folder information isdisplayed in the File Manager window
Trang 25Think Beyond
Now that you know how to manipulate files and directories on thecommand line and within CDE, which method are you most likely touse? In what situations might your choice be different?
Trang 26Upon completion of this module, you should be able to:
● Display file permissions
● Define permission types (read, write, and execute)
● Set and change file permissions using symbolic and octal notation
● Display the umaskvalue of a file or directory
Trang 27✓ Present the following question to stimulate the students and get them thinking about the issues and topics presented in this module While they are not expected to know the answer to the question, the answer should be of interest to them and inspire them to learn the content presented in this module.
Discussion – What types of protection would you like to be able to
place on files and directories? How would you group people youwork with and who would have access to your files and directories?
Additional Resources
Additional resources – The following reference can provide additional
details on the topics discussed in this module:
● Solaris Advanced User’s Guide, Part Number 801-6615-10
Trang 28Standard Solaris environment security features include userpasswords, which restrict access to the system; file and directoryprotection with permissions; files that control remote logins andcommands on individual workstations; and other features that enablesystem administrators to check for security breaches.
Trang 29The Solaris operating system has two default levels of security First,users must supply a login ID and password in order to access a Sunworkstation Second, files and directories are automatically protected
by permissions when they are created.
Superuser
Solaris provides a special user account calledrootthat has totalaccess to the system All permissions placed on files and directoriescan be overridden by the root user This account’s user is also calledthe superuser
The superuser account is used to run system administrationcommands and to edit critical system files such as the password file
Trang 30The ls -l Command
The ls -lcommand displays the following permissions:
● File type – This includes directories and ordinary files.
● User (owner) – The user who created the file or directory
● Group – Class of users defined by the system administrator
● Others (public) – All other users
Trang 31$ ls -l profile
-rw-r r 1 user2 staff 560 Jun 11 11:23 profile
File type
Trang 32Permission Categories
File Type
The first character is called the file type An ordinary file is represented
by a dash (–), and a directory is represented by ad A dash anywhereelse in a permission set indicates no permission The interpretation ofpermissions is slightly different for files and directories
User (Owner)
The next three characters are the user or owner permissions They show
the type of access the owner of the file or directory has When youcreate a new file or directory, it is owned by you
The owner of the file profilein the example isuser2
Trang 33Permission Categories
Group
The second set of three characters, called group permissions, identifies
the permissions of the group that owns the file A user group (systemgroup) is a set of users with common file access needs System
administrators define system groups and determine which usersbelong to which groups
Users in the same group can access each others’ files based on thegroup permissions
The group owner of the file.profile in the example is the groupstaff
though you are a member of the group, only the user category of
permissions applies The others permissions only apply to someonewho is neither the owner nor a member of the group
Trang 34How File and Directory Access Is Determined
UID and GID
All files and directories have a user identifier (UID) and groupidentifier (GID) number associated with them The kernel uses thesenumbers to identify ownership of files, rather than the user or groupname familiar to the user
Note – The -noption displays the UID and the GID
$ ls -an
drwxr-xr-x 2 101 10 512 May 24 17:25 mickey-rw-r r 1 101 10 0 May 24 17:25 profile
Trang 35Process For Determining Permissions
Every system process also has a UID and GID When a processattempts to read, write, or execute a file, the process’ system datainformation is compared to the file’s or directory’s UID, and then to
the GID If neither matches, then the other category of permissions is
used
Figure 8-2 Process for Determining Permissions
Yes
YesNo
No
UID=UID
GID=GID
Use other permissions
Use group permissions
Use user permissions
System process=File or directory
Trang 37Types of Permissions
Every file or directory has a set of permissions that determines who can
do what with it.
Permissions are represented by characters that control who may read,write, and execute the contents of a file or directory