AIX 基礎筆記1

*To Log in:

login: root

root's Password:(the password does not appear)

 

*To Log out:

# <Ctrl-d>  (or)

# exit          (or)

# logout

 

*Creating or Changing the Password:

# passwd root

Changing password for "root"

root's New password:

Enter the new password again:

 

*Command Format

# ls                               just command

# ls -l                        command and option

# ls /usr                    command and argument

# ls -l /usr

 

*The date and cal Commands

# date

Wed Mar 21 16:07:02 GMT+08:00 2012

# cal 3 2012

        March 2012

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 2012

 

 

 

                                2012

 

          January                     February

Sun Mon Tue Wed Thu Fri Sat  Sun Mon Tue Wed Thu Fri Sat

 1   2   3   4   5   6   7                1   2   3   4

 8   9  10  11  12  13  14    5   6   7   8   9  10  11

15  16  17  18  19  20  21   12  13  14  15  16  17  18

22  23  24  25  26  27  28   19  20  21  22  23  24  25

29  30  31                   26  27  28  29

 

           March                        April

Sun Mon Tue Wed Thu Fri Sat  Sun Mon Tue Wed Thu Fri Sat

                 1   2   3    1   2   3   4   5   6   7

 4   5   6   7   8   9  10    8   9  10  11  12  13  14

11  12  13  14  15  16  17   15  16  17  18  19  20  21

18  19  20  21  22  23  24   22  23  24  25  26  27  28

25  26  27  28  29  30  31   29  30

 

            May                         June

Sun Mon Tue Wed Thu Fri Sat  Sun Mon Tue Wed Thu Fri Sat

         1   2   3   4   5                        1   2

 6   7   8   9  10  11  12    3   4   5   6   7   8   9

13  14  15  16  17  18  19   10  11  12  13  14  15  16

20  21  22  23  24  25  26   17  18  19  20  21  22  23

27  28  29  30  31           24  25  26  27  28  29  30

 

           July                        August

Sun Mon Tue Wed Thu Fri Sat  Sun Mon Tue Wed Thu Fri Sat

 1   2   3   4   5   6   7                1   2   3   4

 8   9  10  11  12  13  14    5   6   7   8   9  10  11

15  16  17  18  19  20  21   12  13  14  15  16  17  18

22  23  24  25  26  27  28   19  20  21  22  23  24  25

29  30  31                   26  27  28  29  30  31

 

         September                     October

Sun Mon Tue Wed Thu Fri Sat  Sun Mon Tue Wed Thu Fri Sat

                         1        1   2   3   4   5   6

 2   3   4   5   6   7   8    7   8   9  10  11  12  13

 9  10  11  12  13  14  15   14  15  16  17  18  19  20

16  17  18  19  20  21  22   21  22  23  24  25  26  27

23  24  25  26  27  28  29   28  29  30  31

30

         November                     December

Sun Mon Tue Wed Thu Fri Sat  Sun Mon Tue Wed Thu Fri Sat

                 1   2   3                            1

 4   5   6   7   8   9  10    2   3   4   5   6   7   8

11  12  13  14  15  16  17    9  10  11  12  13  14  15

18  19  20  21  22  23  24   16  17  18  19  20  21  22

25  26  27  28  29  30       23  24  25  26  27  28  29

                             30  31

 

*The clear,echo,and banner Commands

# clear

# echo Lunch is at 12:00

Lunch is at 12:00

# banner Hello

#     #

#     #  ######  #       #        ####

#     #  #       #       #       #    #

#######  #####   #       #       #    #

#     #  #       #       #       #    #

#     #  #       #       #       #    #

#     #  ######  ######  ######   ####

 

# print Lunch is at 12:00

Lunch is at 12:00

 

*The who and finger Commands

# who

root        pts/0       Mar 21 15:52     (172.19.1.246)

# who am i

root        pts/0       Mar 21 15:52     (172.19.1.246)

# whoami

root

# finger root

Login name: root

Directory: /                            Shell: /usr/bin/ksh

On since Mar 21 15:52:30 on pts/0

    from 172.19.1.246

