AIX 5L Basics - Master Visuals
Transcript of AIX 5L Basics - Master Visuals
AIX 5L Basics (Course Code AU13)
Master Visuals
ERC 6.0
Worldwide Certified MaterialIBM Learning Services
V1.2.2
cover
Master Visuals
The information contained in this document has not been submitted to any formal IBM test and is distributed on an “as is” basis withoutany warranty either express or implied. The use of this information or the implementation of any of these techniques is a customerresponsibility and depends on the customer’s ability to evaluate and integrate them into the customer’s operational environment. Whileeach item may have been reviewed by IBM for accuracy in a specific situation, there is no guarantee that the same or similar results willresult elsewhere. Customers attempting to adapt these techniques to their own environments do so at their own risk. The originalrepository material for this course has been certified as being Year 2000 compliant.
© Copyright International Business Machines Corporation 1995, 2001. All rights reserved.This document may not be reproduced in whole or in part without the prior written permission of IBM.Note to U.S. Government Users — Documentation related to restricted rights — Use, duplication or disclosure is subject to restrictionsset forth in GSA ADP Schedule Contract with IBM Corp.
Trademarks
IBM® is a registered trademark of International Business Machines Corporation.
The following are trademarks of International Business Machines Corporation in the United States, or other countries, or both:
Freelance and Lotus Notes are trademarks of Lotus Development Corporation in the United States, or other countries, or both.
Microsoft, Windows, and the Windows 95 logo are trademarks or registered trademarks of Microsoft Corporation.
Other company, product, and service names may be trademarks or service marks of others.
Aptiva BookMaster FuturePathMwave ProcessMaster RealPhoneThe Learner Within ThinkPad WorkPadxILLAPI
June 2001 Edition
Master VisualsV1.2.2
TOC
ContentsCourse Presentation Material Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
Unit 1. Introduction to AIX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
Unit 2. Using the System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
Unit 3. AIX Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
Unit 4. Files and Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
Unit 5. Using Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
Unit 6. File Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1
Unit 7. The vi Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1
Unit 8. Shell Basics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1
Unit 9. Using Shell Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1
Unit 10. Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-1
Unit 11. Controlling Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-1
Unit 12. Customizing the User Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-1
Unit 13. AIX Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-1
Unit 14. AIX Utilities Part II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-1
Unit 15. Additional Shell Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-1
Unit 16. AIXwindows Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-1
Unit 17. Customizing AIXwindows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-1
Unit 18. Using the Common Desktop Environment (CDE) . . . . . . . . . . . . . . . . 18-1
Unit 19. CDE User Customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-1
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Contents iii
Master Visuals
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
iv AIX 5L Basics © Copyright IBM Corp. 1995, 2001
Master VisualsV1.2.2
pref
Course Presentation Material OverviewIncluded in this package are landscape, black and white paper copies of each of the student visuals included in the Student Notebook. The paper copies are to be used to reproduce overhead transparencies require to teach the course. It is recommended that black-on-clear transparencies be used to reproduce the package.
In addition to the student visuals, a welcome visual SHOULD be included. To ensure that each student is attending the correct course for which they originally enrolled, the welcome visual should be used to provide the student with the course name and course code upon entering the classroom.
It is advised that upon checking out the classroom prior to the start of class, there be two overhead projectors in the classroom. This will guarantee that there is a working overhead projector available at all times for the duration of the class.
The paper copies and the transparencies created from the paper copies are the property of IBM. By way of protecting our intellectual properties, neither the paper copies nor the transparencies should be given to anyone other than a course certified instructor. The copies are not to be used for any purpose other than teaching the course. The security of this package and the products created as a result of this package are the responsibility of the course certified instructor.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Course Presentation Material Overview v
Master Visuals
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
vi AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
PrefaceCourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Preface vii
ëë
����
��
���
�
�
��
�����
���
����
�����
��
��
�����
��
���
����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
viii AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
���
���
�����
���
��
�������
������������ ����� ����
�� ����
������������ ����� ������
�����������
������������ �������������������� �������� �����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Preface ix
ëë
��
����
!��
������������������������������ ��������� ������������
�
"���������������������� �������������������
��������
���
����
���
���
����
��
!����������#
������� ��
������
����
"�������������������������
$���
������!
� �� ���
#$�������������
���
��
���
����� ���������
��������
%�����&��������'����
�!��
��
���
�
(���������
��$
�����
���
���
����������
���
������
��
������
�%
���
�%
������������
�������
��
��
���
��&��
��'
�!��
��
���
� �)%"#*
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
x AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë"
��
��
��
(�
�
����������(������
���+�
����� ������������
���,�
�������-�����
���.�
����"�����������
���/�
0������ �"��������
���1�
����0���
���2�
0������������
���3�
�����# ���
���4�
-���������
���5�
����-����6�������
��
(�
)
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Preface xi
ëë
"
��
���*
��
��+
���+3�
%�����&�������� ����),*
���+4�
�������%������"��'����#����������)%"#*
���+5�
%"#� ����%�����&����
��
(�
�
���+/�
���� ���������������),*
���+1�
� ������-����0�������
���+2�
����� ����%�������
���+3�
%�����&�������� ����)+*
��
(�
,
���5�
���������
���+7�
%�������������������
���+,�
%�����&������ ����#���������
���+.�
���� �����
���+/�
���� ���������������)+*
��
(�
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
xii AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
���
�"
����
��
-�� ���
����'���� �����
-������� ����������
8������
��� ���������
!�������
0������
-��'��������
���'��
#����������$��
!���������������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Preface xiii
ëë
���
��
����
��
�
9���
%������
:��� ����
������������ 9����$�������
%����������������������'
-�����������;���������
#$���������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
xiv AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 1. Introduction to AIXCourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 1. Introduction to AIX 1-1
ëë
-�
����
���
��
��
���
���
��
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
1-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
����
!��
�������������������������������������������
"�����������
� �
����
��
��
��
�������������������
"�����������
� �
����
���
�������������
���� �����!
���
�����������������������'������������
����������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 1. Introduction to AIX 1-3
ëë
�
���
���
���
"�.
(���
�
����<�����
�������������� ���
���������������
��������+
��������,
��������.
��������/
===
�������
��������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
1-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
�&��
"��
���
��
��.
(���
��*
�+
8�����������
>������� +
>������� ,
�(��'���������
-���
>���
>���������
%����������
��������
>��������
>� �������
?���������
-���
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 1. Introduction to AIX 1-5
ëë
��
�&��
"��
���
��
��.
(���
��*
)+
0���-�����
(��'������
��������
"���
(��'����������
"�'�
%"@AB!
9�����'
# �������
%�����������
�����
�������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
1-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
!��
(/�
0������
��$
���
���
&�
<CCCCCC
���
�#�����
��
$���
%���
-CCCCC
-���1
��
����
�#���
0CCC
-CCCCCC
�������
��
����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 1. Introduction to AIX 1-7
ëë
2$
��.
$���/�
-����
���
�#�����
��
�
.$
���
#$������������������ ��
%����� �����������
0��������
(� ��� �
6��������
�=== %�����&����
����������������
�����������
��������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
1-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë-��#�
��
��-
������
��
���+
-��������������������
-������������������������
%�������������� �
��������
%������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 1. Introduction to AIX 1-9
ëë
�
�3��
�$
�����-
����
���
�#����
(� ���
�����
!�����
������
����� ���
%������"��'����
#����������)%"#*
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
1-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë-�
����
/��
$��&�
���
�
(���
���
��#�
�$���
����
���
"��
(���
����������� �������������
$���
%���D
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
(���
���
��#�
�$���
����
���
"��
(���
�� ��������
��� �����������D
�*�-���
�*�<�����
(���
���
�� ������������������������ 9������������D��
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
(���� �����������������������������������������������
�*�*
�������������������������������������������������� � �'���
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 1. Introduction to AIX 1-11
ëë
.�
��
��(
���
��4
���
������������������ ����� �������� �
������������������������������������������
�������E������������������������
$���=�������������
������ ����������������������������������$����
��������� ������������������������#�
����
��������
������������
������
������� �#
����
�������������� �������������������
������
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
1-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 2. Using the SystemCourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 2. Using the System 2-1
ëë
-�
���)
-���
"��
$��.
(���
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
2-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
����
!��
��������������������������� ��������� ������������
�
"������ ��
�� �������������
-���������
���
���
������
���
��
���
��
#$�������
����
��
���
��
��
��
������������� ������
��
��
���
��������
�$���
�����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 2. Using the System 2-3
ëë
�
""
��"
��
���
���
��
���8�����
login: team01
team01's Password: (the password does not appear)
$ _
���8�������
$ <ctrl-d>
(or)
$ exit
(or)
$ logout
login: _
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
2-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë5���%
���
�
%����������%������
$ passwd
Changing password for "team01"
team01's Old password :
team01's New password:
Enter the new password again:
$ _
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 2. Using the System 2-5
ëë
��
��
��
��0
���
��
�
���
��
��
���$
�!���
$��#
����
%��
"�#
���
��/
$ command
option(s) argument(s)
$ mail-f
newmail
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
2-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
��
��
��0
���
���
'6��
���
�
73
82/
��
7�
93
/
���.
��
���
���
�/
$ mail -f newmail
$ mail - f newmail
$ who -u
$ who-u
)���
����/
$ mail -f newmail
$ mail newmail -f
$ mail team01
$ team01 mail
$ who -u
$ -u who
���:
���
����
���
���
��/
$ who
-m-u
$ who -m-u
$ who
-mu
$ who -m u
,��:
���
����
��"
��
��
��/
$ mail team01 team02
$ mail team01team02
28
'7
'�
7'
�'�
�'
52
�9
.;;
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 2. Using the System 2-7
ëë
����
���
���
����
��
���
��
�$
��&��
"��
$���
���
/
$ date
Fri Jan 14 10:15:00
GMT
2000
�
�&��
"��
�����
��
�$/
$ cal 1 2000
January 2000
Sun Mon Tue Wed Thu Fri Sat
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
�
�&��
"��
����(
���/
$ cal 2001
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
2-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2$
���
����<
���$
�<���
���
��
����
��
��
��
��
���
��/
� %�����������������������
$ clear
��$
�/�(�����������������������������
$ echo Lunch is at 12:00
Lunch is at 12:00
���
���/
� (�������������������������������������������������
$ banner Hello
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 2. Using the System 2-9
ëë
���
!��
(/�
��
����
��
���
��
��
�%
���
+=(��E����������������������������� �D
$ du -s k
$ df-k
$ du -a-k
,=(�������� �===
===�������������������� �D
===������������������D
===����������������������������� ����D
===��$�������������������D
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
2-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2$
��%
$�
���
��#
��"
���
��
��
��
��
������������������� ����
$ who
root
lft0 Sept 4 14:29
team01
pts/0
Sept 4 17:21
����������� ������
$ who am i
team01
pts/0
Sept 4 17:21 (or)
$ whoami
team01
�������� "����������������������������������������������� ���
$ finger team02
Login name: team02
Directory: /home/team02
Shell: /usr/bin/ksh
On since Mar 04 16:17:10 on tty3
No Plan.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 2. Using the System 2-11
ëë
.��
���
"�:
���
$ mail team01
Subject:
Meeting
There will be a brief announcement meeting today
in room 602 at noon.
<ctrl -d>
Cc: <Enter>
$ mail team20@sys2
Subject: Don't Forget!
Don't forget about the meeting today!
<ctrl -d>
Cc: <Enter>
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
2-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë7����!
��"
�:���
=>�
-�8
�
'�9
'�
�:
?
@��
���
!����F1=,� %�G�F���/=+G�
�����D��������
H;���;�����;���;����7+H��,�����������+����
�� ��+�����71��������:���/��+7�17��+7;,23��HI�����JH
K9�,������7,��(� ��:���1��++�,1���+2;.++��H!�����H
D��
��)
0��������7,��(� ��:���1��++�,1��,777
"�����(� �1���:�����,777��++�,1
0���������7,
��������7+
-��L�����!�����
%��
����������������������������������������� ����������27,��������=
D��
)"�������������*
D� A
)M������������� *
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 2. Using the System 2-13
ëë
%��
����
��
�%���
%��
����-�� ��
����"
�����������
�����������������
$ write team01 (or)
$ write sarah@moon
��������� ��� �
��
!���
���
��
B��&
������������������������
����� @������=�#������������������������ ���� ���������
��������=
��� %
���������� ����������������������=��������������������������
������������������������
0����$������
$ wall The system will be inactive from 10 pm today.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
2-14 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���&
����
$�
��
�$���
-���
$ talk fred
���������������)�������� �������������������������������*
Message from TalkDaemon@sys1 at 16:03 ...
talk: connection requested by john@sys1
talk: respond with: talk john
���������������)������������������������ ��������*
$ talk john
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 2. Using the System 2-15
ëë
���"
����
��"������� ����������������������������������������
������� �����������������
$ mesg n
����
����
��A���������������
$ mesg y
����
�������������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
2-16 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë4�(�
����
�2��
�
C�
��&��
���D
C�
���B
�D
C�
���B
�D
C�
���B
�D
C�
���B
AD
C�
���B
�D
%������������'��
��������������������
������ ��� ��������������
����
#� �������������������� �
������
��������������������������
���������
A��������������)������ �
���%���@�*
#������������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 2. Using the System 2-17
ëë
9�6��
.��
�����
#$������+
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
2-18 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë(���������������������� ������$������D
$ mail newmail -f
$ mail f newmail
$ -f mail
$ mail -f newmail
(��������� ����� ��������������� ���������D
��CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
(������������������ ���������������� ������������������
����������D
��CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
(�������������� ������$���������������������������� ��
��� �
ED
��CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
(�������� ����� �������������� ��������������������������
����� ��D
$ who am i
$ who
$ finger everyone
$ finger username
-�
���)
/��
$��&�
���
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 2. Using the System 2-19
ëë
.�
��
��(
���������� ��������������������������� �����������
�� �������������������������$������
���������������������������������������� ������
��� ���
���
����������
�����
���
�����
������
��
%������������������ 9�������������������� ��
���������������������'���� �����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
2-20 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 3. AIX DocumentationCourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 3. AIX Documentation 3-1
ëë
-�
����
�
���
��
���
����
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
3-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��������������������������� ��������� ������������
�������
��������� ����������������������������
������ �
"���������������������61=+�%
��
B�����
���
���
��
��
��
���
����
��
��
����
!��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 3. AIX Documentation 3-3
ëë
���
���
��
��
�
����
��������� ����� ��������������������������
��
��
��
������
���
���
������ �#
����=
!���������������������������
�������
)���@���� ��������*
������
)�����$*
��� �!��!��
�"�#�
�!"��
)�������� �����*
��"�����!����$��!��
%�#�
)� �������*
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
3-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
�'6��
���
$ man who
Purpose
Identifies the users currently logged in.
Syntax
who [ -a | -b -d -h -i -I -m -p -q -u -H -T ] [ File ]
who am { i | I}
Description
The who command displays information about all users currently on the
local system. The following information is displayed: login name,
workstation name, date and time of login.
Flags
-m
Displays information about the current terminal. The
who -m command is equivalent to the who am i and
who am I commands.
-u or -i
Displays the user name, workstation name, login time,
line activity, and process ID of each current user.
Examples
1. To display information about who is using the local system node,
enter:
who
Implementation Specifics
This command is part of Asynchronous Terminal Emulation (ATE)
Files
/etc/utmp
Contains user and accounting information.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 3. AIX Documentation 3-5
ëë
���
�B&/�
��
�&��
"�%
��$
���4
�(%
���
���B
&��������������
��������� ���������������������������@����
����������������������������������������'����� =
#$������
$ man -k print
cancel(1)
Cancels requests to a line printer
disable(1)
Disables a printer queue
enable(1)
Enables a printer queue
lpr(1)
Enqueues print jobs
lpstat(1)
Displays line printer status information
qcan(1)
Cancels a print job
qchk(1)
Displays the status of a print queue
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
3-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë"������������-�����
����1=+���������� �����������
"������������-�����-�����
(������������������
(�������������������
"������������%����
(�������������������
"������������%����
(�������������������
6������� �������������������������������������
�
�����
���
��
���
����
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 3. AIX Documentation 3-7
ëë
�
�����
���
����
���
��
���
����
��
� ��
���(
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
3-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë9�!�"
���
�"
��$
���
���
���
��2
���
'6�
��
���
���
��
��
����
����
���
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 3. AIX Documentation 3-9
ëë
.����
$��
"�
���
���
���
����
���
��
���
����
��
-�����-����
� ����� �-����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
3-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë.����
$�7
���
���
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 3. AIX Documentation 3-11
ëë
9�6��
.��
�����
#$������,
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
3-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë-�
����
/��
$��&�
���
�
+=(�������� � ��������������������������D
��CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
,=%������������������������������
�������61=+������� ����������������� � ������
CCCCCCCCC��CCCCCCC=������������������������
������'������������������@���������������������
�������������CCCCCCCCC�CCCCCC=�
.=I��������������������"������������8��������������
������ �����D
��CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 3. AIX Documentation 3-13
ëë
����
��������� ����������� ��������������� �����
������� ����������������������� �
�����%
��
����
%���������������
����
���
���
���
����
���
�������61=+
.�
��
��(
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
3-14 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 4. Files and DirectoriesCourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 4. Files and Directories 4-1
ëë
-�
���,
0������
��
����
����
����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
4-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
����
!��
��������������������������� ��������� ������������
"�����������
�##�
���
��#�
����
(�
��
"��������������#
�����
(���
���
���
���
��
���#
������ ��
���
��!���
��$
����
���������������������
%������� ��������� �����
���
����
����
�������
��
�$������� ���������������
��
�(�#
���
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 4. Files and Directories 4-3
ëë
�0
���
��������
���
�������
��
��#�
����
���
�����
��#�
�$
���
���
��������H�����������H
9�
����
����
���������� �������������������������
������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
4-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë0����2
(�
��
���
����(
/
2�6�����
��
��� �
���
���
��
���(
/
���
��
����
#��
��
���
��<�����������������
���
#�#�
�����������
�������
.�
����
��0
����/
A����������� ����������������
�!��
��
#$����������
�B7
�:
B��!��
�������������� ���� F�
�!F�
�G
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 4. Files and Directories 4-5
ëë
���
����
�(��
��
���
��
H����
�� �
��'�
����
�����
���
�&����
/ �
311
,����7+
�����
:����+7�
+7�+1
1+,
+7
���
2//
+����7+
�����
:����++�
++�77�
52
���
��B
��
��
��� �+
/
�����
+7
"�������
�� �������
"���
$ vi myfile
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
4-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë8��
����
$��
���.
���
���
��
;
���
��
���
���
���
���
���
���+��7
����
=������
�������
����+
���C������
���C���
������
����7+
����7,
����7.
����
� ��
��������
����
��
�$�����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 4. Files and Directories 4-7
ëë
5��$
���
��
���
�A
���
����
#�#�
����
��
������������ �����������);*������
������������
��$�����������������#�
���
%���
���
�������
�������������������
0������������)��������������;@ �������*�
/home/team01/doc/mon/report
/usr/bin/ls
A���������������)������������������� �������*�
./test1
)=�N��������� �������*
../team03/.profile
)==�N�������� �������*
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
4-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë�$
���
��
����I
����
���
��%
��&
��"
����
����
�(������� ����������� ����
�� ���������������������� ����������
$ pwd
/home/team01
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 4. Files and Directories 4-9
ëë
��
���
"��
������
����
����������������������������������� ��������
$ ls
c doc manuals test1
��������������������� ��� ���)=*������
$ ls -a
. .. .profile c doc manuals test1
������������������������ ������� �������������
$ ls -R
c doc manuals test1
./c:
./doc:
mon_report trio_ltr walrus
-����$���
���F� ��������G
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
4-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë�
�"
� ��
���
"��
#�0
����
����
�������� �������B
� ����������������� ����������
��������������������������������� �������=
$ ls -l
total 5
drwxrwxr-x
2team01 staff 1024 Aug 12
10:16
cdrwxrwxr-x
2team01
staff 512 Feb 18
09:55
doc
-rwxrwxr-x
1team01
staff 320 Feb 22
07:30
suba
-rwxrwxr-x
2team01 staff 144 Feb 22
16:30
test1
$ ls -li test1
29 -rwxrwxr-x 2 team01 staff 144 Feb 22 16:30 test1
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 4. Files and Directories 4-11
ëë
�$
��
"���
���
��
���
������
�(
!��������� �������� F
$�
��F�
���
G����� F$
��
�F�
���
G�F�
��/
$ cd doc
�����������
$ cd /home/team01/doc
��������
!���������������� ��������
$ cd
!����������������� ��������
>� �
����
-����$���
���F� ��������G
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
4-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë������������� ���������
��� ����������@ �����������
F$�
��F�
���
G�/
$ mkdir /home/team01/test
� �����������������
)��*
$ cd /home/team01���
$ mkdir test
������������������������
���
���
�"
����
����
����
-����$���
�&�
��� ��������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 4. Files and Directories 4-13
ëë
���
!��
(/�
��J
�
+=I����������� �������������
��
���
��
�������������D
,=(����������� �
��
����� � ��
��
���
��
������������������ �D
.=I����������� �������������
��
����
���
������
�(�D
/=I�������������������#
�������
����
������
�(������ ���$
���
��
�#�����D
1=O������������ ���������� F�
��F
��F
���=�(������������������������������������
$�
����
������
�(�D
2=(����������������
���
��!��D
../team03/dir1 :
/tmp/file1 :
/.profile :
./.profile :
3=(���� ������� �
$��
���
�##�
���
��#�
����
(�
�����������'�����
�*�*�*
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
4-14 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë7��
�!��
"��
������
����
A��������� ��������F
$�
��F�
���
G�F�
��/
$ rmdir /home/team01/doc
-����$���
���
��� ��������
��� ����������������������J
$ rmdir books
rmdir: books not empty
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 4. Files and Directories 4-15
ëë
%�������������� �����������������������
$ mkdir -p dir1/dir2/dir3
A�������� ���������� ����������� ���������
$ rmdir -p dir1/dir2/dir3
��
�&��
"�%
��$
�:�
����
����
������
����
���
;
����7+
�+
���
;
����7+
�,
�.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
4-16 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
���
(��
"��
������
�(��
#���
���
��
$ ls -ldi mydir
51 drwxr-xr-x 2 team01 staff 512 Jan 17 17:38 mydir
$ istat mydir
Inode 51 on device 10/8 Directory
Protection: rwxr-xr-x
Owner: 208(team01)
Group: 1 (staff)
Link count: 2
Length 512 bytes
Last updated:
Mon
Jan 17
21:05:432000
Last modified:
Mon
Jan 17
17:38:522000
Last accessed:
Tue
Jan 18
13:30:002000
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 4. Files and Directories 4-17
ëë
�
�0����
��
��
-��� ���� ����������������������
-��� �������������������������������
��#A%�-#���������������������P��Q��C
-��� ��������� ����� � �����'�
-��� �������������������������������
R�D�K�S�;�T�U�J�F�G�V�>�W�E�H�)�*
-��� ��
�� ���������H
JH����HBH����
-��� ��
�� ������������������������������
�����
�����
��
���
�!�
0�����������������������)
��
� *����� ���������������������
������
����
�6��
��
���
��
���
�#�
�$
���
���
�������������������,11
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
4-18 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
�$
���
��
��
�
��
���
��
$������� ��� �������� �
��
��
���� � �
��
�#��
���
���
�������������=����������� ���������������� �����
���
���
K�
��B�
��
"�$
�#��
��=
$ ls -l
-rwxrwxr-x 1 team01 staff 320 Jan 6 07:30 suba
$ date
Thu Sep 10 12:25:00 2000
$ touch suba new_file
$ ls -l
-rwxrwxr-x 1 team01 staff 320 Sep 10 12:25 suba
-rw-r--r-- 1 team01 staff 0 Sep 10 12:25 new_file
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 4. Files and Directories 4-19
ëë
9�6��
.��
�����
#$������.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
4-20 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë-�
���,
/��
$��&�
���
�
+= ������������������������������������� ������F
$�
�����������
�������� ���������������� ������������������
��
������������
"�
��
������������������������ ������������������D
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
,=(��������������������������������� ��������������������=�
�� ����==D
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
.=(����������� �==;==������� � �D
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
/=(������ ��������������������� ����� �����������
��
��������� �
������������������������D
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 4. Files and Directories 4-21
ëë
-�
���,
/��
$��&�
���
��*�
��
�+
1=��!��������������������������� �
�������� �������
���������=
�=@�
CC���� �����������������������
�=@
CC(������� �������
�=@
CC8������ ����������� �������������
=@�
CC"������������ ��������
�=@A
CC"������������������������� �������
2=��(������������������������ ���������=
�=+
�=���"�
�=@�����
=��C���
�=��=���
�=��������
�==�����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
4-22 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë.�
��
��(
������������������������������������������� �
B� ����
"�������
-�����
���������������������������������������������
0��������������� �������������������������������
�����=������������������������������������;�)������ �
����*
������������������ ������������ ���� ����������
�%
�<���
<��
&�
��<���
������ ���
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 4. Files and Directories 4-23
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
4-24 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 5. Using FilesCourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 5. Using Files 5-1
ëë
-�
����
-���
"�0
����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
5-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
����
!��
��
�(<���
���
���� ��
��
�!������
������%
�� ������
��
&�����
���
���
(��
$���
��
���
��������������� �������������� �
5��
�� �����
��������������������������� ��������� ������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 5. Using Files 5-3
ëë
��
�(��
"�0
����
���������������F$
��
�F�
���
G�F�
"�
�F�
��
�����F$
��
�F�
���
G�F�
����� �
������� �
��"
���
�/
$ pwd
/home/team01/doc
$ cp /home/team03/pgms/suba programa
���C������
���C���
������
���
����7+
��
�
���C������
���
"��
��
���C���
������
���
����7+
��
�
��
��������������
������+����,�===�������C ��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
5-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë'6��
���
���
��
����
$ cd /home/team01
$ cp doc/programa test1 c
���
����7+
=������
�������
�����
��
��
���
"��
��
���
����7+
=������
�������
����+
�
��������
���
"��
��
�����
��
���
����7+
�
���C���
����
L��
� ��
���
����7+
�
����
L��
�
��
$ cd /home/team01/doc
$ cp trio_ltr ../c
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 5. Using Files 5-5
ëë
:�
!��
"��
��
�7��
��
��"
�0����
$ pwd
/home/team01/c
$ mv trio_ltr t.letter
���
����7+
�
����
L��
�
���
����7+
�
����
���
�
�!��
��
�����
��"
����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
5-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë'6��
���
���
��
����
$ pwd
/home/team01/c
$ mv t.letter ../doc/letter
���
����7+
�
��
�L��
��
��
��
���
����7+
�
���C���
����
��
��
�
���
����7+
�
���C���
����
����
��
���
����7+
�
��
�L��
��
��
��
�
$ pwd
/home/team01/c
$ mv ../doc/mon_report .
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 5. Using Files 5-7
ëë
��
���
"�0
�����
��
���
��
$ cat walrus
"The time has come," the Walrus said,
"To talk of many things:
Of shoes - and ships - and sealing wax
- Of cabbages - and kings -
And why the sea is boiling hot -
And whether pigs have wings."
From The Walrus And The Carpenter
by Lewis Carroll (1871)
����
#���
��#
���
)��
����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
5-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
���
(��
"�0
����
�"
��������
��
�����������
$ pg walrus (or) $ more walrus
"The time has come," the Walrus said,
"To talk of many things:
Of shoes - and ships - and sealing wax -
Of cabbages - and kings -
And why the sea is boiling hot -
And whether pigs have wings."
: <Enter>
�����������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 5. Using Files 5-9
ëë
%���
��
���
�
���%
�������� ������������������������������ ���� �����������
���� �����
$ wc [-c] [-l] [-w] filename
B������
B��������������������������
B������������
B%���������� �
#$������
$ wc myfile
+3
+,2
+741�������
���������
��� �
����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
5-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
!��
(/�
��
�&��
"�%
��$
��$
��%
���
��
���
�
������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 5. Using Files 5-11
ëë
��
&��
"�0
����
������������ ������������������������
���
��$
��
���
��
���
�/
$ pwd
/home/team01
$ ln manuals /home/team02/man_files
���������C����������C����
������������������������ �
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
5-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë7��
�!��
"�0
����
$ ls
mon_report trio_ltr walrus
$ rm mon_report
$ ls
trio_ltr walrus
$ rm -i walrus
rm: Remove walrus: y
$ ls
trio_ltr
������+����,����.�===�
@��A�����������������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 5. Using Files 5-13
ëë
5��
���
�"
�0����
����������������������������������A
���������� �
$ qprt filename filename2 filename3 ....
��� A
�$
&������� � �����������������������������������������
$ qchk
Queue
Dev Status Job Files User PP %
Blks Cp
Rnk
lp0
lp0 Running 99 walrus team01 1 1 1 1
��������������������L���������� A
��
�������� �
$ qcan -x 99
:���������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
5-14 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë#$������/
9�6��
.��
�����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 5. Using Files 5-15
ëë
-�
����
/��
$��&�
���
�
+=(
������������������������������������ �D
>�� �;���;����7+
>�������+����,
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
,=(
������������������������������������ �D
>�� �;����;����7+
>�������+�������
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
.=(
������������������������������������ �D
>�� �;����;����7+
>����������������
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
/=8��������� ���������������� ����������������������������=
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
5-16 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë.�
��
��(
����
�������� ����������� �������������
����
!������� ����������� ����������� ������������
����������� ����������� ������������ ������������
���������
"���������������������������������
�� ���
"����
��
��
�������
�������� ���� ����������
������A
���������� �������������
���%
�@������ ����� ������� ������������� ����������
������������������� �������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 5. Using Files 5-17
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
5-18 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 6. File PermissionsCourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 6. File Permissions 6-1
ëë
-�
���M
0����5
���
�����
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
6-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
����
!��
��������������������������� ��������� ������������
8�������
����
�#�����
���
�����
��
�$
��
"����������#
�����
���
�����
���������������
�������� ����������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 6. File Permissions 6-3
ëë
�
�"
� ��
���
"��
#�0
����
����
�������� �������B
������������������ ���������������
���������������������������� �������=
$ ls -l
drwxrwxr-x
2team01
staff 1024
Aug 12
10:16c
drwxrwxr-x
2team01
staff 512
Feb 18
09:55doc
-rwxrwxr-x
1team01
staff 320
Feb 22
07:30suba
-rwxrwxr-x
2team01
staff 144
Feb 22
16:30test1
��������
���
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
6-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��0�������
����
��(�����
r => Can look at the contents of a file
w => Can change or delete the contents of a file
x => Can use the file name as a command )������������ � *
��0������
������
�(�
r => Can find out what files are in the directory
w => Can create/remove files in the directory (x is needed)
x => Has permission to be in the directory
(that is, cd to the directory or access files from the
directory)
0����5
����
���
��
F5���
�����
��
�%6
�%6
�%6
����
�����
�����
��N����
��N���������$�N��$�����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 6. File Permissions 6-5
ëë
�$
��
"��
"�5
���
�����
���*
.(�
��
����9
���
���
�+
��N����������������
"�N������E�������
��N������������������������
��N����
$ ls -l newfile
-rw-r--r--
1team01
staff58Apr 21
16:06newfile
$ chmod go+w newfile
$ ls -l newfile
-rw-rw-rw-
1team01
staff58Apr 21
16:06newfile
$ chmod a+x newfile
$ ls -l newfile
-rwxrwxrwx
1team01
staff58Apr 21
16:06newfile
$ chmod o-rwx newfile
$ ls -l newfile
-rwxrwx---
1team01
staff58Apr 21
16:06newfile
�$
��
����� �����������
J��� ����������
B�������������������
N��%������������������ ����������� ��������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
6-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë�$
��
"��
"�5
���
�����
���*
����
��9
���
���
�+
0����� � ������������������������������� ��������������
�����$���������� �
���
���
��
��
��
��������������������������������� �������������� ��� �
����������������� ���������� ������
$ ls -l newfile
-rw-r--r--
1team01
staff58Apr 21
16:06newfile
$ chmod 664 newfile
$ ls -l newfile
-rw-rw-r--
1team01
staff65Apr 22
17:06newfile
��$
���
�@@
+77
/X7X7
,
3��
��
��@
++7
/X,X7
M
-���
��$
+++
/X,X+
O
-������
�����
B����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 6. File Permissions 6-7
ëë
��#�
���
�0����5
���
�����
��
��� ���������������������������������� �������� � �������������
����� ��������������������������� �������������� �
���&������=
0��
B�%
B�BB
�BB
����
M,,
"�������
��%
6�B
6�B
6O��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
6-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
��&
��
��&������������������������������������������
��%
�#�������
���
����
�(����������� =�����������
���
���
��
������������� ���� ���������������������������
������� ���������������� ����
New Directory: 777 - 022: 755 => rwxr-xr-x
New File: 666 - 022: 644 => rw-r--r--
��� ����������������G
))��������
�F���
F����
���(
F����������
������������ �����������������������������������=
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 6. File Permissions 6-9
ëë
���
!��
(/�
5���
��
����
������
����
������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
6-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
���5
���
�����
���
���
����
����
�(
$ ls -ld /home/team01
drwxrwxrwx 2 team01 staff 512 July 29 9:40 team01
$ ls -l /home/team01/file1
-rw-r--r-- 1 team01 staff 1300 July 30 10:30 file1
$ whoami
team02
$ vi /home/team01/file1
file1: The file has read permission only
$ vi myfile1
Ha! Ha! I changed this file. Figure out how.
$ mv myfile1 /home/team01/file1
override protection 644 for file1? y
$ cat /home/team01/file1
Ha! Ha! I changed this file. Figure out how.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 6. File Permissions 6-11
ëë
0�
����
��
F5���
�����
���7
�A
���
��
��
��
��
�.
��
�����
������
�(.
��
����0
���
2��"
���
���
����
�(
�
$9;�
9;�
���
9;�
9;�
���@�
���$
9;�
9;�
�' �
$ ��)������*
9;�
9;�
�� �
$ ��)������*
9;�
9;�
�������������
$�
9;�
��
$���
9B9#
$���
��
$�
$���
����
$����R
9B9#
9;�
��$���
9B9#
9;�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
6-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë9�6��
.��
�����
#$������1
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 6. File Permissions 6-13
ëë
-�
���M
/��
$��&�
���
����������������������������������������� ��
��
���
��������������������
������������������
�%6�B
6��
B6
+=(���������� ���������D
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
,=%������� �������$�@�@��@�@�����������������������=
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
.=A��������������������������������������������=
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
/=M������������������ ���������������������=��������������� ��������
��
�����������������
��
��"=�
$ ls -lR
total 8
drwxr-xr-x 2 judy finance 512 June 5 11:08 jobs
./jobs:
total 8
-rw-rw-r-- 1 judy finance 100 June 6 12:16 joblog
�%���0�� �������������������������������������� ����������
��
��"D
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
6-14 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë-�
���M
/��
$��&�
���
��*�
��
�+
1=��M����������������� ���������������������=����������������
�������� �
��
������������ ��������%
��&����������������������
����� �
���
"=
$ ls -lR
total 8
drwxrwxr-x 3 judy finance 512 June 5 11:08 jobs
./jobs:
total 8
drwxrw-r-x 2 judy finance 512 June 5 11:10 work
./jobs/work:
total 8
-rw-rw-r-- 1 judy finance 100 June 6 12:16 joblog
%���0�� �������������������������������������� ���������
��
��"D
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 6. File Permissions 6-15
ëë
-�
���M
/��
$��&�
���
��*�
��
�+
2=��M��������$������� ���������������������=��������������� �������
������ �
��
� ����������� ��������%
��&���������������������������
��
��"=
$ ls -lR
total 8
drwxr-xr-x 3 judy finance 512 June 5 11:08 jobs
./jobs:
total 8
drwxrwxrwx 2 judy finance 512 June 5 11:10 work
./jobs/work:
total 8
-rw-rw-r-- 1 judy finance 100 June 6 12:16 joblog
�%���0�� ������������������������������������������������ �
���
"���
������� �������D
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
6-16 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë.�
��
��(
�����
�#�����
���
�����
�������������� ������������B
��������
�$
��
����������������������� ��������� ��$������
�������������������������������������
������"
���
���� �
��$
���
���������������� ��������
$�
��������� ��������
���� ��������������������������
��
���
��&������������������������������������� �
��������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 6. File Permissions 6-17
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
6-18 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 7. The vi EditorCourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 7. The vi Editor 7-1
ëë
-�
���O
2$
��!
��'
���
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
7-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
����
!��
��������������������������� ��������� ������������
���
������ ��
��������
:��
���
����
���6�����������
-�������
�#�
���
������������ ���
#$�������
��
���
�B�
�����
���
��"
"���������������������
�$���
#���
���
#�!� ��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 7. The vi Editor 7-3
ëë
!� 0
���B�
���
���� ���
2%
���
��
����������������
��
��
��
���� ��
�6
�
��&����
��B�
���
���
��
��
��
��
"�����������������$�
0��$������������ ��������������������
���
���
��
���
$��
"
���������������@ ���� �� �������������������
����
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
7-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë.��
����
"�!
�
$ vi vifile
Y Y Y Y Y Y Y Y Y Y Y Y Y Y H����H��F9������G
���������� P
!�#
���P� ���������$�������������������
B�����������������������$����������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 7. The vi Editor 7-5
ëë
�
���
"�2
�6�
$ vi vifile
'������'�
�������������������� ��������
��� ���=
�������������������������� ����
���'������H%����� ��A��������H�������
�� ����=
Y Y Y Y Y Y Y Y Y Y Y
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
7-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë'6��
��"
��$
��'
���
��
$ vi vifile
'������'��
C'
��D
�������������������� ��������
��� ���=
�������������������������� ����
���'������H%����� ��A��������H�������
�� ����=
Y Y Y Y Y Y Y Y Y Y Y /%A
�������%
��$
��
����������
/A;
����
�!���� ��
6���
/6������/
%A������C
�$
�#�B
KK
D
>��C
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 7. The vi Editor 7-7
ëë
��
���
��:
�!��
��
�
+?
S�����@��K
I '
S���@������K
S ����@������K
�����������L
�����������8
�������S�����@��K
����������?�
�������7
���������
�������
S�����@������K�
�������������>
��������������(
��������������
���S����@������K
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
7-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë����
���
"�2
�6�
��� ���������
��"
����
$���
���
��6
��� �����������
���
���
#��$
���
���
��
��%
����
�%
��� �������������
��
��#�
�$�����
���
�@
��� �������������
����
��#�
�$�����
��
�G
��� ���������%
$�
������
��
��
��� ���������
��
"���
#����
���
/)G
<,G
�
-�
�����������������
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 7. The vi Editor 7-9
ëë
.����
$�#
���
��5
���
���
>��vi vifile
'������'��
&�'(
�
�������������������� �������$
���� ���=
�������������������� �
$���� ����
���'������H%����� ��A��������H�������
�� ����=
Y Y Y Y Y Y Y Y Y Y Y F�$
� ��������������� ������F��
6�
������������'��� �����
� I��
6��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
7-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
!��
(/�
:��
���
K��
���
!��
(
�������������������������� ��
��������$�� ��?��+?��#-%����J�����
M���������������
"������������������
#$���������$���� ��
� ���$���������������
� ����������������
?�����������������
"�����������������������
���������$���������������
(������������� �����
?�����������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 7. The vi Editor 7-11
ëë
�$
��
"��
"�2
�6�
>�vi vifile
'������'��
C'
��D
��$���������������� ��������������
7�����$�
(�� �������������� �
�)
%
B��������������������������� ����������������� ��������������� )�*
�������������������� ��������
��� ���=
��������������������
�$���
����
��
���
�(���� ����
���'��� �
$���
����
��
���
�(�H%����� ��A��������H
��������� ����=
Y Y Y Y Y Y Y Y Y Y Y :g/ the /s// the one and only /g
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
7-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë:�
!��
"�2
�6�
����������������������$�
L��2
$��
�����
$���
���
��
����
���
#���
6�
���������� ����������$�
����������������������$�
L��2
$��
�����
$���
$��
�����
���
#���
6�
����������������������$�
���������� ����������$�
L��2
$��
�����
$���
���
��
����
���
#���
6�
%����� �
��
�
:�
!��
"��� ��������
���
���
"��
$���
��"
�������
6� �������
�
��
�(��
"��� �������(
(��
&��
"���$��������������
�������������������$��������� �������������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 7. The vi Editor 7-13
ëë
!��B�
'6���
���
"�
���
��
���
��
���������������� ��������'� �������������������'�
�����
Y Y Y
$ vi myfile
'������'��
C'
��D
:!ls
���+�������,�������'�
FI�������������������G
:r snacks
���������������� ��������'� �������������������'�
�����
��� ������
�� �����
�������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
7-14 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë!���
���
��
�
��
���
��������� ����������������������������������
���!
� �������
��������
���������� ����;�������� ���
������������;���������
���������;������
���������� ��;�������� �
������������N$
���������������;������������
��������������N1
B������������������ ����������@
8�
:'
F��6��
:����
�� ���������������� ����������� ��������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 7. The vi Editor 7-15
ëë
��
��
��
�B
����'
���
��"
$ set -o vi
�����)���
$
&�
���������� ����'�������!
�
%������������
����
&�������������������
����� ����'��������
���
F��B�
���
���
��!��
������
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
7-16 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë!��'
���
���
!�
0���@������������@��������� ���
!��
%�
A�� ��������������!�������������������
���� ������������� ��������������)J*
!��
���������������������!�������� ������
���� ������=
�6<���
-���������!�����'����������� ������
������������������ �����������������!�
��
���
-��������������6
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 7. The vi Editor 7-17
ëë
9�6��
.��
�����
#$������2
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
7-18 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë-�
���O
/��
$��&�
���
�
+=(�������������� ���������������������� ��������������D
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
,=(�������������� ������������������� ��� �D
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
.=(��������������������� ����������������������$�D
� $
/=(����������� ��� ����������������'���������� �������
H�� �H��������������������� ������� �=���������0����D
1= !
������������ ���������������������������������������������������
������������������������������=���������0����D
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 7. The vi Editor 7-19
ëë
.�
��
��(
����������� ��������������@�������� ���
����������� ������������������$��������� ���� �
������ ��� �
����'����������������������������� ���������� ��
������=��������������������������� ������������������
������
-�������� �����������;��D��J���� �����������������
������ ��������������������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
7-20 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 8. Shell BasicsCourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 8. Shell Basics 8-1
ëë
-�
���E
.$
�����
����
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
8-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
����
!��
��������������������������� ��������� ������������
���%
���
����
�������������������������������=
����
��
������
����� ��
��������������������
��
����� �
��
���
��������������=
������
���
��
���
����
������������������ ��������������
������ ����=
3��
��
���
��
��
������� �������������������$������=
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 8. Shell Basics 8-3
ëë
2$
��.
$���
4�
���*
&�$
+�����������)��*����%�)��*
-����
����
�#����������
��
��
��
����
����
����
�
#��������
���
����
����&�
%������������
��"
���
���
"����
"�
�"
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
8-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë:���
�$
���
���
����
��
�����
����
�
:�
���
$�
���
�����������������������������������������
�����������
�����
���
���
��"=
#$�������
S����K����V����T����J����R����D����F����G����>����W����H����E����E
����
����
������������������������������������������� �
����
����
$�#
�� ��� ��
���
$�#
�����
���
���
�=
#$�������
RD
JF
GF
@G
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 8. Shell Basics 8-5
ëë
�$
���
���
��.
��
���
����
��
���
�0����9
��
��
�;
����
����7+
�����+
�����+=,
�����+=.
������
���
����
����
�����
����
(� ��� ��������R
D
B��������������������
$ ls ne?
net new
$ rm ?e?
few net new
!������������������������
$ cp n* /tmp
ne net
new nest
$ qprt *w
new few
$ echo test1*
test1 test1.2 test1.3
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
8-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë�$
���
���
��.
��
���
����
��
���
�0����9
��
��
���������8����F
GJ����F�@�G
$ ls ne[stw]
net new
$ rm [fghjdn]e[tw]
few net new
$ ls *[1-5]
test1 test1.2 test1.3
$ qprt [!tn]*
myfile few
$ cat ?[!y]*[2-5]
test1.2 test1.3
�;
����
����7+
�����+
�����+=,
�����+=.
������
���
����
����
�����
����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 8. Shell Basics 8-7
ëë
2$
��.
���
����
�0����
���� �� ���)7*
���� �� �������),*
���� �� �����)+*
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
8-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2$
�����
�����
���
������������� ���������������������������
�������
0�����
�����
���
��
-��� �� ���
S7
-��� �� �����
K+
-��� �� �������
,K
,
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 8. Shell Basics 8-9
ëë
��
���
7��
������
��
��#�
���
����
��
���
���
��
�
$ mail team01
Subject: Letter
This is a letter.
<ctrl-d>
Cc:
$ _
7��
������
���
���
#��
���
�#���/
C
$ mail team01 < letter
$ _
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
8-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
���
��7
��
������
��
��#�
���
����
��
���
���
���
�/
$ls
file1file2 file3
7��
������
��
���
��#�
��
���#
���/�
�D
$ls >ls.out
$ _
7��
������
�"
���
���
��
��
���
"��
���
���
����
�#��
�/
DD
$ who>> whos.there
$ _
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 8. Shell Basics 8-11
ëë
���
���
�"
���0
����%
��$
����
(��������������� ���������������������������������� �
�������� �����������
������ �����������������
$ ls
letter acctfile file1
$ cat file1
This is a test file.
The file has 2 lines.
$ _
�����
��
������
���
$ cat > newfile
This is line 1 of the file.
This is the 2nd line.
And the last.
<ctrl-d>
$ ls
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
8-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
!��
(/�
7�!��
%�.
$�����
����
�
+=(��������������� ����������������������� �������$����� D
$ ls /home/team01/*.?
$ ls /tmp/[a-zA-Z]*.[0-9]
,= 2
�������
0���
������������ � "ls *"������������������ �������=
.=(���� ������� #
�����
�����
���
������������������������� �
$ wc -l < file1 > /tmp/lines
-��� �� ������
-��� �� ��������
-��� �� �������
/=O���������������� �����������������������������=�(�������� ����������D
�� cat report99 < testfile1
�� cat testfile1 > report99
�� cat testfile1 report99
�� cat testfile1 >> report99
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 8. Shell Basics 8-13
ëë
'��
���
7��
������
��
��#�
���
����
��
���
����
��/
$ cat filea fileb
This is output from filea.
cat: cannot open fileb
7��
������
�"
����
���
��
���
����
���#
���/�
�)D
�*2�
���
���
�/�
)D
D+
$ cat filea fileb 2> errfile
This is output from filea
$ cat errfile
cat: cannot open fileb
$ cat filea fileb 2> /dev/null
This is output from filea
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
8-14 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
��
����
�7��
������
��
��
��
����
����
������
/
$ command > outfile 2> errfile < infile
$ command >> appendfile 2>> errfile < infile
���
���
���
��'
6��
���
�/
��A� ��������� �� �������������� �� �����
$ command > outfile 2>&1
������
-
2�
9/�
������9B������������������
����$ command 2>&1 > outfile
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 8. Shell Basics 8-15
ëë
5��
��
�������������������������������� ���������� ������������������
PQP���
����� ��� �
���=����� �
���
����
���
���
��������������� ������������
���
��
���
���
��
����������$�������� =
$ who | wc -l
4
����������������
$ who > tempfile
$ wc -l tempfile
4tempfile
$ rm tempfile
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
8-16 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë0����
��
��#
����
������������ �������
��
��#
���
����
��
���
�����
����
�#�
�����
$����
��
���������������� �%
����
���
���
���
����
��
��=
#$������
�����������������ls -l | grep "^d" | wc -l
8����������������������
@��$�@$�@$�===����+
��$�@$�@@�===� �+
@��$�@@�@@�===���,
0� ��������������
����������H H�
��$�@$�@@�===� �+
%��������������
) ��������*
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 8. Shell Basics 8-17
ëë
.�
����
��
���
��
����
��������� ���� ������ �� �������� ���� ����� �������
�������� �� ���������� ������=
ls | tee /tmp/ls.save | wc -l
��
%
#�6
�6
F��
�F����
�!�
�
��
%#�
6�
6���
��%
�B�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
8-18 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
��
��
��3
���
���
"
!������������� ��������������� �����������������
�������� ���������@������HTH�
$ ls -R > outfile ; exit
�����������������������
$ ls -R > outfile
$ exit
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 8. Shell Basics 8-19
ëë
��
���
��
���
����
��
������'�����)W*����������� �����
��
���
����
���
��
��
��
����
����
���
������
�=�����
���
��
��(
����
��
���$
���
���
� �HKH�
������ ����������������
��
�����
����
���
��
���
����
��=
$ cat
/home/mydir/mysubdir/mydata\
> /home/yourdir/yoursubdir/yourdata
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
8-20 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë9�6��
.��
�����
'6���
����O
'6���
����O
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 8. Shell Basics 8-21
ëë
-�
���E
/��
$��&�
���
�
+=(
������������������������� �����
�>�����DDDFJ�@&GRF7@5G�
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
,=0������������,@/��� ����������������� �� ����������� �� ���������� �
���� �� �������������=
�>��������+
����+=����� �� ������)7*�
����,=����� �� ��������)+*�
����.=����� �� �������),*�
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
.=�>������������S���������
����+=����� �� ������)7*�
����,=����� �� ��������)+*�
����.=����� �� �������),*�
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
8-22 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë-�
���E
/��
$��&�
���
��*�
��
�+
/=� �>�������=��������K�������������,K+
����+=����� �� ������)7*�
��������,=����� �� ��������)+*�
��������.=����� �� �������),*�
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
0������������1��2��� �3��������������� ��������� ��������������������
#���
��������
����� �������������������������
1=������������������������������ ��� #
������� ������������� #
����=
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
2=������������������������������ ���#
������� ��������������������
�����������������#
����=
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3=�������������������� #
������� � ���� �������������������=�)"�����
� �����������������������������=*
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 8. Shell Basics 8-23
ëë
.�
��
��(
(� ��� ���R��� �D������ �������������������������������
���������������� �������������=
����� ��� ���������F�G����'����������D���������������������
���������������������������������� =
���������������������������� ������� ��������������� �� ����
���� �� �������� ����� �� ������=
�;B��� ����������������� ����������������������������� ���������
����������� =
������������������������������������ � ���������������������
������������� =
����������'����������������� �� �������������������� ���� �����
�������������� �� ����=
������'���������� ����������������������������� �� ������� ������=�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
8-24 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 9. Using Shell VariablesCourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 9. Using Shell Variables 9-1
ëë
-�
���R
-���
"�.
$���
����
��
���
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
9-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��������������������������� ��������� ������������
��
��!���
��
�������� ����������
��
!��
��
���
�
.�����
�#�
���
������ ��
���
����������������
"���������������������������A
��
���
"��
���
�$
���
���
���
��������������H
��������������E
���'������W
���������
��
���
���
��
���
����
��
��
����
!��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 9. Using Shell Variables 9-3
ëë
.$
�����
���
��
���
����
��
�������������� ������������������������
.$
����!
���
��
���� ����������
��
!��
��
���
� �
8�
:'�"��������)�������;���;����7+*
2'
7:���������)���������.+1+*
-�����5
2
8�)�������;���;���;���;����=*
�
���
���
���!���
��
����������� ����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
9-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
���
"��
���
��
���.
���
��"
�
$ set
HOME=/home/team01
PATH=/bin:/usr/bin:/etc:/home/team01/bin:.
PS1=$
PS2=>
SHELL=/usr/bin/ksh
TERM=ibm3151
xy=day
$ _
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 9. Using Shell Variables 9-5
ëë
.���
��"
���
��7
�#�
���
���
"�.
$�����
���
��
���
+=�����
���"
���
�!���
��������������������
������������������� name=value
,=�����
�#�
���
����
�!���
��
��������$��������������@
B��"
��
$xy="hello world"
$echo $xy
hello world
.=�����
���
����
�!���
��
������������
���� �������
$unsetxy
$echo $xy
$ C
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
9-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë.$
�����
���
��
����'
6��
���
$ xy=day
$ echo $xy
day
$ echo Tomorrow is Tues$xy
Tomorrow is Tuesday
$ echo There will be a $xylong meeting
There will be a meeting
$ echo There will be a ${xy}long meeting
There will be a daylong meeting
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 9. Using Shell Variables 9-7
ëë
��
��
��
��.
��
���
����
��
�
����������������������6������NZB�������������%����� Z�
$ date
Wed 12 Jan 11:38:39 2000
$ now=$(date) (or now=`date`)
$ echo $now
Wed 12 Jan 11:38:39 2000
$ users=$(who) (or users=`who`)
$ echo $users
team01 tty0 Sep 12 08:18
team02 tty1 Sep 12 09:00
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
9-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
���
�"
�:���
�$
���
���
��
11�.
��"
����
��
���/
$ echo '$HOME'
$HOME
PP�
��
��
����
��
���/
������������
��� ����� ��
S�
��&���
�$
/
$ echo \$HOME
$HOME
������������������
����������������������
��������
��������������������������
�$���������
��
�����
@<�
���&A
��
����T
���
��
���&���
�$
�S
��������������������������
�����������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 9. Using Shell Variables 9-9
ëë
��
��
��
��
����5
���
��"
$ ls $dir/*.? 2>/dev/null | tee filelist.txt
���7
��
������
���
K��KK��,K��V
)���
��
���
���
��
�!���
��
����
��
���
����
���
>�����>)�� *
����
���
����
��6�
��
���
��
R��D��F�G
,���
��
���
��'
6���
���
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
9-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë9�6��
.��
�����
'6���
����E
'6���
����E
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 9. Using Shell Variables 9-11
ëë
(���������������������������������������� �D�)��������������� ����������
F$�
��F �
$�������������� ���������
�F$
��
�F �
$�
F��
����� ���������������� �
����
��
�� ��
�=*
$ pwd
/home/john/doc
+=>�echo "Home directory is $HOME"
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
,=>�echo 'Home directory is $HOME'
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
-�
���R
/��
$��&�
���
�
���
L��
��; ������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
9-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë.=��>�echo "Current directory is `pwd`"
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
/=��>�echo "Current directory is $(pwd)"
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1=��>�echo "Files in this directory are *"
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
2=��>�echo * $HOME
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3=��>�echo \*
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
-�
���R
/��
$��&�
���
��*�
��
�+
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 9. Using Shell Variables 9-13
ëë
.�
��
��(
����������������������� ���������������������
�� ���������� �������������������������
6��������������������������������������������
��������� ��� ���� �����������
������������������������������������������
������ �
"�����������
)H�H*
-����������)E��E*
���'����
)�W�*
�������������� �������������������������'�������
)ZZ*����>)������ *
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
9-14 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 10. ProcessesCourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 10. Processes 10-1
ëë
-�
����
G
5��
������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
10-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
����
!��
��������������������������� ��������� ������������
"�������������
������
"�����������
���
���
��$
������������
���
����� ��
$����
���
������
%�������� ����'���
$�����
���
���
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 10. Processes 10-3
ëë
�$
���
����
�5��
����I
#����������������������������
����������� @
@����������������� ��������������������
$ echo $$
4712
��� �
�������� ��������������������������
$ ps -u team01
2$
��5
�������'
�!��
��
���
�
5��
"��
�-
����
��
��"
���
����
��
���
5��
�������
�*5
�+
��
��
�#����
5���
���
5��
�������
�*5
5�
+
��
����
���
������
�(5
��"
���
�!�
����
����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
10-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë�
"��
�5��
�����'
�!��
��
���
�
��"
��/
�
�.(���
�
5�
N)G)���B
&�$
������� �
$�
L��E��������� � 6
66666
@�L
'�
!��
��
���
�
�������
F���F
���
F&�$
�
�$
�
�
���
##
����
F��
!F�
�(�
��"
)G
)
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 10. Processes 10-5
ëë
5��
�����'
�!��
��
���
�
�
�.(���
�
$ cat kfile
'�
!��
��
���
���
���
�"
��6���
���
�
�������
F���F
���
F���
�
�$
�
�
���
##
����
F��
!F�
�(�
���
&#�
��
��������
B&�
$
��"
��
G
���"
)G
)
5�
N)G)���B
&�$
5�
N��G����
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
10-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë5���
���
���
���
$���
���
>��echo $$
202
>��ksh
������)%���������������*
>��echo $$
206
>��date
)A����������� *
�����:���/��++�+4�,2��?!���,777
>��<ctrl-d>
)#$������������*
>��echo $$
202
��
�5�
��5
5�
��@'�
�,7,
��+
���'�
�,72
����,7,
����
���
�,74
����,72
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 10. Processes 10-7
ëë
����
��
�����
��
�5��
������
$ x=4
$ ksh
$ echo $x
$ x=1
$ <ctrl-d>
$ echo $x
4
����
��
����������������������������
�!��
��
���
� =�
�����������
��
��
����������
���$
��
"��!
���
��
���������
��������������=
-������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
10-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
!��
(/�
'6�
���
��"
�����
��
���
�������
-���
-������
�$������������N�����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 10. Processes 10-9
ëë
�$
���
����
�.$
����.
���
��I
�� �
$�����
���
������� �
�������
��
��#�
��
��
��
�������� �������$�����=
>�vi hello
echo "Hello, John. Today is: $(date)"
pwd
ls
:wq
$ _
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
10-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë�!�
&��
"�.
$����.
���
���
�*�+
>� cat hello
echo "Hello, John. Today is: $(date)"
*�+
pwd
*)+
ls
*�+
$ ksh hello
Hello, John: Today is: Wed Sep 13 19:34
*�+
/home/john
*)+
books letter1 text2sarah
*�+
.�
��$
���
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 10. Processes 10-11
ëë
�!�
&��
"�.
$����.
���
���
�*)+
����������������5
2
8�������������� ��$�����������������=
>� cat hello
echo "Hello, John. Today is: $(date)"
*�+
pwd
*)+
ls
*�+
$ chmod +x hello
$ hello
Hello, John: Today is: Wed Sep 13 19:34
*�+
/home/john
*)+
books letter1 text2sarah
*�+.�
��$
���
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
10-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë�!�
&��
"�.
$����.
���
���
�*�+
>� cat set_dir
dir1=/tmp
dir2=/usr
$ . set_dir
$ echo $dir1
/tmp
$ echo $dir2
/usr
��*�
��+
/�#$������������������������
(�����������������dir1�� �dir2����
��
�L�
���������� ���������� ���D
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 10. Processes 10-13
ëë
'6��
���
����#
���
���
��
��
��
�������� �������������
6��
�!���
�����������������������
������������������������G
�N�-������
��������������������������B
�)���N��������������������
����������������������@
I�������������$�����������
�������������� �
$ cd /etc/security
ksh: /etc/security: Permission denied
$ echo $?
1
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
10-14 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
!��
(/�
.$
����.
���
���
-����-�����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 10. Processes 10-15
ëë
-�
����
G/�
�$
��&�
���
�
+=(������� ������$��������������������������� ���)=*��������D�
(�D
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
,=(�������������� ���������� ���������� ������������������
����������������������D
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
.=(������� ����������������$��������� ���������������������D
$ ( ... login shell ... )
$ ksh
$ x=50
$ export x
$ <ctrl -d>
$ ( what is the value of x set to now?)
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
10-16 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë.�
��
��(
-���������������������'� �������������
>�'������������
)������������ ���������*
>����������
)������������ ��� ��$�����
�������������*
>�=���������
)������������ ���������*
#��������������������������������
#����������������������������������������������
������������� �����������������������������������
��������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 10. Processes 10-17
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
10-18 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 11. Controlling ProcessesCourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 11. Controlling Processes 11-1
ëë
-�
����
�
��
���
�����
"
5��
������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
11-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
����
!��
��������������������������� ��������� ������������
"��������
��������
��
���
���
"
����'���
��&"
���
��
����
������
2�
����
���
����
������
8������������"
����
�������
�$
���������
��
���
��� �
��������<��������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 11. Controlling Processes 11-3
ëë
:�
���
���
�"
�5��
������
����
�������� � �������������������������������
$ ps -f
UID
PID
PPID ... TTY
... COMMAND
john 202 1 ... tty0 ... -ksh
john 206 202 ... tty0 ... ksh
john 210 206 ... tty0 ... ls -R /
john 212 206 ... tty0 ... ps -f
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
11-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
���
�����
"�5
��������
0�
��"
���
��
�5��
������/
���&"
���
��
�5��
�������*
U+/
&�
$)���*
���B
7
$ ls -R / > bigfile
$ _
&�
$
���B
7
$ ls -R / > bigfile &
$ _
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 11. Controlling Processes 11-5
ëë
2�
����
���
�"
�5��
������
0�
��"
���
��
�5��
������/
���
�B�
����������'�����������������������
���������=
&���
-�����������'��������� ������ ���
������������������� ����������=
���&"
���
��
�5��
������/
&���
���'��������� �����������������
������������'����� ����������=
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
11-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2�
����
���
�"
�5��
�������*
��
��+
���&
���������� ���� ����������������������������������
�������������������������=
$ ps -f
UID PID PPID ... TTY ... COMMAND
john 202 1 ... tty0 ... -ksh
john 204 202 ... tty0 ... db2_start
john 206
202 ... tty0 ... find /
$ kill 204
)����������-����*
$ kill -9 206
)<���-����*
2�
����
���
����9����������������������������������
4����
<���������������� %
��$
��
���
���
#�����
���) ������
����J*
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 11. Controlling Processes 11-7
ëë
.�"
����
.�"
���
:���
��"
7+
������@���������� ������������������������������������
�������������������
7,
���������@����������� �������������)����'*�'������������ �
���B
�
7.
����@����������� ��������'������������ �
���B
S
75
<���������
������������������)�� ���'�*������������������������
-������������������ � ��������� J
+1
����������������)"������*��-�������������
������������������-�������������� �� ������������=�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
11-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë7�
��
��"
� �
�"
�5��
������
����
�$
��������� ���������������������������������
'��� ��������������������������������������������
$ nohup ls -R / > out &
[1]
59
$ _
������� �������� ��������������
�$
�������� ���������������
�������
�$
��
���
��
$ nohup ls -R / &
[1]
61
Sending output to nohup.out
$ _
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 11. Controlling Processes 11-9
ëë
V�
���
��
���
����
��$
��4
���
�.$
���
��
�8��������L���
C���
�BKD�
-����� ���������� ����'
#"�[L��������
#$������L��������������
�"�[L��������
#$������L��������'�����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
11-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëëV�
���
��
���
��'
6��
���
$ ls -R / > out 2> errfile &
[1]
273
$ jobs
[1] +
Running ls -R / > out 2> errfile &
$ _
$ fg %1
ls -R / > out 2> errfile
<ctrl-z>
[1] + Stopped (SIGTSTP) ls -R / > out 2> errfile &
$ _
$ bg %1
$ jobs
[1]
+ Running ls -R / > out 2> errfile &
$ _
$ kill %1
[1]
+ Terminate ls -R / > out 2> errfile &
$ _
-�����L��
8����L���
0��������
-�����
���'�����
��������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 11. Controlling Processes 11-11
ëë
����
��
�
���
���
������������@�� ���������������������������
��������������������������������������=
������
� �����
M����
����+
����,
���=
���=
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
11-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë9�6��
.��
�����
#$������5
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 11. Controlling Processes 11-13
ëë
-�
����
�/�
�$
��&�
���
�
+=(������������� ��������������� �
�������� �����������
����� ������� ��������������������D
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
,=�������������D��������� �����������������������'������������
L������ �����������������������=
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
.=(�������������������������������������������������������
����������D
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
/=����������������������������������L������������'����� �������
��
$�
�������� =��(������D
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1=(�����������������������������@�� ����������������������
��� 9�������������D
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
11-14 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë.�
��
��(
��������������������������� �
��������
���'����� ������������������'� �������� �������������� �U�
�������� �������������
������ &
���������� ����������������������
-��������������������������������������������� &
����
B)��&
����
B��
�� � &
����
BR
:�������������������� ������<������������������ �����L������
C���
��KD��� ��������� ��������� �
"��� �
#"������ �
����
�$
�������� �����������������������L�����������'����� �
�� �������������������������������������
-������������������������� � ������=������������������� ����
��������������������������'���������������������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 11. Controlling Processes 11-15
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
11-16 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 12. Customizing the User EnvironmentCourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 12. Customizing the User Environment 12-1
ëë
-�
����
)
��
���
��K
��"
��$
�
-����
'�
!��
��
���
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
12-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
����
!��
��������������������������� ��������� ������������
"������������������������������
��#�
��
%��������5
2
8��� �5
.����������
�����������
$��
���(��������
-��������������������������� ������� �
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 12. Customizing the User Environment 12-3
ëë
�
"��
�0����
login: team01
team01's Password:
$
;���;����������
;���;������
>IB!#;=������
����
����
���
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
12-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë.��
���
�F���
F��
!��
��
���
�
$ cat /etc/environment
# WARNING:This file is only for establishing environment
# variables. Execution of commands from this file or any
# lines other than specified above may cause failure of the
# initialization process.
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin
TZ=EST5EDT
LANG=C
LOCPATH=/usr/lib/nls/loc
NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 12. Customizing the User Environment 12-5
ëë
.��
���
�F���
F���
#���
$ cat /etc/profile
# System-wide profile. All variables set here may be
# overridden by a user's personal .profile file in their
# $HOME directory. However all commands here will be
# executed at login regardless.
readonly LOGNAME
umask 022
# Automatic logout (after 120 seconds inactive)
TMOUT=120
# The MAILMSG will be printed by the shell every
# MAILCHECK seconds (default 600) if there is mail in the
# MAIL system mailbox.
MAIL=/usr/spool/mail/$LOGNAME
MAILMSG="[YOU HAVE NEW MAIL]"
# Ensure that the TERM variable is set up correctly
TERM=ibm3151
export LOGNAME MAIL MAILMSG TERM TMOUT
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
12-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë'�
!��
��
���
���
���
��
����*
�+
�
39
:
'����� ����������������=��������� ��������������� �=�6�����
��������������� �)��� ������������*=
2:
�-
2I�� ���������������������������������������������������������
��������������� �����������������=
:
I�� ����������������������������������������=
2'
7:
����������������������������=� �� ����������@������ ������������
�'�� !
�����
��
��=�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 12. Customizing the User Environment 12-7
ëë
.��
���
���
��#�
��
$ cat .profile
PATH=/bin:/usr/bin:/etc:$HOME/bin:.
PS1=' $PWD=> '
if[
-s "$MAIL"
]then
echo
"$MAILMSG"
fi
ENV="$HOME/.kshrc"
export PATH PS1 ENV
#$�������������������������
����<����������������� =
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
12-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë'�
!��
��
���
���
���
��
����*
)+
5
28
��������������@�������� � ���������������������������������
������ ��
PATH=/bin:/usr/bin:/etc:$HOME/bin:.
5.
����������������������) ������N�>*=��������������������� ����
�������� ��������������������
PS1="$(hostname), "'$PWD: '
'9
��������������������������<�����������������
ENV="$HOME/.kshrc"
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 12. Customizing the User Environment 12-9
ëë
.��
���
��&�$
��
$ cat .kshrc
# set up the command recall facility
set -o vi
# set up a few aliases
alias l='ls-l'
alias p='ps-f'
alias up='cd
..'
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
12-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë&�$
�0����
����B
�������
$alias p='ps -ef'
$alias l='ls -l'
$alias
history='fc -l'
l='ls -l'
p='ps
-ef'
r='fc
-e-'
-������������ �������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 12. Customizing the User Environment 12-11
ëë
&�$
�0����
����B
�-���
"�
������
$ l
-rw-r--r--1
joe
staff
524
Sep 19
11:31
fleas
-rw-r--r--1
joe
staff
1455
Jan 23
17:18
walrus
$ unalias
l
$l
ksh:
l:not found
������N���@�
A����������� ������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
12-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë&�$
�0����
����B
�8��
���(
8����+,4������� ����������� ������� @
8�
:'
F��$
L$
����
�(
$fc -l
2cd /home/payroll
3ls -l
4mail
5fc -l
$ r m
No mail for team01
$ r 3
-rw-r--r--1
joe
staff
524
Sep 19
11:31
fleas
-rw-r--r--1
joe
staff
1455
Jan 23
17:18
walrus
@�$
����
�(
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 12. Customizing the User Environment 12-13
ëë
9�6��
.��
�����
'6���
�����
G
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
12-14 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��(���������� ������������������&������������
������������D�(�D
��CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
��(��� ����������������������� �������������������D
�-+�
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�#A!�
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
���I�
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
-�
����
)/�
�$
��&�
���
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 12. Customizing the User Environment 12-15
ëë
.�
��
��(
������������������������������������� ��� ���
���L�������������������&����������F���
F���
#���
<�F�
��F�
�!��
��
���
�<�@
8�
:'
F��
��#�
��� ��
�@8
�:
'F�&�$
��
�������������������������������� ������������
��� ������������������������� �
���������������������������� ������������������������
������ �
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
12-16 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 13. AIX UtilitiesCourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 13. AIX Utilities 13-1
ëë
-�
����
�
�
�-��
����
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
13-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
����
!��
��������������������������� ��������� ������������
������#
���������� ���������� ���������������������
����������������������
������"
���
������� ������������$�������������������
������$
���
� ��
������������ �������������������������
���
�������
���������� ��������������������������������
����
�������
����
�����
��%
�������
���
�� ���� ��
��#�
�����
������ ����������������������������%@"B-�����������
�������
���� �#
��������� ������������������������
����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 13. AIX Utilities 13-3
ëë
#��
�
.����
$������������� �������������������#
���
#���
���
$���
�����
����
���
���
���#
���
����
����
�
���
���
(��
$���
��
���������������������
�6
��
���
���
��
��
�������������������
�������������������find path expression
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
13-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë.��
���
����
����
�(�.
���
���
��
fleas
misc
phone1
phone2
child
large
medium
small
sync
size
blue
brown
green
sum
white
yellow
color
misc
oval
round
sphere
sum
sync
shape
joe
home
F
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 13. AIX Utilities 13-5
ëë
-���
"�#
���
-������� �������������������������������������������
$ find . -name sum
./color/sum
./shape/sum
B������� 9�������������������������B
���
���
$ find . -name sum -print
./color/sum
./shape/sum
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
13-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë�������
6����������$��������������� �����������������������
$ find . -name 'm*' -exec ls -l {} \;
-rw-r--r-- 1 joe staff 83 Jan 11 15:55 ./shape/misc
-rw-r--r-- 1 joe staff 21 Jan 11 16:01 ./size/medium
-rw-r--r-- 1 joe staff 38 Jan 11 15:34 ./misc
'6���
���
"��
��
���
���%
��$
�#��
�
!���� �
��������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 13. AIX Utilities 13-7
ëë
���
�����
!���
��
���
���'
6���
���
�
����
&���������������
��
���
���
6�
��
���
����������
����
���
!������
$ find . -name m\* -ok rm {} \;
<rm ... ./shape/misc>? y
<rm ... ./size/medium>? y
<rm ... ./misc >? n
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
13-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë�
���
���
����
���
��
�
B�(�
����
�� ��������
���
� �������
B��K
������
X�
�����������H�H�����'�
��������������
@�������
������������H�H�����'�
������������
���������
���������H�H�����'�
B���
���
X$�����
�� �� ����������H$H� �������
�������������
@$������
�� �� ����������H$H� �������
B�������
������
����������������������H����H
������������
�� ���
����������������������H�� �H��������)�$=���$*
B�������
��������
�� ����������� ����H����H
B����������������������
�������H��H
B��%
��������=���
������������������������������������������������
���=�)���������������������������*��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 13. AIX Utilities 13-9
ëë
#��
��'
6��
���
�
$ find . -name 's*' -type f -size +2 -exec ls -l {} \;
-rwxr-xr-x 1 joe staff 1512 Jan 11 15:43 ./color/sum
-rwxr-xr-x 1 joe staff 2148 Jan 11 15:57 ./shape/sum
$ find . -perm 644 -mtime +4 -print
./shape/misc
$ find . -name fleas -o -name misc
./misc
./shape/misc
./fleas
$ find / -name 'security' -print 2> errfile
/var/security
/usr/lpp/bos.sysmgt/inst_root/var/security
/usr/lib/security
/etc/security
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
13-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë9�6��
.��
�����
'6���
����
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 13. AIX Utilities 13-11
ëë
"��
�
.����
$����������������������� ��
���
���
grep [options] pattern [file1 file2 ...]
-�����
��$�
A�������
�$�������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
13-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë"��
��.
��
���
�����
�0����
�$
��
��/
As of: 1/31/2000
Anatole 389-8200
Avis Betty 817 422-8345
Baker John 656-4333
Computer Room CE phone 689-5790
Dade Travel Sue 422-5690
Hotline HW 800 322-4500
�$
��
�)/
As of: 2/15/2000
Anatole 389-8200
Avis Betty 817 422-8345
Baker John 656-4333
Computer Room CE phone 592-5712
Dade Travel Sue 422-5690
Hotline HW 800 322-4500
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 13. AIX Utilities 13-13
ëë
�����
�"��
�
$ grep 800 phone1
Hotline HW 800 322-4500
$ grep 800 phone*
phone1:Hotline HW 800 322-4500
phone2:Hotline HW 800 322-4500
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
13-14 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë"��
��%
��$
�7�"
���
��'
6�
������
��
�����������������grep 'regular_expression' file
6�� ���������������
���������������������
���
"��
��$
���
���
�
R����������������W
�������
��
��������������������� �
�����
��"
��$
���
���
�
=�
?�#����������������
=�B#
?��������������B9#���������������������� �
��
"������
������
�#
X�
��������������������������
���
��������
K@��������������������������
��
�������&��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 13. AIX Utilities 13-15
ëë
"��
��'
6��
���
�
$ ps -ef | grep team01
team01 10524 13126 0 09:27:45 pts/1 0:00 -ksh
$ grep '^B' phone1
Baker John 656-4333
$ grep '5$' phone1
Avis Betty 817 422-8345
$ grep '^[DH]' phone1
Dade Travel Sue 422-5690
Hotline HW 800 322-4500
$ grep '^A.*0$' phone1
As of: 1/31/2000
Anatole 389-8200
\��-����
>��#�
F"IG��#���������
=R��]���������������������������������������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
13-16 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë"��
���
���
��
�
B!����������������������
��
���
���
���
$
B����������������������
��
�����������������
B������������������������
��
����������������������������
B����������
��
������������������
B�����������"
��
����
$���
���������������������'�������������
B%������� ����%
$�
���%
���������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 13. AIX Utilities 13-17
ëë
��$
���
"��
��
#"��
�
$ fgrep 'HW' phone1
Hotline HW 800 322-4500
�"
���
$ egrep '800|817' phone1
Avis Betty 817 422-8345
Hotline HW 800 322-4500
�����������B�����$� ���������������������$��������
#$��� � ����������������������������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
13-18 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
!��
(/�
"��
���
��
���
�
"��
��I
II
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 13. AIX Utilities 13-19
ëë
��
����
��
���
�
����
���
������� �������������� ��������������������
���� �� ��������
��$ sort [-t delimiter][+field[.column]][options]
B������
B����������� ���������� ��=��B������������� ����
���� ���������������� ��� �������������=
B����������������� ��������������� �����
B������������������� �����������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
13-20 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
���'
6��
���
�
$ cat animals
dog.2
cat.4
elephant.10
rabbit.7
$ sort animals
cat.4
dog.2
elephant.10
rabbit.7
$ cat animals | sort +0.1
rabbit.7
cat.4
elephant.10
dog.2
$ cat animals | sort -t. -n +1
dog.2
cat.4
rabbit.7
elephant.10
"�������������� ��
-������������ ���������
��@���"�������H�H
��@���9���������� ��
��X+��-���� ����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 13. AIX Utilities 13-21
ëë
$���
���
���
�����
��
���
��
���$
��������� ����������� �����������#
�����
#�%
����
�������������������=�
������������������������ head [-number_of_lines] file(s)
$ head -5 myfile
$ ls -l | head -12
��� �
���������� �������������������� �� ����������
�"
���
��"
����
���
����#
���
��
���
�=
tail [-number_of_lines | +starting_line_number] file(s)
$ tail -20 file
$ tail +20 file
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
13-22 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2��
��#�
����
"��
�.
�����
�0����
$ dosdir -l
��
�������������������"B-� �'����
$ dosread file1.doc file1
��
�(��
�#��������� �'����� �
��
�
$ doswrite file1 file1.doc
��
�(��
�#������������� �
���
���
.� �'����
$ dosread -a letter.txt letter
$ doswrite -a letter letter.txt
��
�!�������������$���������"B-��������
�����"B-���$�������������������
$ dosdelete filez
����
����������������"B-� �'����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 13. AIX Utilities 13-23
ëë
��/�
�
"��
���
�7��
���
�8�
���
�������
�@������ �����������������������
#$������
����� �� �
�������
���� ������������
�������������
������������������������������� !"#�� $
%����&���� ��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
13-24 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë#��
/�2
���
�#�
��0
������
��%
���
�8�
���
������#
��@������ ������������������������������
#$������
������ �� �
���� ������������
""'�(�)����*��������
+����������&�����'��&��� ��
)���,������-.�����/�������'�
)���,���&�
"0'�1��������'��%��������
���2
���@�������������������������� �
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 13. AIX Utilities 13-25
ëë
/��2
���
/��2
����� ������
/��2
���
����
�����
/��2
������ ��� ����!"���� ���#
/��2
�$��"���� ���!�� ��� ���#
/��2
�����!�$%�� ���#
/��2
&$��
�����������������#�
����������� ������
#��
�.�
���
��
��
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
13-26 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë����)�����������*�������������
���
���!
��(��� ������������
����
����
��$
�!��#
���=
� ��
����3 */�4��*4���'�
����3 */�4��*4/�'�
����3 */�4���4/�%�����
� ��
����35*/�4��*4���'�
����35*/�4��*4/�'�
����3 */�4���4/�%�����
����35*/�4���4/�%����
����������������������������������
����3�*/�4��*4���'����������4��*4/�'�
���/
����&�
���
��
�7����
���0
����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 13. AIX Utilities 13-27
ëë
9�6��
.��
�����
'6���
����
�)
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
13-28 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë-�
����
�/�
�$
��&�
���
�
+=(�������� )�*����� ��������������������������������������
�����������������������������H���HD
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
,=(����������������������� � ���D
$ ps -ef | grep -w root | grep -w netscape
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
.=�� ��������������������������� ��� ����
$ ls -l /home | egrep 'txt$ | team01$' | sort -r +7 | tail +4 | head -5
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 13. AIX Utilities 13-29
ëë
.�
��
��(
������������������ ����������� ��� �
���#
���������� ������ ���������������������
�������������������������������������������
���"
���������� ������ ����������������������
����������������������������
���$
������ ��
���������� ��������� ���������������
������������
����
���
������� �����������������������������������
�������������
0�����������"B-���������������������������� �������
����������������������� ����
����
��
<��
��%
����� �� �
��
��
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
13-30 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 14. AIX Utilities Part IICourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 14. AIX Utilities Part II 14-1
ëë
-�
����
,
�
�-��
����
���5
���
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
14-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
����
!��
��������������������������� ��������� ������������
������6
��"
��������
������B
���
&�����������#
���
��
�%$
��$��%
$���
����� �%
$��
��������� �
"������������
(�
���
#���#
������������#
����������
����
�##�
���
���� ��
����
�������������������� �
��������
��
��
�����#
������������������
"�������
��
B���
���
����������������������� � ��������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 14. AIX Utilities Part II 14-3
ëë
6��"
�
A�� ����"
���
���
#���"
��
��
���#
���
����
����������������
������ ���������������������������
$ cat oldfilelist
file1
file2
file3
file4
$ cat oldfilelist | xargs -t rm
rm file1 file2 file3 file4
file1 file2 file3 file4
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
14-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë6��"
��'
6��
���
�
$ ls > printlist
$ vi printlist
file1
file2
file3
...
file10
$ xargs -t qprt < printlist
qprt file1 file2 file3 file4 file5 ... file10
$ ls | xargs -t -I {} mv {} {}.old
mv apple apple.old
mv banana banana.old
mv carrot carrot.old
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 14. AIX Utilities Part II 14-5
ëë
6��"
�<�#�
��
<�"
���
$ find . -type f -mtime +30 | xargs -t rm
rm ./file1 ./file2 ./file3 ./file4
$ find . -type f | xargs -t grep -l Hello
grep -l Hello ./file5 ./file7 ./file10
./file7
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
14-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë-��������-������������������ ���������� ��������������������
����
$ ls c*
c1 c2
$ find . -name 'c*'
./c1
./c2
./dir1/c3
./dir1/c4
./dir1/dir2/c5
./dir1/dir2/c6
2$
��.
$����!
���
���#
���
;
���
����7+ �+ �,
��
�)
��
�,
��
�M
-�����$��� ���� ���
�� ��$��� ���� ���
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 14. AIX Utilities Part II 14-7
ëë
2$
��B
���
&���
���
��
�%��
$�#
���
$ find /home -type f -links +1 | xargs ls -li
.��
���B�
��
��
9�
��
���
�#�
���
&�
.��
���
��
����
�#�
�(��
�
�)
O
�)
O
�)
O
@��@�@@�@@
@��@�@@�@@
@��@�@@�@@
� � �
����7+
����7+
����7+
�����
�����
�����
+12
+12
+12
:����,2�+.�++�;���;����7+;�����
:����,2�+.�++�;���;����7+;�������
:����,2�+.�++�;���;����7,;�'����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
14-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë�������
��
�#��
�
$ cat $HOME/.kshrc
alias mylinks='find . -type f -links +1 | xargs ls -li'
alias myrm='find . -type f -mtime +30 | xargs rm'
$ mylinks
127 -rw-r--r-- 3 team01 staff ... /home/team01/myfile
127 -rw-r--r-- 3 team01 staff ... /home/team01/yourfile
127 -rw-r--r-- 3 team01 staff ... /home/team02/akafile
$ myrm
ENV=$HOME/.kshrc
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 14. AIX Utilities Part II 14-9
ëë
%$
��$
<�%
$���
��<�%
$��
��
$ which find grep
/usr/bin/find
/usr/bin/grep
$ whereis find grep
find: /usr/bin/find
grep: /usr/bin/grep
$ whence find grep
/usr/bin/find
/usr/bin/grep
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
14-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë#��� $ file /usr/bin/vi
/usr/bin/vi:executable (RISC System/6000) or object module
$ file c1
c1: ascii text
$ file /usr/bin
/usr/bin: directory
$ ls > filenames
$ cat filenames
c1
dir1
$ file -f filenames
c1: ascii text
dir1: directory
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 14. AIX Utilities Part II 14-11
ëë
9�6��
.��
�����
���������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
14-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��#
#�*�
�##�
���
�����0
�����
��
����
���+
�����&�����$������
A�����������
�##�
���
��
��������������
� diff [-options] file1 file2
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 14. AIX Utilities Part II 14-13
ëë
��
��
���
�"
�2%
��0
�����-
���
"��
�##
$ diff names names.old
1c1
< Carol
----
> Caroline
4d3
< Don
5a5
> Sam
����
�
���
:�
��
�
!���
����
���
�
���
:�
!���
.��
������
���)S*
�����=�� �
�����)K*
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
14-14 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
��
���
�"
�2%
��0
�����-
���
"��
��
$ cmp names names.old
names names.old differ: byte 6, line 1
$ cmp -l names names.old
6 12 151
7 102 156
8 157 145
...
...
...
cmp: EOF on names
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 14. AIX Utilities Part II 14-15
ëë
��
��
���
�"
����
����
�����-
���
"��
����
�
$ dircmp -d /home/team01 /home/team02
Fri Jan 21 10:31:10 CDT 2000 /home/team01 only and /home/team02 only
./dir1 ./b1
./dir1/c3
./dir1/c4
./dir1/dir2
./dir1/dir2/c5
./dir1/dir2/c6
Fri Jan 21 10:31:10 CDT 2000 Comparison of /home/team01 and /home/team02
directory .
same ./.profile
different ./.sh_history
different ./c1
same ./c2
Fri Jan 21 10:31:10 CDT 2000 diff of ./c1 in /home/team01 and /home/team02
1c1
< Now is the time for all good men
---
> Now is the time for all good women
+��8���������
��A
���������� �������
,��8����������� ��
��
�����������
.��"������
��#
#���
��������������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
14-16 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëëF$�
��F�
���
G�
=������
=�C�����
�+
�,
�.
�/
�1
�2
�+
�,
F$�
��F�
���
G)
=������
=�C�����
�+
�+
�,
-������"��������-���������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 14. AIX Utilities Part II 14-17
ëë
��
��
����<��
���
��
����<�K���
$ ls -l file1
-rw-r--r-- 1 team01 staff 13383 July 26 10:10 file1
$ compress -v file1
file1: Compression 56.99% file1 is replaced with file1.Z
$ ls -l file1.Z
-rw-r--r-- 1 team01 staff 5756 July 26 10:10 file1.Z
$ zcat file1.Z
(output is the normal output of the uncompressed file)
$ uncompress file1.Z
$ ls -l file1
-rw-r--r-- 1 team01 staff 13383 July 26 10:10 file1
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
14-18 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
���
(��
"�9
��
B5��
���
���
��$
���
���
�����
�0����
$ cat myfile
This
file
has
tabs
and spaces and ends with
a return
$ cat -vte myfile
This^Ifile^G has tabs^Iand spaces and^Iends with a^Ireturn$
-v:
Display non-printing characters as visible characters
-t:
Display tab characters as ^I
-e:
Display a $ at the end of each line
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 14. AIX Utilities Part II 14-19
ëë
$ ls
greatfile myfile
$ rm greatfile
No such file
$ ls | cat -vt
^Ggreatfile
myfile
1. rm ^Ggreatfile
2. mv ^Ggreatfile greatfile
3. ls -i
130 ^Ggreatfile 127 myfile
find . -inum 130 -exec rm {} \;
9�
�B5
���
���
����
$���
���
�����
����
����
����
2�
�#�6
��$
���#
���<��
����
����
#��$
���
�$��
���
��$
��
��;
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
14-20 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���"
���
"�-
��A
���0
����9
��
��
$ touch myfile$$
$ ls
myfile1288
$ date
Mon Feb 14 07:20:15 CDT 2001
$ date + '%m%d%H%M%S'
0214072015
$ touch myfile.$(date +'%m%d')
$ ls
myfile.0214
����� �������������"��@@
����� ���� �����������
������ �����������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 14. AIX Utilities Part II 14-21
ëë
9�6��
.��
�����
����������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
14-22 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë-�
����
,/�
�$
��&�
���
�
+=�������������D�#
���
1�������������������������������������������������
���������������������������=
,=�������������D�(�������� ���������������������� ����#
��������
���������������$��� ������ ��� ���������������������#
���=
.=(�������� ������ ���� ������������������� �����������D
��*����
��*� ��
��*����
� *� ����
/=�������������D��
�##������������$�����������=
1=�������������D�����
��
���
��������� ����� �����������������
������������� �������������������������� ��������������������
������K��$������=
2=��� ���������@������������������������������ �������������
�*����@�
�*�����@���
�*� ���@�
*����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 14. AIX Utilities Part II 14-23
ëë
6��"
����� ����������������������������������-;���� �
������������������������������������������������� ����
B���
&�����������������������������'������������ ��������
%$
��$
<�%
$�
������� �%
$�
��
��������� �������������������
��#
#�������������������������������$������
��
���������������������������������������������������
���
��
������� ������������������������������� ��������
��
��
���������������� ����������������8�����@]����� ��
��
��B!
������� ���������@������������������������������
�������
.�
��
��(
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
14-24 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 15. Additional Shell FeaturesCourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 15. Additional Shell Features 15-1
ëë
-�
����
�
�
���
���
���
.$
����
0����
���
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
15-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
����
!��
��������������������������� ��������� ������������
������
����
���
����
���
����
�����������������
�������
��
��������
�������#����������
������������
����
���
!���
$�����
���
���
������������
��
������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 15. Additional Shell Features 15-3
ëë
��
���
��
��.
$�����
���
��
���
@@
���������"�)��"*
@G
-��������������
@H
9������������������������ �����������������
@Y
���������� �������������������� ������������
@I
#$�������������������������
@;
���������"������������'����� ��������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
15-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë5�
���
���
���5
���
����
��
5���
����
��������������� ��������������������
�"�
���
������
��������� �����
��������������$1, $2, ... $9
${10}, ${11}, ... ${n}
(Korn Shell only)
$ cat ascript
echo First Parameter entered was $1
echo Second Parameter entered was $2
echo Third Parameter entered was $3
$ ascript Good Day Sydney
First Parameter entered was Good
Second Parameter entered was Day
Third Parameter entered was Sydney
>7
>+
>,
>.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 15. Additional Shell Features 15-5
ëë
2$
���
6�
��-
�����(
�������
6�
���������������������������������
�6�
� ���������������������
����
�����
\* multiplication
/ integer division
% remainder
+ addition
- subtraction (also unary minus sign)
�
���
�����������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
15-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë�6�
��'
6��
���
�
$ var1=6
$ var2=3
$ expr $var1 / $var2
2 $ expr $var1 - $var2
3 NK� ���\( \)����������$���������
$ expr \( $var1 + $var2 \) \* 5
45
NK� ��������� �������������������������������������������
$ var3=$(expr $var1 / $var2)
$ echo $var3
2
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 15. Additional Shell Features 15-7
ëë
��
��
����
����'
6���
���
�
����
6��
�!���
��������������� ������������������� ��
���������� ���� ��������%
$��$
���
����
���
$���
�6��
��
��
��
��
�������������������� +�UU������� ,
�������������������������� ������ �����������������
������������� $ ls s* && rm s*
������������������� +�VV������� ,
���������������������������������
������ �����������������
$ cd /dir1 || echo Cannot change to /dir1
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
15-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë�����
��
��
��
�
��
������������ ���������������������������������� ����
test expression�����[ expression ] �� [[ expression ]]
��
������������ ���������������$���������� ����������
�������
#���
�=
��
���
���/
7���
�����
���<��#
/
$string1 = $string2
-���������������
$string1 != $string2
-�������������������
$number1 -eq $number2
9����������������
$number1 -ne $number2
9��������������������
-a $file
0����$���
-d $file
0������� �������
-r $file
0�������� ����
-w $file
0������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 15. Additional Shell Features 15-9
ëë
�#��
��
���
�
�#'�������������
�$�� '��� ��������������'���
���
�'��� ����������*�������+���'���
#�^,����*
$ cat active
USAGE="$0: userid"
if [[ $# -ne 1 ]]
then
echo "Proper Usage: $USAGE"
exit 1
fi
if who | grep $1 > /dev/null
then
echo "$1 is active"
else
echo "$1 is not active"
fi
exit 0
$ cat check_user
USAGE="$0 username"
if [[ $# -ne 1 ]]
then
echo "Proper usage: $USAGE"
exit 2
fi
grep $1 /etc/passwd >/dev/null
if [[ $? -eq 0 ]]
then
echo "$1 is a valid user"
exit 0
else
echo "$1 is not a valid user"
exit 1
fi
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
15-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
!��
(/�
���
���
"�.
$����.
���
���
� ����>7���>+
�����$���������@��
���������@����
���������������������>D
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 15. Additional Shell Features 15-11
ëë
����
���
��
��
�
��� �
��
�������� ���� ������������������� �� �������� ��������
�������������������� ������������������=
$ cat delfile
# Usage: delfile
echo "Please enter the file name:"
read name
if [[ -f $name ]]
then
rm $name
else
echo "Error: $name is not an ordinary file"
fi
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
15-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë#���
�
��
�.(�
��6
#�������������
�������
��
������������������� )�*�
��
��
$ cat count
for var in file1 file2 file3
do wc -l $var
done
$ count
18 file1
20 file2
12 file3
$ cat rm_tmp
for file in /tmp/*
do echo "Removing $file"
rm $file
done
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 15. Additional Shell Features 15-13
ëë
%$
����
��
��.
(�
��6
%$
�����$�������
��
����
�������� )�*
��
��
$ cat information
x=1
while [[ $x -lt 9 ]]
do echo "It is now $(date)"
echo "There are $(ps -e | wc -l) processes running"
echo "There are $(who | wc -l) users logged in"
x=$(expr $x + 1)
sleep 600
done
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
15-14 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
��
��
��.
����
$��
����
7�
��
�!�
�
����%
���
�����
���
����B
��
��
��
��
�0
��
���
��
�5
28
!�
���
���
��
���#�
��
���$
���
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 15. Additional Shell Features 15-15
ëë
.��
���
���
��#�
��
PATH=/bin:/usr/bin:/etc:$HOME/bin:.
PS1='$PWD => '
ENV=$HOME/.kshrc
if [ -s "$MAIL" ]
then
fi
echo "Enter Terminal Type (Default:ibm3151):\c"
read a
if [ -n "$a" ]
then
TERM=$a
else
TERM=ibm3151
fi
echo "It is now $(date) "
echo "There are $(ps -e | wc -l) processes running"
echo "There are $(who | wc -l) users logged in"
export PATH ENV TERM PS1
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
15-16 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë9�6��
.��
�����
#$������+1
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 15. Additional Shell Features 15-17
ëë
-�
����
�/�
�$
��&�
���
�
+=(����������������������������� �� �D
TERMTYPE=$TERM
if [ $TERMTYPE != "" ]
then
if [ -f /home/team01/customized_script ]
then
/home/team01/customized_script
else
echo No customized script available !
fi
else
echo You do not have a TERM variable set !
fiCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
,=(���������������������������������������������������=
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
15-18 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë.�
��
��(
5�
���
���
����
���
����
���������� ����������������������
������ ��������������
��������������������������� ��������
��
�������� �����
������ =��������������������� ��������
#��������������
������������������������������� �������������� ������
�$�����������������
����
��
�������� ����������� �����������������������
������
���%
$���������� ������ ������������������������
��� ��������
���#
��������� �������������������������������� ����
�$� ���������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 15. Additional Shell Features 15-19
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
15-20 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 16. AIXwindows ConceptsCourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 16. AIXwindows Concepts 16-1
ëë
-�
����
M
�
%��
��
%�
��
����
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
16-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
����
!��
��������������������������� ��������� ������������
8�������
�!��
��"
�������������� ��������������
#$������������� �����
����
�F���!
���
��
���
.��
�������� ������ ��
���
�������������
!��������&�����$�&������&���� ������������� ���
-���������
�6��
����� ��
���
���
(��
��
���
������
�����������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 16. AIXwindows Concepts 16-3
ëë
2$
��'
!�
����
��
��#�
���
���
�%
�REO���REE���RER���RRG���RR����RR)���RRM�����
���
��
��
����
�
�.
0
��
.'
�++A+
�++A,�++A.
�++A/�++A1
!����+=7!����+=+!����+=,
%"#�+=7
�++A2=+
!����,=+
����� �������� �����(� ����!������ �%"#
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
16-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë�$
���
���
�%
���
�%
�I
����� ��������!E���
�$
��
���
��
������
����
��
%��� �
:�
��#
����� ������������������%
��&
�%��
$��
���
����
����
���
�������������
5��
!��
���%
���
�%
�#�
����
��
�������������������&���
�� ������
���� �������������������
��
�"
����
������ ��
��
���
��
���
��(�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 16. AIXwindows Concepts 16-5
ëë
�
����
���
�%
�9��%
��&
���
�#�
"�
����
��
9�
�%�
�&�
���
��&
���
���
����� �0���-������
I�������������#���������
���
����
�F.
��!
���#���������
�@-����� A-;2777�(��'
-�����
A�-%�(��'
-�����
A-;2777�(��'
-�����
A-;2777�-�����
�������%
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
16-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2$
���
����
�F.
��!
���
'�
!��
��
���
�
*.(���
��
+
*.(���
���
+
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 16. AIXwindows Concepts 16-7
ëë
���
����
��
���
����
�����������
��
������
��
�������������������� ���
������� ����������
#$���������$������$������$����'��$������$� �����
���
����
���������������� ����������
��
���
�����
����������
����������
���
��#
����
!����������������������
��
���
���
��
��
B�"
���
���
%�������������� ������'�����
B��
���
���
%�������������� ������ ��
B�%
���
��
��
( �����$����������� ������ ��
B���
���
(�$
����
��
�/�
��
���� ������������������������� ���-������ ������������
B#"
���
���
%�������������� ������������
B#�
�#�
��
9�������&� ���$���������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
16-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2$
���
�.��!
��
#�����-������
%������������&
�(�
�����������
��
����� �������������
����
��
�
��������
���
����
��
����
�����������������������
����������
����
�"��
�$
����
����
���
��
���� ��������������������#
��
����� ��
���
��
A������&
�(�
����
���
���
��
�����
��
���������
���
��
�������
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 16. AIXwindows Concepts 16-9
ëë
.��
����
"�
�%
���
�%
$ startx
#$���<Ctrl><Alt><Backspace>
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
16-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
!��
(/�
�
%��
��
%���
��
���
��
$�����D�
+=�(�������� ��������
�%
���
�%
���� �����
�.��!
������������� �
���D
�����CCCCCCCCCCCCC
,=�%�������������������������� ������������� 6
���������� �
��
����� �
����
����$ xterm -______ _____:_
.=�(���
�!��
��
���
��!���
��
�������� ����
���
����
���������������������� D
�����CCCCCCCCCCCCCC�
����
/=����������������������������������6
���������������
��
�������
����
6�������
��������������$����� �������������������=
1=�����
����
6������� �����=�(������ �����������������������������D
�����CCCCCCCCCCCCCC
��-�����
7
����
����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 16. AIXwindows Concepts 16-11
ëë
�
��
%��
��
%���
���
��(
�$������� ���
$����' $����
������� ��
����� ��� ��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
16-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
���
0�
��
�
�������
��
�����������������
���
!��%
���
�%�)�������*
B���������� ������������
��
���
#���
��)�������� ��*
���������������
�'6�
�������%��'��
���
!��%
���
�%������#�
���
����������
�5�
����
�������������� ���������
��
���
�$���
���
���
%���������
�#�
���
�#�
��
���
����(���@
8�
:'
F��
��#�
���
�/
Mwm*keyboardFocusPolicy: pointer
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 16. AIXwindows Concepts 16-13
ëë
2$
��:
��
���5
���
����
��
��
�����
��
���
���
�
:�
��������������������������������
���
���
5�
����
������� ���
� ����
!���
����
��
��$
��
"��%
���
�%
�#�
��
�
�
����
��
���
���
�� ��������������&
�(�
����
���
��
������������
!�����������
8�������%�����
�
��
> >�C
� �
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
16-14 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2$
��:
���
#��
���
�%
�0��
��
!��&�
)�����*
!�$�&�
��������
(� ��
!���
A������
�����X01
!���
�����X03
-&�
�����X04
!��&������X05
!�$�&������X0+7
8����
�����X0.
%����
�����X0/
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 16. AIXwindows Concepts 16-15
ëë
�����
���N����������������������������������� ��
���
��
���
�����&��
"���������������������������� ��
��
��
9�
�����K��
����
��
%�
��
�#��
���
���
�%
%��'���� �
����
�K��
��
���
��������������
�� ��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
16-16 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2$
���
�6��
����
���
�%
����
�6��
���������������� ������������
����������������������������� �aixterm &
�"���������Root Menu �� ��������New Window
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 16. AIXwindows Concepts 16-17
ëë
��6
����
���
��
��
��
�����
���
��
�
�������������$������������������������������������������
��� ��
��
���
�����
���
���
��
��
aixterm -display SYSTEMB:0 &
aixterm -bg red -fg white -fn rom10 -geometry 80x40+0+0 &
aixterm -T PAYROLL &
aixterm -sb -leftscroll &
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
16-18 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2$
���
��
���
���
�%
A����!���
9���(� ��
%�����
%�����
A�����
���'������
A�������===
#� �-�����
� �
%��'���� �
�"$
���
��
���������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 16. AIXwindows Concepts 16-19
ëë
7�
��
��"
����
����
���
��
��
�$���
.(���
�
$ rexec sys2 aixterm -display sys1:0
�(��
�$�����@ ���������+�7
�(�)
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
16-20 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2$
��6
$�
���
��
��
��
�
���6
$�
�� ������� ��
��
���� ��
���
����������������������
��������������������-������
�����
����
��
�����
��
��
����������� xhost [ + | - ] [ hostname ]
$ xhost + moon
$ xhost - pluto
$ xhost +
��������������������
��������
"�������������������
��������
������������������
��������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 16. AIXwindows Concepts 16-21
ëë
9�6��
.��
�����
#������+2
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
16-22 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë-�
����
M/�
�$
��&�
���
�
+=��������������� ������������� ������������������� � �D�
xclock -bg red -fg white &
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
,=8����������������������������������=
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
.=��������������������������)��9���O��'*��� ��������)��"�����*=�
(������� ���������������������������������� ���������� �
������������� ������������������������D�
�rexec nysys xclock -d dalsys:0
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
/=(��������������������������&������������ ����
����������D
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 16. AIXwindows Concepts 16-23
ëë
.�
��
��(
����� ���������E���� �����������=��������� �����
(� �����!������ �%"#
������������������������������ �����������������
���������������������������� ��������������� �����
-���������� �������������
����
6�������
�������� ����������������&�����$�&������&��
�� ��������� ���
������"�-�8�O���������������@ ���������������
��������������������������������� �������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
16-24 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 17. Customizing AIXwindowsCourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 17. Customizing AIXwindows 17-1
ëë
-�
����
O
��
���
��K
��"
�
%��
��
%�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
17-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
����
!��
��������������������������� ��������� ������������
#$����������������������
�%
���
�%
��.
����
��
�#������
=$������=� ���������=�����
����������� �����
��
������������������&��������E��
����� ��E������������
������6
��
���
��������� ����������&������
��
��%
���
�%
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 17. Customizing AIXwindows 17-3
ëë
�
%��
��
%��.
����
��
��!��!
��%
$ startx
)$��*
�6��
����
�%
�
���
�#�
���
�
��%
���
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
17-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë�6��
����
===
#***********************************************************
# start xclock then sleep 1 to make sure it can get started.
#***********************************************************
xclock -geometry -0+0 -fg AntiqueWhite1 -bg grey60 -update 1&
sleep 1 �������������������������������������������
===
#**********************************************************
#
# Start the X clients. Change the following lines to
# whatever command(s) you desire!
# The default clients are an analog clock (xclock), a
# terminal emulator (aixterm), and the Motif Window
# Manager (mwm).
#
#**********************************************************
xsetroot -solid grey60
aixterm =80x25+0-0 &
exec mwm
$����'
�$����
!����(� ���
!������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 17. Customizing AIXwindows 17-5
ëë
3��
����
(�.
����#
�����
��
��#
���
�����
��
�
��
> >
� �
X7X7
@7X7
X7@7
@7@7
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
17-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2$
���
���
���
���
����
������
�F�
��F
���
F��
�F�
"�
��6
�������������������!
���
���
���
���
112 219 147
aquamarine
50 204 153
medium aquamarine
50 204 153
MediumAquamarine
0 0 0
black
0 0 255
blue
95 159 159
cadet blue
95 159 159
CadetBlue
��
���.
��!
������ ����� �
���
���
���
�������� ������
���!
��%��� ��
���
������ ��������������������� �
$ custom -e color
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 17. Customizing AIXwindows 17-7
ëë
0�
���
0�������������� ������ ��������F�
��F
���
F���F#
��
��
������
�������
$��#
��
������������������������� ����
$ custom -e font
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
17-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
�#�
���
�
������ ����
��
�#�
���
������
����
��K
������������ ���
$ vi $HOME/.Xdefaults
Aixterm*background:
grey
Aixterm*foreground:
navy
Aixterm*font:
rom10
xclock*update:
1
Mwm*keyboardFocusPolicy:
explicit
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 17. Customizing AIXwindows 17-9
ëë
��%
���
$ cp /usr/lpp/X11/defaults/Motif1.2/system.mwmrc $HOME/.mwmrc
$ vi $HOME/.mwmrc
Menu DefaultRootMenu
{" Root Menu "
f.title
no-label
f.separator
" New Window "
f.exec "aixterm"
" My Window "
f.exec "aixterm -bg white -fg navy"
" Clients "
f.menu "clients"
" Custom "
f.exec "custom"
no-label
f.separator
" Refresh "
f.refresh
" Pack Icons "
f.pack_icons
no-label
f.separator
" Restart ... "
f.restart
" Quit ... "
f.quit_mwm
no-label
f.separator
" End Session "
f.menu "end_session"
} :wq
��
���
���
������
(��
���
��$
��
�(���
��%
�����
(���
���
%�
���;
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
17-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë9�6��
.��
�����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 17. Customizing AIXwindows 17-11
ëë
�
%��
��
%��1��
���
�1�
��
������
��
A����!���
9���(� ��
%�����
%�����
A�����
���'������
A�������===
#� �-�����
� �
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
17-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2$
��1��
���
�1��
���
�%
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 17. Customizing AIXwindows 17-13
ëë
��
���
��K
��"
���
���6
����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
17-14 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2$
��
�%
���
�%
���
���
���
��%
���
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 17. Customizing AIXwindows 17-15
ëë
.�!��
"��
$���
����
��K
��
��$
��
"��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
17-16 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2$
��6
����
��
���
��
���
�
%�����&������
��
��%
���
�%���������6
��
���
���������
$ xsetroot -solid black
$ xsetroot -cursor_name gumby
$ xsetroot -bitmap /usr/include/X11/bitmaps/xsnow
5���
��
��
��(�������&������������ ������
6��
����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 17. Customizing AIXwindows 17-17
ëë
9�6��
.��
�����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
17-18 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë-�
����
O/�
�$
��&�
���
�
+=!������������ ������������������������������
�+�
�6��
����
CC-���� �������������������
������������������ �������������
�+�
���
�#�
���
�CC-���������!����(� ��
��������������
��������!������
�+�
��%
���
CC"����������������������
���������
�������������������� ������ ��
�������������
,=9���������������� �
��
�#�
���
�������������������&� =
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
.=��������0�������������� ���� �
����
�����������������������&�����
������������
6��
��������=
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
/=(��������� ������ ������������������������������������� ��D
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
1=(�������� ����6
����
��
�������� ��������� ������'��������������
������������������� ��D
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 17. Customizing AIXwindows 17-19
ëë
.�
��
��(
����6��
����������������������� ������������� �����
����� �����������=������������������������=
�����
��#�
��������������&��������������� ����
������������� ����������=
�����
%�
�������������&���������������������� ���
������� ����������������������=
����������� ����E�
��
���E���������������&�����
�� ��������������
���6
��
���
��������� �����������&������������ ��=
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
17-20 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 18. Using the Common Desktop Environment (CDE)Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 18. Using the Common Desktop Environment (CDE) 18-1
ëë
-�
����
E
-���
"��
$���
��
��
�
���&��
��'
�!��
��
���
�
*��
'+
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
18-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��������������������������� ��������� ������������
"����������"
����������%������"��'����#����������
)��
'*
-�
�������������
�'
���
��
��
��
��
��
����
!��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 18. Using the Common Desktop Environment (CDE) 18-3
ëë
��
��
��
����&��
��'
�!��
��
���
��*�
�'
+
���F:
���
#
�:
1���
-
��
�
��
�&�
�����.
$���
.�
�.
�#�
1�/
�5
'9
� �
�4
����
���
��
���&.
���
���
��
���
!��
(��
��
��
2�
��2
��&
������"
��"
��(���
�
85
1���
-'
-.
1�
���
�&
���
:�
��
"�
�
��
���
����
��
��
�(�
���
�
���$
��
��"
(
��
'
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
18-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2$
���
��
��
��
���
��#�
�$�
���
'��
��
&��
�
���
�"
���!������
���0����������
���.
�(���!������
���0
����!������
���
��
������
���!������
5���
��
�������������
���8
����!������
���.
�����
��!�������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 18. Using the Common Desktop Environment (CDE) 18-5
ëë
2$
��
�"
���:
��
�"
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
18-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë@8
�:
'F�
���
��#�
��
-�����
�!��
��
���
��!���
��
��������������
�'
��� ����������
��#�
���������
��"
��
���
���#
���
���
�����
��#�
����
#���������������������������
����
��#�
��������� �
$ vi $HOME/.dtprofile
...
DTSOURCEPROFILE=true
:wq
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 18. Using the Common Desktop Environment (CDE) 18-7
ëë
0��
���
5�
��
�
%���� ��
0���
!������
!����
������-�����
!������ ����������
!������
I���
���������
�����������
-�������
(��'������
-���
����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
18-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë0��
���
5�
��
��B�
.�
��
��
���
.�
��
��
��
����
�����
��
���
.�
��
��
��
��
���
���
.�
��
��
��
��
��
��
���
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 18. Using the Common Desktop Environment (CDE) 18-9
ëë
0��
���
5�
��
��B�
0�
��$
���
��
���
���
�
(��'������-���
B��
���
����
0���
8��' ?�������
(��'������
!������
����
#$�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
18-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë�
��!
��(/�
�$
��1
��2
$��
I
%CCCCCC
0CCC
!CCCCCC
�CCCCCC
�CCCCCCC
-CCCCCC
8CCC
!CCCCC
(CCCCCCCC
-CCCCCC
#CCC
-CCCC
!CCCCCC �CCCCCC
!CCCCCC
ICCC
-CCCCCC
�CCCC
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 18. Using the Common Desktop Environment (CDE) 18-11
ëë
2$
��.
�(��
�:�
��
"�
�
���.
�(��
�:��
�"
���������������������
����
��K
���
������
��� ��'���������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
18-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2$
��0
���
�:�
��
"�
�
9�����������������
(��'����������� � ��������
"������ � ����������
8����������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 18. Using the Common Desktop Environment (CDE) 18-13
ëë
2$
��
��
���
���
��
�:�
��
"�
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
18-14 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2$
��5
���
��
���
�
���
��
���
��
�:�
��
"�
�
�������������������
-�������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 18. Using the Common Desktop Environment (CDE) 18-15
ëë
2$
��2
���
�����'
��
����
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
18-16 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëëA�� �����������������
2$
��8
���
�.(�
���
I����<��
����������I����!���
I����-�������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 18. Using the Common Desktop Environment (CDE) 18-17
ëë
2$
��.
��
���
��:
��
�"
��
��"
��
���
"��
��� .
�����
��:
��
�"
��������������������
����
��"
����
��� �
���1
���
��&��
���
�!��
��
���
�������������
��������������������� =
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
18-18 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2$
���
�'
�:����5
��"
���
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 18. Using the Common Desktop Environment (CDE) 18-19
ëë
��
'�:
���
�5��
"��
��B
�.�
��
���:
��
��
"�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
18-20 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë2$
���
���
��
���
:�
��
"�
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 18. Using the Common Desktop Environment (CDE) 18-21
ëë
��
���
��
��
��
���
���
���
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
18-22 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë9�
6��
.��
���
��
#$������+5
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 18. Using the Common Desktop Environment (CDE) 18-23
ëë
+=�������������D�%"#��� ����� �������������������������������
��� 9�������������=
,=!���������������������������������������������
�=8����!������
CC%��������� �����������
� �����
�=0����������
CC%��������� �������'���
������� �����������
�=�������������������
CC �� ����������&��%"#
=0���!������
CC�������������H8������H
�=����������!������
CC!������� ��'�������'
����������������
�=-�����!������
CC���� �����? ��������'���
�����
�=-������!������
CC �� ���������������������
=I����!������
CC���������������������"
.=�������������D�������������������������������=��������������
��� ���� ������������%"#�����������=
-�
����
E/�
�$
��
&�
���
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
18-24 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���%"#����� ��������������������������������������
����������
������������������%"#�����0��������������� �������������
����������%"#����������
%���� ��
0���!������
�������������������
!��
�������0�������
���-�����!������
�������������!������
���I����!������
����
���0��������������������������(��'������-������ ����
������������'��� ����������������
.�
��
��(
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 18. Using the Common Desktop Environment (CDE) 18-25
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
18-26 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
Unit 19. CDE User CustomizationCourse materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 19. CDE User Customization 19-1
ëë
-�
����
R
��
'�-
���
��
���
��K
���
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
19-2 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
����
!��
��������������������������� ��������� ������������
������.
�(��
�:��
�"
������������������������&�����
��'��������������
%�����&�����0
���
��5
��
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 19. CDE User Customization 19-3
ëë
��
���
��K
��"
���
'
!����#�
���
���
��#�
��
'������
����
��K
��
��
0�����������������
0������%�������
���' ���
(��'������-���
����������������
%����� �8���
B�����
%�����������
0���
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
19-4 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë.�(
���:
��
�"
���
�!��!
��%
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 19. CDE User Customization 19-5
ëë
.�(
���:
��
�"
���
B��
���
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
19-6 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë.�(
���:
��
�"
���
B�0
��
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 19. CDE User Customization 19-7
ëë
.�(
���:
��
�"
���
B��
��&�
���
�
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
19-8 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë.�(
���:
��
�"
���
B�4
�(�
����
<�:
��
����
��
�����
<������'�������
%���������������
��������
!���������������'��������
"���������'�����
������������������
����������������������
6�����
����
"������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 19. CDE User Customization 19-9
ëë
.�(
���:
��
�"
���
B��
���
�%
<�.
���
��
���
��.
����
��
(� ��������������
(� ��������������
(� �����������������
-�����������
8��'�������
%�������-���������I����
-�����
(������������������
��������������������������
������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
19-10 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
!��
(/�
7�!��
%�.
�(��
�:��
�"
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 19. CDE User Customization 19-11
ëë
3��
���
��.
���
���
����
#���0
���
��5
��
��
��$
�����
-�������
-���%������
%������
%������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
19-12 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë���
���
�"
���9
�%
���
�&��
���
-��������
� �(��'�����
I���
%��'���� �
�"$
���
��
���������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 19. CDE User Customization 19-13
ëë
�$
��
"��
"��
���
�&��
����9
��
�
(��'������9��
� �(��'�����
"�����
A�����
I���
%��'���� �
�"$
���
��
���������
:���
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
19-14 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë�(�
��
����
�����
��
����
����
���
���
#���.
��
���
��
!��
!����
� �-�������
I���
%��'�����
�"$
���
��
���������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 19. CDE User Customization 19-15
ëë
�
���
"��
���
���
�����
���.
��
���
��
"�������
���
��
��
�����������
��
����
��
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
19-16 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë��
�(��
�.�
��
��
����
��
���
����
��$
��:
���
�5��
��
�������
�������
%�������!��������
"�����
I���
%��'���� �
�"$
���
��
���������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 19. CDE User Customization 19-17
ëë
�
���
"��
��
���
����
���
$��0
���
��5
��
���*�
+
+=�� ���� �
��
���
������� .
��
���
���
,=�0� ��������������������
�#�
���
���
�#��
����������
��
���
��
$ ls $HOME/.dt/types/fp_dynamic
Dtcalc1.fp
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
19-18 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë�
���
"��
��
���
����
���
$��0
���
��5
��
���*)
+
.=��
��
(��
$���
�#�
���
���
�#��
����� �������
�>IB!#;= �;�����
$ cp $HOME/.dt/types/fp_dynamic/Dtcalc1.fp $HOME/.dt/types/joe.fp
/=�
��$
������%������������0�����������
����$ vi $HOME/.dt/types/joe.fp
CONTROL Dtcalc
{
...
CONTAINER_TYPE BOX
CONTAINER_NAME Top
POSITION_HINTS last
...
}
1=�
7����
������%"#
2�������������������%"#���
0�����#�
.�����
�����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 19. CDE User Customization 19-19
ëë
'6��
��
��
�0��
���
5��
��
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
19-20 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë9�6��
.��
�����
#$������,7
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 19. CDE User Customization 19-21
ëë
-�
����
R/�
�$
��&�
���
�
+=I��� ������������&������������������������� ��'����
�����������D
�����
,=���������������O����������������������������'�������������
%"#������������=
.="��������������������������� � �������%"#������������=
�����
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
19-22 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2 VISUNIT
Uempty
ëë.�
��
��(
������-�����!����������������������������&��%"#�
���������������������' ������������'������ ��������� �
�� ����������������������������� ���������������
�������������������&�����0��������������� ��� �
����������'��������������� ���� ������������������
� ���� �������������������������������� ��������
�����������������������!��������
���� ������������������������������ ���������������
��������=�%������� ������������� ������������������
����������������
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
© Copyright IBM Corp. 1995, 2001 Unit 19. CDE User Customization 19-23
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
19-24 AIX 5L Basics © Copyright IBM Corp. 1995, 2001
V1.2.2
backpg