Beruflich Dokumente
Kultur Dokumente
a ble
f e r
ans
n - t r
a no
Oracle Solaris h a s10 Operating
m ) ideฺ
System
i l ฺ coEssentials
t G u
o t ma Guide
Activity d e n
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
D61752GC21
Edition 2.1
June 2011
D73329
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Disclaimer
This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and
print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way.
Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display,
perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization
of Oracle.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
The information contained in this document is subject to change without notice. If you find any problems in the document, please
report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
warranted to be error-free.
If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United
States Government, the following notice is applicable:
s
ha eฺ
Author )
Enzo Silva
i l ฺ comt Guid
o t ma den
Technical Contributor and Reviewer
@ h S tu
Mike Lanker
- 90 thi s
l z
le Oracle
This book was published using: se Tutor
t e u
i s a- e to
z (lu cens
élle li
a T
Luis
Table of Contents
Practices for Lesson 1: Oracle Solaris 10 Operating System Essentials ................................................ 1-1
Practices for Lesson 1............................................................................................................................. 1-2
Practices for Lesson 2: Using the Oracle Solaris 10 OS .......................................................................... 2-1
Practices for Lesson 2: Overview............................................................................................................. 2-2
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
Practices for Lesson 3: Using Command-Line Features and Online Help Resources ............................ 3-1
f e r
Practices for Lesson 3: Overview............................................................................................................. 3-2
an s
t r
Practice 3-1: Constructing Commands ..................................................................................................... 3-3
n -
a no
Practice 3-2: Using Command-Line Features ........................................................................................... 3-4
Practice 3-3: Scrolling Through Online man Pages................................................................................... 3-5
h a s
Practice 3-4: Using Online Documentation ............................................................................................... 3-6
m ) ideฺ
Practice Solutions: Using Command Line Features .................................................................................. 3-7
i l ฺ co t Gu
t m a
Practices for Lesson 4: Viewing Directories and Files ............................................................................
e n 4-1
h o t u d
Practices for Lesson 4: Overview............................................................................................................. 4-2
é l le
Practice Solutions: li Directory File Commands........................................................................... 5-6
T for Lesson 6: Using the vi Editor.............................................................................................. 6-1
Practices
a
s
ui Practices for Lesson 6: Overview............................................................................................................. 6-2
L Practice 6-1: Using the vi Editor ............................................................................................................... 6-3
Practices for Lesson 7: Using Commands Within the Shell .................................................................... 7-1
Practices for Lesson 7: Overview............................................................................................................. 7-2
Practice 7-1: Working in the Korn Shell .................................................................................................... 7-3
Practice Solutions: Working in the Korn Shell ........................................................................................... 7-5
Practices for Lesson 8: Using Basic File Permissions ............................................................................ 8-1
Practices for Lesson 8: Overview............................................................................................................. 8-2
Practice 8-1: Changing File Permissions .................................................................................................. 8-3
Practice Solutions: Changing File Permissions......................................................................................... 8-6
Practices for Lesson 9: Configuring Access Control Lists (ACLs).......................................................... 9-1
Practices for Lesson 9: Overview............................................................................................................. 9-2
Practice 9-1: Using Access Control Lists .................................................................................................. 9-3
Practice Solutions: Using Access Control Lists......................................................................................... 9-6
Practices for Lesson 10: Searching Files and Directories ....................................................................... 10-1
Practices for Lesson 10: Overview ........................................................................................................... 10-2
Practice 10-1: Locating Files and Text ..................................................................................................... 10-3
m ) ideฺ
Practices for Lesson 16: Performing Remote Connections ..................................................................... 16-1
o u
a ilฺc nt G
Practices for Lesson 16: Overview ...........................................................................................................
Practice 16-1: Performing Remote Connection Commands ......................................................................
16-2
16-3
t m e
Practice Solutions: Performing Remote Connection Commands ud
ho St............................................................... 16-5
9 @
0 this
-
t e l lez use
i s a- e to
z (lu cens
élle li
a T
Luis
a ble
f e r
ans
n - t r
a no
Practices for h a s
Lesson 1:
)
m ui10 e ฺ
d Operating
Oracle
i l ฺ coSolaris
t G
a eEssentials
System
t m n
@ S tu1 d
hoChapter
- 9 0 this
t e l lez use
i s a- e to
z (lu cens
élle li
a T
Luis
Practices Overview
There are no practices for Lesson 1.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
a ble
f e r
ans
n - t r
a no
Practices for h a s
Lesson 2: Using
) e ฺ
the Oracle
i l ฺ comtSolaris
G uid 10 OS
o t ma 2 den
Chapter
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Practices Overview
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
To identify components of the computer, complete the following steps:
Tasks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Luis ___________________________________________________________
___________________________________________________________
6. Name the default shell for the root (/) user in the Solaris 10 OS.
__________________________________________________________
7. Match the following terms with their descriptions:
__ Shell a. Core of the Solaris OS
__ Kernel b. Command interpreter
__ Hard Disk c. Storage device
Overview
To log in using your desktop environment login screen and change your password, complete the
following steps:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Tasks
1. Obtain a username and password from your instructor.
2. Log in to the system using the desktop environment Login screen.
a. Type your username, and press Return.
b. Type your password, and press Return.
3. Right-click the desktop environment background.
The Workspace menu appears.
4. Select Open Terminal from this menu. a ble
f e r
A terminal window appears.
ans
5. Use the passwd command to change your password to mypass1.
n - t r
o
$ passwd
s an
passwd: Changing password for username
) ha eฺ
comt Guid
Enter existing login password:
New password: i l ฺ
Re-enter new passwd:
o t ma den
@ h S tu
passwd: passwd successfully changed for username
- 90 thi s
$
l z
le use
6. e
Close the terminal window.
t
a- e to
7. i s
Click Launch > Log Out <username> to log out of the desktop environment session.
z (lu cens
A logout confirmation window appears.
8. élle li
Click OK or press Return to continue to log out.
a T
Luis9. Enter the following incorrect username and password on the Login screen:
Username: student2
Password: wrong
The following message appears:
Login incorrect; please try again
10. Click and hold down the Options button on the Login screen.
11. Select the Reset Login Screen option from the Options menu.
Note: After successful completion of Step 11, reset the default password of the user before
moving to the next task.
Overview
To log in using the command line, complete the following steps:
Tasks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
1. Click and hold down the Options button on the Login screen.
2. Select Command Line Login.
The following message appears:
****************************************************************
*Suspending Desktop Login ...
*
*If currently logged out, press [Enter] for a console login
prompt.
a ble
f e r
*
ans
*Desktop Login will resume shortly after you exit console
n - t r
session.
a no
h a s
****************************************************************
*
m ) ideฺ
3.
i l ฺ co t Gu
Press Return to display the following login prompt:
hostname console login:
o t ma den
4. h
Type your username, and press Return.
@ S tu
5.
90 thi s
Type your new password, and press Return.
-
6. z
le use
At the shell prompt, type exit.
l
a -
The hostname console t e to prompt reappears. After a short time, the Login
login:
i s e
(lu cens
screen reappears.
z
élle li
a T
Luis
Overview
To invoke a Failsafe session, complete the following steps:
Tasks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
1. Click and hold down the Options button on the Login screen.
2. Select Session.
The Session menu appears.
3. Select Failsafe Session.
4. Type your username, and press Return.
5. Type your password, and press Return.
A terminal window appears.
a ble
6. Using the mouse, move the cursor into the terminal window.
f e r
7. At the shell prompt, type exit.
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
Tasks
1. What are the two ways in which you can secure your login session?
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
___________________________________________________________
___________________________________________________________
2. To lock the desktop environment screen, complete the following steps:
a. Log in to the desktop using the default desktop environment session.
b. Click Launch > Lock Screen to lock the current desktop environment session.
c. Type your password and press Return to regain access to your desktop environment
session.
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
To change the desktop background, complete the following steps:
Tasks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
To drag and drop a file into a directory in the desktop environment, you must create a directory
and a file.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Tasks
1. Double-click the Documents icon on the Desktop to open the File Browser window.
2. In the File Browser window, click File > Create Folder.
A folder icon with the name, untitled folder, appears in edit mode.
3. Name this folder Folder1.
4. Click File > Create Document > Empty File in the File Browser window.
A file icon with the name new file appears in edit mode.
a ble
f e r
5. Name this file File1.
ans
6. Move your pointer over the File1 icon.
n - t r
7. Click and hold the left mouse button.
a no
h a s
8. Drag the File1 icon over the Folder1 icon, and release the mouse button.
The File1 file is moved into the Folder1 folder.
m ) ideฺ
9. Move your pointer over the Folder1 icon. i l ฺ co t Gu
10. Right-click the Folder1 icon.
o t ma den
A menu appears. @ h S tu
11. Select Move to Trash. - 90 thi s
l z
le use
t e
The Folder1 folder is moved to Trash.
a- e to
i s
(lu cens
Practice Summary
z
Discussion:
é li minutes to discuss what experiences, issues, or discoveries you had
lle Take a few
T
during
a the practices.
u i s • Experiences
L
• Interpretations
• Conclusions
• Applications
a. RAM ___X__________________
b. CPU ___X__________________
c. I/O devices ___X__________________
d. Operating system ______________________
e. Hard disk ___X__________________
f. Software ______________________
2. Name the three main components of the SunOS operating system.
• The kernel
a ble
• The shell f e r
ans
• The directory hierarchy
n - t r
3. Define a virtual memory operating system. Name a virtual memory operating system. o
s an
A virtual memory operating system enables the execution of programs, as if more memory
ha eฺ
were available than physically exists in RAM. SunOS 5.x is a virtual memory operating
)
system.
i l ฺ comt Guid
ma den
4. Distinguish between the SunOS 5.x operating system and the Solaris 10 OS.
o t
The SunOS 5.x operating system consists of the kernel, the shell, and the directory
hierarchy. @ h S tu
- 90 thi s
l z
The Solaris 10 OS consists of the SunOS 5.x operating system, Open Network Computing
le use
t e
(ONC+) software, and the Solaris desktop environment GUI.
a- e to
i s
5. List the three primary shells supported by the Solaris OS.
z (lu cens
• Bourne shell
élle
• C shell
li
a T
Luis • Korn shell
6. Name the default shell for the root (/) user in the Solaris 10 OS.
Bourne shell.
7. Match the following terms with their descriptions:
b Shell a. Core of the Solaris OS
a kernel b. Command interpreter
c Hard disk c. Storage device
a ble
f e r
ans
n - t r
a no
Practices for h a s
Lesson 3: Using
) e ฺ
i l ฺ comt GuidFeatures and
Command-Line
o t ma dHelp
Online e n Resources
@ h Chapter
S tu3
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Practices for Lesson 3: Using Command-Line Features and Online Help Resources
Chapter 3 - Page 1
Practices for Lesson 3: Overview
Practices Overview
In this exercise, you perform the following tasks:
• Construct commands
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Practices for Lesson 3: Using Command-Line Features and Online Help Resources
Chapter 3 - Page 2
Practice 3-1: Constructing Commands
Overview
To identify components of the computer, complete the following steps:
Tasks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
1. To construct commands, arrange the following terms to show the correct syntax of a
command:
options arguments command
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Practices for Lesson 3: Using Command-Line Features and Online Help Resources
Chapter 3 - Page 3
Practice 3-2: Using Command-Line Features
Overview
To use command-line features, complete the following steps:
Tasks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
1. Open a terminal window, if you do not already have one open. Name the two components
of command-line syntax that can enhance the capability of a command.
______________________________________________________________________
2. Enter the command to display information about the operating system and the workstation
name.
_____________________________________________________________
3. Execute the man uname command. List the functions of the -s and -r options to the
uname command. a ble
f e r
_____________________________________________________________
ans
_____________________________________________________________
n - t r
o
a. Enter the uname -s command. What information appears?
s an
ha eฺ
________________________________________________________
)
comt Guid
b. Enter the uname -r command. What information appears?
i l ฺ
________________________________________________________
4. t ma den
Enter the command to display the current time and date on your system.
o
@ h S tu
_____________________________________________________________
- 90 thi s
5. z
Display this month’s calendar. What command did you enter?
l le use
t e
_____________________________________________________________
a- e to
6. i s
What special character is used to separate commands on a single command line?
z (lu cens
____________________________________________________________
7. élle li
Enter the command to clear your terminal window.
a T
Luis _____________________________________________________________
Practices for Lesson 3: Using Command-Line Features and Online Help Resources
Chapter 3 - Page 4
Practice 3-3: Scrolling Through Online man Pages
Overview
To learn how to search for online documentation: In the following table, list the keys or the
functions of the keys used to control scrolling the online man pages.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Keys Function
Displays the next screen of a man page
Return
/pattern
Quits the man command
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Practices for Lesson 3: Using Command-Line Features and Online Help Resources
Chapter 3 - Page 5
Practice 3-4: Using Online Documentation
Overview
To access online documentation, complete the following steps:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Tasks
1. Using the -k option with the man command, find the man page that describes how to clear
a terminal window (use the keyword clear). How do you enter this command on the
command-line?
_____________________________________________________________
2. Clear the terminal window.
3. What Web site enables you to browse Oracle product documentation?
a ble
f e r
_____________________________________________________________
ans
n - t r
a no
Practices Summary
h a s
m d ฺ
Discussion: Take a few minutes to discuss what experiences,)issues, orediscoveries you had
o u i
during the lab exercises.
• Experiences a ilฺc nt G
• Interpretations h otm tude
• Conclusions - 9 0@ this S
• Applications
t e l lez use
i s a- e to
z (lu cens
élle li
a T
Luis
Practices for Lesson 3: Using Command-Line Features and Online Help Resources
Chapter 3 - Page 6
Practice Solutions: Using Command Line Features
o t ma den
The operating system name, for example, SunOS.
@ h S tu
b. Enter the uname -r command. What information appears?
90 thi s
The operating system release level, for example, 5.10.
-
4. z
le use
Enter the command to display the current time and date on your system.
l
$ date t e
a- e to
i s
5.
(lu cens
Display this month’s calendar. What command did you enter?
z
élle
$ cal li
6.
a T
What special character is used to separate commands on a single command line?
Practices for Lesson 3: Using Command-Line Features and Online Help Resources
Chapter 3 - Page 7
Practice 3-3: Scrolling Through Online man Pages
To learn how to search for online documentation, list the keys or the functions of the following
keys in the empty cells in Table 2-4 to control scrolling the online man pages:
Keys Function
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Practices for Lesson 3: Using Command-Line Features and Online Help Resources
Chapter 3 - Page 8
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
f e r
ans
n - t r
a no
Practices for h a s
Lesson 4:
) e ฺ
Viewing
i l ฺ com G uid and Files
Directories
t m a 4 ent
@ ho Stud
Chapter
- 9 0 this
t e l lez use
i s a- e to
z (lu cens
élle li
a T
Luis
Practices Overview
In this practice, you use the commands described in the lesson to list and change directories. All
the directories are situated within your home directory.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
To access files and directories, complete the following steps. Write the commands that you use
to perform each task in the space provided.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Preparation
Ensure that a default printer is configured for your system. You can use the lpstat -d
command to view the default printer information. Ask your instructor for any help required.
RLDC
In addition to being able to use local classroom equipment, this lab was designed to also use
equipment located in a remote lab data center. Directions for accessing and using this resource
can be found at:
a ble
http://remotelabs.sun.com/
f e r
Ask your instructor for the particular SSH configuration file that you should use to access the ans
appropriate remote equipment for this practice. n - t r
a no
h a s
Tasks
m ) ideฺ
1. Display your current working directory.
i l ฺ co t Gu
o t ma den
_____________________________________________________________
2. Change to your home directory.
@ h S tu
- 90 thi s
_____________________________________________________________
3. Display the contents of lyour
z
le current e
sworking directory.
- t e o u
l u i sa se t
_____________________________________________________________
____________________________________________________________
15. Return to your home directory.
____________________________________________________________
16. Display a long list of the contents of the current working directory.
____________________________________________________________
17. Display the contents of the fruit file by using the cat command.
____________________________________________________________
18. Under what circumstances must you refrain from using the cat command to view the a ble
contents of a file? f e r
ans
____________________________________________________________
n - t r
19. Display the contents of the fruit file and the fruit2 file by using a single command. o
s
_____________________________________________________________an
) ha eฺ
20. Display on the screen the first five lines of the /usr/dict/words file.
ฺ comt Guid
_____________________________________________________________
i l
o t ma den
21. Display on the screen the last eight lines of the /usr/dict/words file.
h tu
_____________________________________________________________
@ S
- 90 thi s
22. Distinguish between the head and tail commands.
l z
le use
_____________________________________________________________
t e
a- e to
s
_____________________________________________________________
i
(lu cens
23. Determine the total number of lines contained in the /usr/dict/words file.
z
élle li
_____________________________________________________________
a T
Luis24. Print the dante_1 file to the default printer.
_____________________________________________________________
25. What action occurs when you enter the lp -m command for the default printer?
_____________________________________________________________
26. What does the ~ symbol represent?
_____________________________________________________________
Practice Summary
Discussion: Take a few minutes to discuss what experiences, issues, or discoveries you had
during the practices.
• Experiences
• Interpretations
• Conclusions
• Applications
/etc
15. Return to your home directory.
$ cd;pwd
16. Display a long list of the contents of the current working directory.
$ ls -l
17. Display the contents of the fruit file by using the cat command.
$ cat fruit
18. Under what circumstances must you refrain from using the cat command to view the
a ble
contents of a file? f e r
Do not use the cat command to view binary files. ans
n - t r
no
19. Display the contents of the fruit file and the fruit2 file by using a single command.
a
$ cat fruit fruit2
h a s
20. Display on the screen the first five lines of the /usr/dict/words
m ) idfile.
e ฺ
$ head -5 /usr/dict/words
i l ฺ co t Gu
21. Display on the screen the last eight lines of m thea/usr/dict/words
e n file.
o t d
$ tail -8 /usr/dict/wordsh
@ S tu
22. Distinguish between the head - 9and s
0 tailthcommands.
i
The head command displays
z
lle theufirst e
s 10 lines of a file, whereas the tail command
- t e t o
l sa number
displays the last 10
uitotal
lines
s
of
e a file.
23. Determine(the
z c e n of lines contained in the /usr/dict/words file.
é li
ll$ewc -l /usr/dict/words
T
a Print the dante_1 file to the default printer.
24.
u i s
L $ lp dante_1
25. What action occurs when you enter the lp -m command for the default printer?
The lp -m command sends a mail message to you after the print job is complete.
26. What does the ~ symbol represent?
The ~ symbol represents the user’s home directory.
a ble
f e r
ans
n - t r
a no
Practices for h a s
Lesson 5:
) e ฺ
Working
i l ฺ comwith
G
id and
uFiles
t m a ent
Directories
@ S tu5 d
hoChapter
- 9 0 this
t e l lez use
i s a- e to
z (lu cens
élle li
a T
Luis
Practices Overview
In this practice, you use the commands described in the lesson to copy, move, rename, create,
and remove files and directories.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
To use directory and file commands, complete the following steps. Write the commands that you
would use to perform each task in the space provided.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Preparation
No special preparation is required for this practice.
RLDC
In addition to being able to use local classroom equipment, this practice was designed to also
use equipment located in a remote lab data center. Directions for accessing and using this
resource can be found at:
http://remotelabs.sun.com/
a ble
Ask your instructor for the particular SSH configuration file that you should use to access the f e r
appropriate remote equipment for this practice.
ans
n - t r
a no
Tasks
h a s
1. Return to your home directory (if you need to), and list the )contents. eฺ
l ฺ comt Guid
_____________________________________________________________
i
2. Copy the dir1/coffees/beans/beanstfile
o mainto thededir4
n directory, and call it roses.
h S tu
_____________________________________________________________
@
3. Create a directory called vegetables- i s
90 inthdir3.
z
lle us e
a - e
_____________________________________________________________
t to
l u i s
4. Move the dir1/coffees/beans/beans
s e file into the dir2/recipes directory.
z ( ce n
_____________________________________________________________
5. T é l l
Complete
e l i
the missing option and description in the following table:
a
Luis
Option Description
CP -i
Includes the contents of a directory,
including the contents of all
subdirectories, when you copy a
directory
6. From your home directory, create a directory called practice1.
_____________________________________________________________
7. Using a single command, copy the file.1 and file.2 files to the practice1 directory.
_____________________________________________________________
8. Copy dir3/planets/mars file to the practice1 directory, and name the file
addresses.
_____________________________________________________________
• Conclusions
• Applications
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Tasks
To use directory and file commands, complete the following steps:
1. Return to your home directory (if you need to), and list the contents.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
$ cd; ls
2. Copy the dir1/coffees/beans/beans file into the dir4 directory, and call it roses.
$ cp dir1/coffees/beans/beans dir4/roses
3. Create a directory called vegetables in dir3.
$ mkdir dir3/vegetables
4. Move the dir1/coffees/beans/beans file into the dir2/recipes directory.
$ mv dir1/coffees/beans/beans dir2/recipes
5. Complete the missing option and description in the following table:
a ble
f e r
ans
Option Description
n - t r
CP -i Prevents you from accidentally a no
a s
overwriting existing files or directories
h
-r Includes the contentso ofm
) ideฺ
a directory,
i l ฺ
including the contents c of allt Gu
t mawhendyou
subdirectories,
o e ncopy a
h
directory
@ S tu
6. From your home directory, create- 90a directory
t s
hi called practice1.
z
lle us e
$ mkdir practice1
a - t e tothe file.1 and file.2 files to the practice1 directory.
s
7. Using a singleicommand, ecopy
$ z lu efile.2
cp (file.1
c ns practice1
8. Copy
li
élledir3/planets/mars file to the practice1 directory, and name the file
a T
uis
addresses.
L $ cp dir3/planets/mars practice1/addresses
9. Create a directory called play in your practice1 directory, and move the
practice1/addresses file to the play directory.
$ mkdir practice1/play
$ mv practice1/addresses practice1/play
10. Using a single command, copy the play directory in the practice1 directory to a new
directory in the practice1 directory called appointments.
$ cp -r practice1/play practice1/appointments
11. Recursively list the contents of the practice1 directory.
$ ls -R practice1
12. In your home directory, create a directory called house with a subdirectory of furniture
using a single command.
$ cd; mkdir -p house/furniture
$ touch carrot
$ mv carrot celery
16. Using a single command, remove the directories called memos and misc from your home
directory.
$ rmdir memos misc
or
$ rm -r memos misc
a ble
17. Try to remove the directory called house/furniture with the rm (no options) command.
f e r
What happens?
ans
$ rm house/furniture n - t r
o
rm: house/furniture is a directory
s an
ha eฺ
18. Identify the command to remove a directory that is not empty. Remove the
)
comt Guid
house/furniture directory. List the contents of the house directory to verify that the
furniture directory has been removed. i l ฺ
$ rm -r house/furniture
o t ma den
$ ls house @ h S tu
- 90 thi s
$
l z
le use
t e
19. Create a new directory named newname, and then rename it veggies.
a- e to
i s
(lu cens
$ mkdir newname
z li
$ mv newname veggies
élle
20. Create a file named mycontents that is a symbolic link to the file
T
a
Luis /var/sadm/install/contents.
$ ln -s /var/sadm/install/contents mycontents
21. Verify that the symbolic link works.
$ more mycontents
22. Type q to quit the mycontents file view.
23. Remove the symbolic link that you created in Step 20.
$ rm mycontents
$ ls mycontents
mycontents: No such file or directory
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
a ble
f e r
ans
n - t r
a no
Practices for h a s
Lesson 6: Using
) e ฺ
om Guid
the vilฺcEditor
i
a 6 ent
t m
@ ho Stud
Chapter
- 9 0 this
t e l lez use
i s a- e to
z (lu cens
élle li
a T
Luis
Practices Overview
In this practice, you perform vi editor commands in the tutor.vi tutorial.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
To learn how to use the vi editor, complete the following steps.
Preparation
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
RLDC
In addition to being able to use local classroom equipment, this practice was designed to also
use equipment located in a remote lab data center. Directions for accessing and using this
resource can be found at:
http://remotelabs.sun.com/
Ask your instructor for the particular SSH configuration file that you should use to access the a ble
appropriate remote equipment for this practice. f e r
ans
n - t r
Tasks a no
1. Make sure that you are in your home directory. To open the h a s tutorial file,
) tutor.vi
e ฺ
comt Guid
enter the following command:
$ vi tutor.vi i l ฺ
2. Complete the lessons outlined in this tutorial.
o t ma den
@ h S tu
- 90 thi s
Practice Summary l z
le use
Discussion: Take asfew
t e
a- minutes ttoo discuss what experiences, issues, or discoveries you had
i
(lu cens
during the practice
e
e z
• llExperiences li
T é
i s a • Interpretations
Lu • Conclusions
• Applications
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
a ble
f e r
ans
n - t r
a no
Practices for h a s
Lesson 7: Using
) e ฺ
Commands
i l ฺ comt G uid the Shell
Within
o t ma 7 den
Chapter
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Practices Overview
In this practice, you will answer questions on the material presented in this module.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
Complete the following steps. Write your answer in the space provided.
Preparation
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
RLDC
In addition to being able to use local classroom equipment, this practice was designed to also
use equipment located in a remote lab data center. Directions for accessing and using this
resource can be found at:
http://remotelabs.sun.com/
Ask your instructor for the particular SSH configuration file that you should use to access the
a ble
appropriate remote equipment for this practice. f e r
ans
n - t r
Tasks
a no
a
1. Which specific shell characters have special meaning to the shell?
h s
m ) ideฺ
_____________________________________________________________
2. Name some common shell metacharacters. i l ฺ co t Gu
t ma den
_____________________________________________________________
o u directory of a user?
h for theSthome
@
3. Which metacharacter is a shell substitute
90 thi s
z -
_____________________________________________________________
4. Navigate to your homet e l le ufrom
directory seyour current working directory by using the
i s a-metacharacter.
appropriate special e to
5. Which twoz lu ens are often referred to as wildcard characters?
(metacharacters
é l le lic
_____________________________________________________________
a TMake sure that you are in your home directory. List the contents of all the files and
s6.
ui directories in your home directory starting with d, using a wildcard entry.
L
_____________________________________________________________
7. Which character do you use to match a single character, excluding a leading period?
_____________________________________________________________
8. Which character or characters would you use to match a set or range of characters?
_____________________________________________________________
9. Which character or characters would you use to have the shell ignore the special meaning
of metacharacters?
_____________________________________________________________
10. What are file descriptors?
_____________________________________________________________
_____________________________________________________________
11. Which symbol or symbols do you use to redirect output and append the output to a file?
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________
15. Which command do you use to display shell variables and their current values?
_____________________________________________________________
16. Which command do you use to display a list of previously executed commands in the shell?
_____________________________________________________________
17. What is an initialization file?
a ble
_____________________________________________________________
f e r
_____________________________________________________________ ans
18. List the four user initialization files described in this module. n - t r
_____________________________________________________________ a no
h a
_____________________________________________________________
s
m ) ideฺ
i l ฺ co t Gu
_____________________________________________________________
@ h S tu
- 90 thi s
20. Edit your ~/.kshrc file to set the prompt to be hostname and the current directory.
z
le use
21. Log out and log in again to check that your settings work.
l
t e
a- e to
Practice Summary i s
Discussion: z (lu a few
Take
c e ns to discuss what experiences, issues, or discoveries you had
minutes
llepractice. li
duringéthe
T
a • Experiences
Luis • Interpretations
• Conclusions
• Applications
Tasks
1. Which specific shell characters have special meaning to the shell?
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Metacharacters
2. Name some common shell metacharacters.
Metacharacters include the following: ~, -, +, *, ?, and [].
3. Which metacharacter is a shell substitute for the home directory of a user?
The ~ character
4. Navigate to your home directory from your current working directory by using the
appropriate special metacharacter.
$ cd
a ble
$ pwd f e r
ans
$ /export/home/student
n - t r
5. Which two metacharacters are often referred to as wildcard characters? o
The * and ? characters
s an
ha eฺ
6. Make sure that you are in your home directory. List the contents of all the directories in your
)
i l ฺ comt Guid
home directory starting with d, using a wildcard entry.
ma den
$ pwd
o t
/export/home/student
@ h S tu
$ ls d*
- 90 thi s
dante dante_1
l z
le use
dir1: t e
a- e to
i s
(lu cens
coffees fruit trees
z
élle
dir2: li
a T beans notes recipes
Luis dir3:
planets vegetables
dir4:
roses
dir5:
7. Which character do you use to match a single character, excluding a leading period?
The ? character
8. Which character or characters would you use to match a set or range of characters?
The [] character
9. Which character or characters would you use to have the shell ignore the special meaning
of metacharacters?
The \, ‘, and “ characters
10. What are file descriptors?
File descriptors determine where the input to the command originates and where the output
or error messages are sent.
The | character
14. Define a variable. Name the kinds of variables used in Korn shell programming.
A variable refers to a temporary storage area in memory.
Korn shell programming uses two types of variables:
• Variables that are exported to subprocesses
• Variables that are not exported to subprocesses
15. Which command do you use to display shell variables and their current values?
a ble
The set command f e r
ans
16. Which command do you use to display a list of previously executed commands in the shell?
n - t r
The history command o
17. What is an initialization file? s an
) ha eฺ
An initialization file is the file that you use to control the features of your desktop
environment.
i l ฺ comt Guid
o t ma den
18. List the four user initialization files described in this module.
The user initialization files are:
@ h S tu
~/.profile
- 90 thi s
~/.kshrc
l z
le use
~/.cshrc t e
a- e to
i s
(lu cens
~/.dtprofile
z
élle li
19. Edit your ~/.profile file to set the ENV variable to $HOME/.kshrc. Also add /etc to
a T
your path.
a ble
f e r
ans
n - t r
a no
Practices for h a s
Lesson 8: Using
) e ฺ
Basic l ฺ om Permissions
cFile G uid
i
a 8 ent
t m
@ ho Stud
Chapter
- 9 0 this
t e l lez use
i s a- e to
z (lu cens
élle li
a T
Luis
Practices Overview
In this practice, you read permissions on files and use the symbolic mode and the octal mode to
change permissions.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
To view permissions on files and change permissions, complete the following steps:
Preparation
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Ensure that the umask value is set to 022 on your system. If not, set the umask value to 022 by
running the following command:
$ umask 022
RLDC
In addition to being able to use local classroom equipment, this practice was designed to also
use equipment located in a remote lab data center. Directions for accessing and using this
resource can be found at:
a ble
http://remotelabs.sun.com/ f e r
Ask your instructor for the particular SSH configuration file that you should use to access the ans
appropriate remote equipment for this practice. n - t r
a no
h a s
Tasks
m ) ideฺ
1. Perform the following commands in your home directory:i l ฺ co t Gu
$ mkdir perm
o t ma den
$ cd /etc
@ h S tu
$ ls -l group motd-9 0 tvfstabhi s
z shadow
e
lleshadowusvfstab ~/perm
$ cp group motd
- t e
a shadow tofile, the error message cp: cannot open shadow:
When trying to copy
i sthe e
lu eappears.
Permission (denied
z c ns Why?
lle li
_____________________________________________________________
é
T
a _____________________________________________________________
Luis $ ls -l ~/perm
$ cd
$ cp -r /etc/skel perm
2. Change to the perm directory, and list the contents of the directory.
$ cd perm
$ ls -l
group
motd
skel
vfstab
Overview
To view permissions on files and change permissions, complete the following steps:
Tasks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
In the following table, fill in the permission sets for each file and write the three digit octal
number that represents the combined set of permissions.
File or Permissions Octal Value
Directory
Owner Group Other
group rw- r-- r-- 644
motd rw- r-- r-- 644
skel rw- r-x r-x 755
vfstab rw- r-- r-- 644
4. Describe the difference between the symbolic mode and the octal mode.
The symbolic mode uses combinations of letters and symbols to add or remove
permissions for each type of user.
The octal mode uses octal numbers to represent each permission. The octal mode is also
referred to as the absolute mode.
5. Using the symbolic mode, add write permission for the group to the motd file.
$ chmod g+w motd
$ ls -l
a ble
6. Using the octal mode, change the permissions on the motd file to -rwxrw----.
f e r
$ chmod 760 motd
ans
$ ls -l n - t r
7. a no
Using the octal mode, add write permission for other on the file named group.
h a s
$ chmod 646 group
m ) ideฺ
$ ls –ldi
i l ฺ co t Gu
ma den
8. Identify the GID and UID for the motd file. Which command did you use?
o t
$ ls -n motd
@ h S tu
90 thi
-rwxrw---- 1 11001 10 49 Nov 19 15:16 motd
- s
9. z
le use
Create a new file called memo in your dir4 directory.
l
a - t
$ touch ~/dir4/memoe to
i s e
10. Remove thelu
z (symbolic
c e ns or theforoctal
read permission the owner from the memo file in the dir4 directory. Use
eitherethe
é l li ~/dir4/memo mode.
l$ chmod u-r mode
a T
ui s or
L $ chmod 244 ~/dir4/memo
a. What happens when you try to use the cat command to view the memo file?
You cannot use the cat command, because read permission has been removed for the
user. Even though you are part of the group, the permissions are viewed in the order in
which they appear. The following message appears:
cat: cannot open /export/home/student/dir4/memo
b. What happens when you try to copy the memo file?
You cannot copy the file, because the user has no read permission. The following message
appears:
cp: cannot open /export/home/student/dir4/memo: Permission
denied
$
12. Change the umask to 027. Which command did you run?
$ umask 027
13. Create a new file and a new directory. Record the access permissions. Which command did
you run?
$ touch testfile
$ mkdir testdir
a ble
$ ls -l testfile
f e r
-rw-r-----
ans
$ ls -ld testdir
n - t r
o
an
drwxr-x---
14. Change the umask back to 022. s
ha eฺ
)
comt Guid
$ umask 022
15. Create a new file and a new directory.
i l ฺ
$ touch test2file
o t ma den
$ mkdir test2dir
@ h S tu
-
16. Record the access permissions.90 thi s
l z
le use
t e
$ ls -l test2file
a- e to
i
-rw-r--r--s
z (lu cens
$ ls -ld test2dir
élle
drwxr-xr-xli
a T
Luis
a ble
f e r
ans
n - t r
a no
Practices for h a s
Lesson 9:
) e ฺ
Configuring
i l ฺ comt GAccess
uid Control
o t ma (ACLs)
Lists d e n
@ h Chapter
S tu9
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Practices Overview
In this practice, you create three files and modify the ACLs associated with them.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
Complete the following steps.
Preparation
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
A user called acluser with a password of acluser1 and a group called aclgroup is required
for this practice. This user and group were created for you.
RLDC
In addition to being able to use local classroom equipment, this practice was designed to also
use equipment located in a remote lab data center. Directions for accessing and using this
resource can be found at:
http://remotelabs.sun.com/
a ble
Ask your instructor for the particular SSH configuration file that you should use to access the f e r
appropriate remote equipment for this practice. ans
n - t r
a no
Tasks
h a s
1. Log in and open a terminal window. m ) ideฺ
i l ฺ co t Gu
_____________________________________________________________
2. Create the directory named $HOME/acl_test,
o t maanddchange
e n directories to that location.
@ h S tu
_____________________________________________________________
3. Use the echo command toz - 90 file1,
create t s
i add the text string Success for life to
hand
the file. e lle us e
a - t to
i s
_____________________________________________________________
e
u forethensfile named file1.
4. Displayzthe(lACL
é l le lic
_____________________________________________________________
a TDo the permissions in the ACL match the permissions indicated by the ls command?
ui s
L _____________________________________________________________
5. Change permissions on the file named file1 so that only the owner and group have read
access.
_____________________________________________________________
6. Change your user identity to acluser.
_____________________________________________________________
7. Display the contents of the file1 file. What is the output?
_____________________________________________________________
8. Exit your su session.
_____________________________________________________________
9. Use the setfacl command to add an ACL entry that allows read access for acluser to
the ACL for the file1 file.
_____________________________________________________________
10. Verify that the new ACL entry exists.
_____________________________________________________________
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
What indicates that an additional ACL entry exists for the file1 file?
_____________________________________________________________
13. Change to the acl_test directory and attempt to display the contents of the file1 file.
_____________________________________________________________
What is the result?
_____________________________________________________________
14. Exit your su session.
_____________________________________________________________
a ble
f e r
15. Create and display the ACL for the file2 file.
ans
_____________________________________________________________
n - t r
o
an
Do the group permissions match the permissions associated with the mask entry?
s
_____________________________________________________________
ha eฺ
)
16. Change the permission mode to grant read, write, and execute permissions to the group
that owns the file2 file.
i l ฺ comt Guid
o t ma den
_____________________________________________________________
h tu
17. Display the ACL and a long listing for the file2 file.
@ S
90 thi s
_____________________________________________________________
-
l z
le use
Do the mask permissions match the group permissions?
t e
a- e to
_____________________________________________________________
i s
(lu cens
18. Set the mask permissions for the file named file2 to read-only.
z
élle li
_____________________________________________________________
a T
uis
19. Display the ACL and a long listing for file2.
L _____________________________________________________________
Do the mask permissions match the group permissions?
_____________________________________________________________
In the long listing output, do you find an indication that file2 has additional ACL entries?
_____________________________________________________________
20. Add an ACL entry for the group named aclgroup to the file2 file. Grant only read and
write permissions for this group.
_____________________________________________________________
21. Change your user identity to acluser, thereby inheriting the users environment.
_____________________________________________________________
22. Use the echo command to insert the text string Success for life into the file2 file.
_____________________________________________________________
What is the output?
_____________________________________________________________
23. Exit your su session.
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
26. Change your user identity to acluser, inheriting the users environment.
_____________________________________________________________
27. Use the echo command to insert the text string Success for life in the file3 file.
_____________________________________________________________
28. Display the contents of the file3 file.
_____________________________________________________________
29. Exit your su session.
_____________________________________________________________ a ble
f e r
Practice Summary ans
n - t r
Discussion: Take a few minutes to discuss what experiences, issues, or discoveries you had o
during the practice.
s an
• Experiences
) ha eฺ
• Interpretations
i l ฺ comt Guid
• Conclusions
o t ma den
• Applications
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
Complete the following steps:
1. Log in and open a terminal window.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
2. Create the directory named $HOME/acl_test, and change directories to that location.
$ mkdir $HOME/acl_test
$ cd $HOME/acl_test
3. Use the echo command to create the file1 file, and add the text string Success for
life to the file.
$ echo “Success for Life” > file1
$ ls -l
-rw-r--r-- 1 student class 17 Feb 9 09:40 file1
a ble
4. Display the ACL for the file1 file. f e r
ans
$ getfacl file1
n - t r
Do the permissions in the ACL match the permissions indicated by the ls command? o
Yes, they should. s an
) ha eฺ
5. Change permissions on the file1 file so that only the owner and the group have read
access.
i l ฺ comt Guid
$ chmod 440 file1
o t ma den
$ ls -l
@ h S tu
90 thi s
-r--r----- 1 student class 17 Sep 25 13:06 file1
-
$ getfacl file1
l z
le use
t e
a- e to
6. Change your user identity to acluser.
i s
(lu cens
$ su - acluser
z
élle li
passwd:acluser1
T
7. Display the contents of the file1 file. What is the output?
a
Luis $ cat ~student/acl_test/file1
The following error message is displayed:
cat: cannot open /export/home/student/acl_test/file1
8. Exit your su session.
$ exit
9. Use the setfacl command to add an ACL entry that allows read access for acluser to
the ACL for the file1 file.
$ setfacl -m user:acluser:4 file1
10. Verify that the new ACL entry exists.
$ getfacl file1
11. Change your user identity back to acluser.
$ su - acluser
passwd:acluser1
12. Use the ls command to display the permissions applied to the file1 file.
$ ls -l ~student/acl_test/file1
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
$ cd ~student/acl_test
$ cat file1
What is the result?
The file content appears.
14. Exit your su session.
$ exit
$
15. Create and display the ACL for the file2 file. a ble
f e r
$ touch file2
ans
$ getfacl file2
n - t r
o
an
Do the group permissions match the permissions associated with the mask entry?
Yes. s
ha eฺ
16. )
Change the permission mode to grant read, write, and execute permissions to the group
that owns the file2 file.
i l ฺ comt Guid
$ chmod g=rwx file2
o t ma den
17. h tu
Display the ACL and a long listing for the file2 file.
@ S
$ getfacl file2
- 90 thi s
$ ls -l file2 l z
le use
t e
a- e to
Do the mask permissions match the group permissions?
i s
Yes.
z (lu cens
18. élle li
Set the mask permissions for the file2 file to read-only.
a T
uis
$ setfacl -m mask:r-- file2
L 19. Display the ACL and a long listing for the file2 file.
$ getfacl file2
$ ls -l file2
Do the mask permissions match the group permissions?
Yes.
In the long listing output, do you find an indication that the file2 file has additional ACL
entries?
No.
20. Add an ACL entry for the group named aclgroup to the file2 file. Grant only read and
write permissions for this group.
$ setfacl -m group:aclgroup:6 file2
21. Change your user identity to acluser, thereby inheriting the users environment.
$ su - acluser
password: acluser1
$ exit
24. Display the ACL for the file2 file.
$ getfacl file2
25. Create a file called file3 and add an ACL entry to the file that recalculates the mask
allowing a user from the aclgroup group to insert a line of text to the file.
$ touch file3
$ setfacl -r -m g:aclgroup:6 file3
26. Change your user identity to acluser, inheriting the users environment.
a ble
f e r
$ su - acluser
ans
password: acluser1
n - t r
27. Use the echo command to insert into the text string Success for life in the file3 file. o
$ echo “Success for Life” > ~student/acl_test/file3s an
28. Display the contents of the file3 file. ) ha eฺ
$ cat ~student/acl_test/file3
i l ฺ comt Guid
29. Exit your su session.
o t ma den
$ exit
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
a ble
f e r
ans
n - t r
a no
Practices for h a s
Lesson 10:
) e ฺ
Searching
i l ฺ comtFiles
G uidand
o t ma den
Directories
@ h Chapter
S tu10
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Practices Overview
In this practice, you search for files and directories by using the find command. You also
display and manipulate text in files.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
You practice searching for files and directories by using the find command. You also display
and manipulate text in files.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Preparation
No special preparation is required for this practice.
RLDC
In addition to being able to use local classroom equipment, this practice was designed to also
use equipment located in a remote lab data center. Directions for accessing and using this
resource can be found at:
http://remotelabs.sun.com/
a ble
Ask your instructor for the particular SSH configuration file that you should use to access the f e r
appropriate remote equipment for this practice. ans
n - t r
a no
Tasks
h a s
1. How do the grep, egrep, and fgrep commands differ? m ) ideฺ
i
_____________________________________________________________l ฺ co t Gu
t ma den
_____________________________________________________________
o
h S tu
_____________________________________________________________
@
2. Search for the text string other - t s
90in the /etc/group
hi file. Display it to the screen.
l e z e
a - tel to us
_____________________________________________________________
3. Using the grep
( l u iscommand,n s e look for all lines in the file4 file located in your home directory
that do z not contain e the letter M.
l l e l i c
é
_____________________________________________________________
T
a
Luis4. Display all lines in the files dante, file1, and dante_1 that contain the pattern he.
_____________________________________________________________
5. Display all the lines in the file file4 that contain either the pattern Sales or the pattern
Finance.
_____________________________________________________________
6. Which option is peculiar to the grep command but does not apply to the egrep and fgrep
commands?
_____________________________________________________________
7. Display all the lines that have the pattern load in the /etc/system file.
_____________________________________________________________
8. Use the grep command to display how many lines contain at least one instance of the
word module (uppercase and lowercase) in the /etc/system file.
_____________________________________________________________
9. Use the grep command to record how many instances of the word Module (uppercase M
only) appear in the /etc/system file.
_____________________________________________________________
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
_____________________________________________________________
13. In your home directory, find all files of type d for directory.
_____________________________________________________________
14. From your home directory, use the find command with an option that prompts you before
removing any files, to search for ordinary files of size 0 (zero) in the /tmp directory.
_____________________________________________________________
Note: Make sure that you answer No when prompted to remove any files.
a ble
Practice Summary f e r
Discussion: Take a few minutes to discuss what experiences, issues, or discoveries you had ans
during the practice. n - t r
o
• Experiences
s an
• Interpretations
) ha eฺ
• Conclusions
i l ฺ comt Guid
• Applications
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
To locate files and text, complete the following steps:
Tasks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
a ble
f e r
ans
n - t r
a no
Practices for h a s
Lesson 11:
) e ฺ
Performing
i l ฺ comt G uid Process
Basic
o t ma den
Control
@ h Chapter
S tu11
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Practices Overview
In this practice, you use the commands described in this module to determine PIDs, view a
process tree, and kill processes.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
This practice introduces the tty command, which displays the name of the current terminal
window. The name displayed by the tty command includes a unique identification number
assigned by the Solaris OS to each open terminal window (for example, /dev/pts/2). In the
tasks illustrating the tty command, the unique identification number is displayed as
/dev/pts/n, where n is a numeral
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
Complete the following steps.
Preparation
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
RLDC
In addition to being able to use local classroom equipment, this practice was designed to also
use equipment located in a remote lab data center. Directions for accessing and using this
resource can be found at:
http://remotelabs.sun.com/
Ask your instructor for the particular SSH configuration file that you should use to access the
a ble
appropriate remote equipment for this practice. f e r
ans
n - t r
Tasks
a no
Perform the following:
h a s
m ) running
1. Use the following ps commands to list the processes currently d e ฺon your system.
What information does each command provide? ilฺc
o Gu i
t m a ent
ho Stud
$ ps
_____________________________________________________________
9 @
0 this
-
lez use
$ ps -f
e l
_____________________________________________________________
- t
$ ps -e isa e to
(lu cens
_____________________________________________________________
z
T éll$eps -ef li
a
Luis _____________________________________________________________
2. Perform the ps -ef command in a terminal window. Identify the process ID related to the
ps -ef command.
$ ps -ef
PID: _____________________________________
3. Open another terminal window, referred to as terminal window 1, and enter the following
command:
$ gcalctool
Note: This command launches the calculator, which is terminated by using the kill
command from another terminal window in a subsequent task.
4. Open another terminal window, called terminal window 2. Use the ps or pgrep command
to identify the PID of the gcalctool command.
PID: _____________________________________
5. In terminal window 2, terminate the gcalctool command by using the PID.
_____________________________________________________________
$ pgrep -t pts/n
PID: _____________________________________
8. In terminal window 1, use the kill command to terminate the terminal window 2.
$ kill PID
Did it work? ______________________________________
9. Use the kill command with the -9 option to terminate terminal window 2.
$ kill -9 PID
a ble
Did it work? ______________________________________ f e r
ans
10. Name the commands used to search for a specific process.
n - t r
_____________________________________________________________
_____________________________________________________________ a no
h a s
) ideฺ
11. Run the following kill commands to identify the signal names associated with signal
m
numbers.
i l ฺ co t Gu
ma den
$ kill -l 9 (-l is the letter l)
o t
Signal: ___________________________________________
@ h S tu
$ kill -l 15 (-l is the
- 90 thi
letter l) s
z
le use
Signal: __________________________________________
l
t e
a- between
12. What is the difference to a process and a job?
i s e
(lu cens
_____________________________________________________________
z
lle li
_____________________________________________________________
é
T
13. What is the difference between the pkill command and the kill command?
a _____________________________________________________________
u i s
L _____________________________________________________________
14. In a terminal window type the command sleep 500 &.
15. In the same terminal window use the ps command to identify the shell process running in
that window.
_____________________________________________________________
16. In another terminal window use the ptree command using the shell PID from Step 14 as
the argument.
_____________________________________________________________
17. In this terminal window use the kill command with the PID as the argument that was
used in Step 15. Does the window close?
_____________________________________________________________
• Conclusions
• Applications
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
Perform the following steps:
Tasks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
éll$eps the
to identify li of the gcalctool command.
PID
a T -ef | grep gcalctool
u i s or
L $ pgrep gcalctool
5. In terminal window 2, terminate the gcalctool command by using the PID.
$ kill PID
The value PID is the PID of the gcalctool command.
6. In terminal window 2, enter the tty command to identify the name of this terminal window.
The name appears as /dev/pts/n, where n is a numeral (for example, /dev/pts/4).
$ tty
This name differs from system to system.
7. Move back to terminal window 1. Use the pgrep command to find the PID associated with
the name of terminal window 2.
$ pgrep -t pts/n
The PID differs from system to system.
$ kill -9 PID
Did it work?
Yes.
10. Name the commands used to search for a specific process.
The pgrep command and the ps command with the grep command.
11. Run the following kill commands to identify the signal names associated with signal
numbers.
$ kill -l 9
a ble
The signal name is KILL. f e r
ans
$ kill -l 15
n - t r
The signal name is TERM.
a no
12. What is the difference between a process and a job?
h a s
Every program that runs on the Solaris 10 OS creates a process.
m e ฺ that a shell can
) iAdprocess
manage is called a job.
i l ฺ co t Gu
13. What is the difference between the pkill command
t m a and e nthe kill command?
You can terminate a job using the kill o
h command. d
tuYou can terminate a specific process
@ s S
using the pkill command.
z - 90 thsleep
i
14. In a terminal window type
e l le us
the e
command 500 &.
$ sleep 500 t
a- & e to
i s
(lu cens
[1] 15866
z
é ll$e li
15. T
a Inthatthewindow.
same terminal window use the ps command to identify the shell process running in
u i s
L $ ps
PID TTY TIME CMD
3989 pts/3 0:00 ksh
4029 pts/3 0:00 ps
4028 pts/3 0:00 sleep
16. In another terminal window use the ptree command using the shell PID from Step 14 as
the argument.
$ ptree 3989
3985 gnome-terminal
3989 ksh
4028 sleep 500
17. In this terminal window use the kill command with the PID as the argument that was
used in Step 15. Does the window close?
$ kill -9 3989
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
a ble
f e r
ans
n - t r
a no
Practices for h a s
Lesson 12:
) e ฺ
Advanced
i l ฺ comtShell
G uidFunctionality
o t ma 12den
Chapter
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Practices Overview
In this practice, you use the commands described in this module to control jobs.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
Complete the following steps. Write the commands that you would use to perform each task in
the space provided.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Preparation
No special preparation is required for this practice.
RLDC
In addition to being able to use local classroom equipment, this practice was designed to also
use equipment located in a remote lab data center. Directions for accessing and using this
resource can be found at:
http://remotelabs.sun.com/
a ble
Ask your instructor for the particular SSH configuration file that you should use to access the f e r
appropriate remote equipment for this practice.
ans
n - t r
a no
Tasks
h a s
Perform the following:
m ) ideฺ
1. Run the following command in the background: ilฺco G u
ma den t
$ sleep 500 &
o t
h S tu
_____________________________________________________________
@
2. Find the job number of the sleep - 90 command
t s
hi in Step 1.
z
lle us e
a - e
Job number:__________________________________________________
t to
i s e
_____________________________________________________________
3. Bring the z job ns
(luto theceforeground, and then put it back in the background.
é l l e l i
_____________________________________________________________
a T
Luis4. What are job control commands? Name any two commands that are used for job control
and mention the functions of each of them.
_____________________________________________________________
_____________________________________________________________
5. Terminate the job by running the sleep command.
_____________________________________________________________
6. Enable the noclobber option, and use the set command to verify that you enabled it.
_____________________________________________________________
7. Display all predefined aliases.
_____________________________________________________________
8. Create an alias named cls that clears the terminal screen.
_____________________________________________________________
9. Create an alias named dir that displays a long listing of all the files and directories in the
current directory.
_____________________________________________________________
_____________________________________________________________
13. Create a function called data that:
• Clears the terminal screen
• Displays the date and time
• Displays who is logged in to your system
• Displays the path of the current working directory
• Lists the current working directory in long format
_____________________________________________________________ a ble
f e r
14. Use vi to edit the .kshrc file in your home directory.
ans
$ vi ~/.kshrc
n - t r
Add the following line entries:
a no
set -o vi
h a s
alias h=’history’
m ) ideฺ
alias cls=’clear’ i l ฺ co t Gu
alias lf=’pwd ; ls -lF’
o t ma den
15. Enter the following commands:
@ h S tu
- 90 thi s
$ . ~/.profile
l z
le use
$ . ~/.kshrc
t e
a- e to
i s
16. Test your new aliases and functions.
z (lu cens
Practice
T é lleSummaryli
i s a the practice.
Discussion: Take a few minutes to discuss what experiences, issues, or discoveries you had
Lu during
• Experiences
• Interpretations
• Conclusions
• Applications
Overview
Complete the following steps.
Tasks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
f e r
ans
n - t r
a no
Practices for h a s
Lesson 13:
) e ฺ
Reading
i l ฺ comShell
G
id
uScripts
t m a 13 ent
@ ho Stud
Chapter
- 9 0 this
t e l lez use
i s a- e to
z (lu cens
élle li
a T
Luis
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
a ble
f e r
ans
n - t r
a no
Practices for h a s
Lesson 14:
) e ฺ
Creating
i l ฺ comArchives
G uid
t m a 14 ent
@ ho Stud
Chapter
- 9 0 this
t e l lez use
i s a- e to
z (lu cens
élle li
a T
Luis
Practices Overview
In this practice, you archive, view, and retrieve files on a tape or a flash drive.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
To create a file archive, view the archive and retrieve files from the archive, complete the
following steps:
Note: If you get a Permission Denied error message while performing this practice, check the
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
write-protect switch on the tape cartridge. Archive your home directory to a file by using the tar
command.
Preparation
Ensure that a tape device is connected to your system. Ask your instructor for any help
required.
RLDC
a ble
In addition to being able to use local classroom equipment, this practice was designed to also
f e r
use equipment located in a remote lab data center. Directions for accessing and using this
ans
resource can be found at:
n - t r
http://remotelabs.sun.com/
a no
a s
Ask your instructor for the particular SSH configuration file that you should use to access the
h
appropriate remote equipment for this practice.
m ) ideฺ
i l ฺ co t Gu
Tasks o t ma den
@ h S tu
Perform the following: 0 thi
-9command s
1. What type of file does theetar
l l z s e create?
- t e to u
_____________________________________________________________
i s a e
2. Archive your
z ns on a tape.
(luhomecedirectory
lle li
_____________________________________________________________
é
T
3. Which command do you use to mount a flash drive?
a _____________________________________________________________
u i s
L 4. Which command do you use to copy files to a flash drive?
_____________________________________________________________
5. Archive your home directory to a file called username.tar in the /tmp directory by using
the tar command.
_____________________________________________________________
6. Use the tar command to view the contents of your home directory archive.
_____________________________________________________________
7. Create a new directory in your home directory called Retrieve. Use the cd command to
move to the new directory. You can use the new directory to practice retrieving files from
archives. Retrieve the contents of the archive tar file that you created on tape.
_____________________________________________________________
8. Ensure that all files in the ~/dir1 directory are readable, and then use the jar command
to archive the ~/dir1 directory.
_____________________________________________________________
11. Compare the current size of the tar file and the jar file archives.
_____________________________________________________________
Is there a difference in the size of the files?
_____________________________________________________________
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
To create a file archive, view the archive and retrieve files from the archive, complete the
following steps.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Tasks
1. What type of file does the tar command create?
A tar file
2. Archive your home directory on a tape.
$ cd
$ tar cvf /dev/rmt/0
a ble
3. Which command do you use to mount a flash drive?
f e r
The volrmmount -i rmdisk0 command
ans
4. Which command do you use to copy files to a flash drive? n - t r
The cp command a no
5. Archive your home directory to a file called username.tar in h a s/tmp directory by using
the
the tar command. m ) ideฺ
$ tar cvf /tmp/username.tar . ilฺc
o Gu
m ayour home
e n t
6. Use the tar command to view the contents
h o t of
u d directory archive.
@ is S t
$ tar tf /tmp/username.tar
- 9 0 th called Retrieve. Use the cd command to
7. Create a new directory in your
l e z home directory
e
move to the new directory.
- l You can
tecontents
t o ususe the new directory to practice retrieving files from
i s
archives. Retrieve a the e of the archive tar file that you created on tape.
l u
( Retrieve en s
l e z
$ mkdir
l i c
T él $ cd ~/Retrieve
a
uis
$ tar xvf /dev/rmt/0
L ... (output truncated)
8. Ensure that all files in the ~/dir1 directory are readable, and then use the jar command
to archive the ~/dir1 directory.
$ cd
$ jar cvf dir1.jar dir1
9. Use the tar command to archive the ~/dir1 directory and the contents of the ~/dir1
directory.
$ cd
$ tar cvf dir1.tar dir1
10. What is the difference between the tar command and the jar command?
The tar command archives files to a single file called a tar file. The jar command
compresses the named files in addition to archiving the files.
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
a ble
f e r
ans
n - t r
a no
Practices for h a s
Lesson 15:
) e ฺ
i l ฺ comt GuViewing,
Compressing, id and
o t ma den
Uncompressing Files
h t u
- 9 is S 15
0@ thChapter
t e l lez use
i s a- e to
z (lu cens
élle li
a T
Luis
Practices Overview
In this practice, you compress and uncompress files, and view compressed files.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
To compress and uncompress files, complete the following steps. Write the commands that you
would use to perform each task in the space provided.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Preparation
Note: Before you begin this practice, uncompress any file that you compressed in the examples
in the module.
RLDC
In addition to being able to use local classroom equipment, this practice was designed to also
use equipment located in a remote lab data center. Directions for accessing and using this
resource can be found at:
http://remotelabs.sun.com/
a ble
Ask your instructor for the particular SSH configuration file that you should use to access the f e r
appropriate remote equipment for this practice.
ans
n - t r
a no
Tasks
h a s
Perform the following:
m ) ideฺ
1. In your home directory, use the compress command i l ฺ coto compress
t G u the dante file and the
file1 file.
o t ma den
h tu
_____________________________________________________________
@ S
2. What are the new names for -the 90compressed
t s
hi versions of the dante file and the file1 file?
z
lle us e
_____________________________________________________________
- t
a can e o use to view the contents of a file that was compressed with
tyou
i s
3. Which three commands e
z (lu command?
the compress
c e ns
élle li
_____________________________________________________________
T
a Use the gzip command to compress the file2 file and the dante_1 file.
4.
Luis _____________________________________________________________
5. What are the new names for the compressed versions of the file2 file and the dante_1
file?
_____________________________________________________________
6. What is the difference between the gzip command and the zip command?
_____________________________________________________________
7. Use the zip command to compress the file3 file, the fruit2 file, and the tutor.vi file
to a file called files.zip.
_____________________________________________________________
8. Which command do you use to view the compressed archive file called files.zip?
_____________________________________________________________
9. Do the original versions of the file3 file, the fruit2 file, and the tutor.vi file still exist?
_____________________________________________________________
_____________________________________________________________
Do the file2 file and the dante_1 file still have a .gz extension on the file names?
_____________________________________________________________
12. Which command do you use to unarchive the file3 file, the fruit2 file, and the
tutor.vi file from the zip file created in Step 7?
_____________________________________________________________
Does the files.zip file still exist in the directory?
_____________________________________________________________ a ble
f e r
13. What happens when you compress a file that is already compressed?
ans
_____________________________________________________________
n - t r
Practice Summary a no
h a sor discoveries you had
during the practice. m ) ideฺ
Discussion: Take a few minutes to discuss what experiences, issues,
i l ฺ co t Gu
ma den
• Experiences
o t
• Interpretations
@ h S tu
• Conclusions
- 90 thi s
• Applications
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
To compress and uncompress files, complete the following steps.
Tasks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
1. In your home directory, use the compress command to compress the dante file and the
file1 file.
$ compress dante
$ compress file1
2. What are the new names for the compressed versions of the dante file and the file1 file?
dante.Z
file1.Z
a ble
3. Which three commands can you use to view the contents of a file that was compressed with
f e r
the compress command?
ans
The uncompress -c filename command, the zcat filename command, or the gzcat
n - t r
filename command
a no
4. s
Use the gzip command to compress the file2 file and the dante_1 file.
h a
$ gzip file2 dante_1
m ) ideฺ
5. What are the new names for the compressed versions i l ฺ coof the
t G u file and the dante_1
file2
file?
o t ma den
The names are:
@ h S tu
file2.gz
- 90 thi s
l z
le use
dante_1.gz
t e
a- between
6. What is the difference to the gzip command and the zip command?
i s e
lu ereduces
The gzip(command
z c ns the size of files, whereas the zip command compresses one
T é lle files intolia single zip archive.
or more
a Use the zip command to compress the file3 file, the fruit2 file, and the tutor.vi file
7.
Luis to a file called files.zip.
$ zip files.zip file3 fruit2 tutor.vi
adding: file3 (deflated 25%)
adding: fruit2 (deflated 17%)
adding: tutor.vi (deflated 75%)
8. Which command do you use to view the compressed archive file called files.zip?
The unzip -l files.zip command
9. Do the original versions of the file3 file, the fruit2 file, and the tutor.vi file still exist?
Yes.
10. Uncompress the dante.Z file and the file1.Z file.
$ uncompress dante.Z
$ uncompress file1.Z
Do the dante file and the file1 file still have a .Z extension on the file names?
No.
a ble
f e r
ans
n - t r
a no
Practices for h a s
Lesson 16:
) e ฺ
Performing
i l ฺ comt G uid
Remote
o t ma den
Connections
@ h Chapter
S tu16
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Practices Overview
In this practice, you will use some of the remote connection commands introduced in this
lesson.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
a ble
f e r
ans
n - t r
o
s an
) ha eฺ
i l ฺ comt Guid
o t ma den
@ h S tu
- 90 thi s
l z
le use
t e
a- e to
i s
z (lu cens
élle li
a T
Luis
Overview
To use remote connection commands, complete the following steps. Write the commands that
you would use to perform each task in the space provided.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ
Preparation
Launch the calculator on each system prior to beginning the practice, by performing the
gcalctool command.
RLDC
In addition to being able to use local classroom equipment, this practice was designed to also
use equipment located in a remote lab data center. Directions for accessing and using this
resource can be found at:
a ble
http://remotelabs.sun.com/
f e r
Ask your instructor for the particular SSH configuration file that you should use to access the ans
appropriate remote equipment for this practice. n - t r
a no
h a s
Tasks
m ) ideฺ
Perform the following:
i l ฺ co t Gu
1. Perform the ssh command to log in to another
o t masystem d innyour classroom.
e
h tu
_____________________________________________________________
@ S
Which directory are you accessing - s
90 on thethremote
i system?
l e z e
- l
tethat t o us
_____________________________________________________________
2. Perform the command
i s a e shows you the host name of the current system.
l u
( cen s
_____________________________________________________________
e z i
él the ps lcommand
l
3. Perform
T to identify the PID of the gcalctool command on the remote
a system.
Luis _____________________________________________________________
4. Terminate the gcalctool command using the PID.
_____________________________________________________________
Are you able to terminate the process? Why or why not?
_____________________________________________________________
5. Log out of the remote system.
_____________________________________________________________
6. Display the host name of your current system to determine whether you are back on your
host system.
_____________________________________________________________
7. Which remote connection command do you use to run a program remotely?
_____________________________________________________________
8. Which command do you use to terminate a process by remotely logging into another
system?
_____________________________________________________________
system.
_____________________________________________________________
12. Which command do you use to copy remote directories?
_____________________________________________________________
13. Which remote connection command do you use to transfer files from system to system,
including binary files?
_____________________________________________________________
a ble
14. How do you end an ftp session?
f e r
_____________________________________________________________
ans
15. How do you simultaneously transfer multiple files from a remote system to your current n - t r
working directory on your local system?
a no
a
_____________________________________________________________
h s
16. m ) ideฺ
How do you transfer multiple files from the local system to a directory on the remote
system?
i l ฺ co t Gu
o t ma den
_____________________________________________________________
@ h S tu
Practice Summary
- 0 thi
9discuss s
Discussion: Take a few minutes
l z
le use what experiences, issues, or discoveries you had
to
during the practice. t e
a- e to
i s
(lu cens
• Experiences
z
le li
• lInterpretations
T• é Conclusions
a
Luis • Applications
Overview
To use remote connection commands, complete the following steps:
Tasks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2013, Oracle and/or its affiliatesฺ