No Plan.

# who -u

root        pts/0       Mar 21 15:52      .    14090462  (172.19.1.246)

# who -m

root        pts/0       Mar 21 15:52     (172.19.1.246)

# who -mu

root        pts/0       Mar 21 15:52      .    14090462  (172.19.1.246)

 

*Sending Mail

# mail oracle

Subject: Test        //<Enter>

just a test            //<Enter>以換行,然後在新的空行按下<Ctrl-d>以退出編輯

Cc:                              //<Enter>

# mail oracle wcadmin    //若發送給多個用戶則每個用戶名間以空格分開

Subject: Test

just a test

Cc:

# mail [email protected]       //發送到其他系統

Subject: Test

just a test

Cc:

 

*Receiving Mail

# mail

Mail [5.2 UCB] [AIX 5.X]  Type ? for help.

"/var/spool/mail/root": 16 messages 16 new

>N  1 MAILER-DAEMON     Fri Jan  6 09:08 356/8756 "Postmaster notify: see trans"

 N  2 esaadmin          Sun Jan  8 03:01  15/739  "Electronic Service Agent not"

 N  3 MAILER-DAEMON     Mon Jan  9 09:39 356/8757 "Postmaster notify: see trans"

 N  4 MAILER-DAEMON     Tue Jan 10 10:53 362/9660 "Postmaster notify: see trans"

 N  5 MAILER-DAEMON     Tue Jan 10 10:53 362/9659 "Postmaster notify: see trans"

 N  6 MAILER-DAEMON     Tue Jan 10 17:22 356/8769 "Postmaster notify: see trans"

 N  7 esaadmin          Sun Jan 15 03:01  15/741  "Electronic Service Agent not"

 N  8 esaadmin          Sun Feb  5 03:01  15/739  "Electronic Service Agent not"

 N  9 esaadmin          Sun Feb 12 03:01  15/741  "Electronic Service Agent not"

 N 10 esaadmin          Sun Feb 19 03:01  15/741  "Electronic Service Agent not"

 N 11 esaadmin          Sun Feb 26 03:01  15/741  "Electronic Service Agent not"

 N 12 esaadmin          Sun Mar  4 03:01  15/739  "Electronic Service Agent not"

 N 13 MAILER-DAEMON     Thu Mar  8 16:58 356/8733 "Postmaster notify: see trans"

 N 14 esaadmin          Sun Mar 11 03:00  15/741  "Electronic Service Agent not"

 N 15 esaadmin          Sun Mar 18 03:01  15/741  "Electronic Service Agent not"

 N 16 MAILER-DAEMON     Wed Mar 21 16:21  59/1754 "Returned mail: see transcrip"

? t 2

Message  2:

From esaadmin Sun Jan  8 03:01:00 2012

Date: Sun, 8 Jan 2012 03:01:00 +0800

From: esaadmin

To: root

Subject: Electronic Service Agent not activated

 

Electronic Service Agent has not been activated.  To activate Electronic Service Agent, do the following:  From the SMIT main menu, select Electronic Service Agent, then select Configure Electronic Service Agent.

 

For information about Electronic Service Agent, including the benefits of activating it, see the following:

http://publib.boulder.ibm.com/infocenter/eserver/v1r2/topic/eicbd/eicbdkickoff.htm

 

d                 //Delete message

? d 1

q                 //Quit mail command                 

Held 15 messages in /var/spool/mail/root

 

*Controlling the mail subsystem

Some of the commands that can be used at the ? prompt are:

d            delete messages

m           forward messages

R            send reply to sender of messages in the queue

q            exit mail and leave messages in the queue

s            append messages to a file

t            display a message

x            exit mail and discard all changes to the queue

 

*The write and wall Commands

# write wcadmin             //write to another user

just a test           //<Ctrl-d> 退出


83785_13538994063mgG.png


83785_1353899407z0zC.png


# wall just a test             //write to all users

 

 

Broadcast message from root@plmworker (pts/0) at 16:49:17 ...

 

just a test

# write <username>@<hostname>    //write to users on other systems

 

*talk with Another User

# talk wcadmin     (or)

# talk wcadmin@plmworker

對方同意(如對方敲入命令talk root以同意)則開始對話,<Ctrl-c>退出對話

 

*Keyboard Tips

<Backspace>     Corrects mistakes

<Ctrl-c>              Terminates the current command and returns to the shell

<Ctrl-d>              End of transmission or end of file

<Ctrl-s>               Temporarily stops output to the screen

<Ctrl-q>               Resumes output(stopped by Ctrl-s)

<Ctrl-u>               Erases the entire line



*Path Names

start from the / directory

# pwd

/

# vi /ptc/sp/mvlogs.sh

 

start from current directory

# cd /ptc/sp

# pwd

/ptc/sp

# vi mvlogs.sh

 

*Listing Directories

Syntax: ls [directory]

Common options:  -a:Show hidden files(files that start with a ".")

                                  -R:List files in all subdirectories(recursively)

                                  -l  :Obtain more information about the files in a directory

                                  -i  :Display the i-node number in the first column

# cd /tmp/test

# ls

test001  test01

# ls -a

.        ..       test001  test01

# ls -R

test001  test01

./test001:

# ls -l

total 0

drwxr-xr-x    2 root     system          256 Mar 23 13:33 test001

-rw-r--r--    1 root     system            0 Mar 23 13:32 test01

# ls -li

total 0

73864 drwxr-xr-x    2 root     system          256 Mar 23 13:33 test001

73863 -rw-r--r--    1 root     system            0 Mar 23 13:32 test01

# ls -i

73864 test001                  73863 test01

 

*Change Current Directory

Syntax: cd [directory]

# cd /

# pwd

/

# cd /tmp/test

# pwd

/tmp/test

# cd test001

# pwd

/tmp/test/test001

# cd

# pwd

/

# cd /tmp/test/test001

# pwd

/tmp/test/test001

# cd ..

# pwd

/tmp/test

 

*Creating Directories

Syntax: mkdir directory_name

# cd /

# mkdir /tmp/test/test002

# cd /tmp/test

# mkdir test003

# ls

test001  test002  test003  test01

 

*Removing Directories

Syntax: rmdir directory

# rmdir /tmp/test/test003

# pwd

/tmp/test

# rmdir test002

# ls

test001  test01

# rmdir /tmp/test              //The directory must be empty!

rmdir: 0653-610 Cannot remove current directory /tmp/test.

# mkdir -p test002/test003/test004

# ls

test001  test002  test01

# ls -R

test001  test002  test01

./test001:

 

./test002:

test003

 

./test002/test003:

test004

 

./test002/test003/test004:

# rmdir -p test002/test003/test004

# ls -R

test001  test01

./test001:

 

*Displaying Directory Information

# ls -ldi /tmp/test           //the -d option will list the i-node information for a directory

73859 drwxr-xr-x    3 root     system          256 Mar 23 13:47 /tmp/test

# istat /tmp/test               //display the i-node information for a particular file or directory

Inode 73859 on device 10/7      Directory

Protection: rwxr-xr-x

Owner: 0(root)          Group: 0(system)

Link count:   3         Length 256 bytes

 

Last updated:   Fri Mar 23 13:47:28 GMT+08:00 2012

Last modified:  Fri Mar 23 13:47:28 GMT+08:00 2012

Last accessed:  Fri Mar 23 13:47:31 GMT+08:00 2012

# ls -lc /tmp/test           //display the updated time(utime)

total 0

drwxr-xr-x    2 root     system          256 Mar 23 13:33 test001

-rw-r--r--    1 root     system            0 Mar 23 13:32 test01

# ls -lu /tmp/test           //display the access time(atime)

total 0

drwxr-xr-x    2 root     system          256 Mar 23 13:47 test001

-rw-r--r--    1 root     system            0 Mar 23 13:32 test01

 

*touch Command

The touch command updates the access and modification times of a file. The command can also be used to create

zero-length files.

# ls

test001  test01

# touch test02

# touch test03 test04

# ls

test001  test01   test02   test03   test04


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章