2.3 use basic commands
12. cat command
It is used to display the file content on the standard output, but does not update the file. The syntax is cat + file name. For example, to display the content of the/home/long/example.txt file, run the following command:
$ Cat/home/long/example.txt
13. more command
The function is to display text files on the terminal screen by screen. The specific syntax is: more + file name. For example, to split the screen to display the file/example. C, run the following command: $ more/example. C.
14. shutdown command
The shutdown command interrupts the Operating System. Only users with root permissions can execute this command. By default, the system will receive a message when executing the shutdown command, and the shutdown operation will not be completed until the complete s-hudown information is received. When the shutdown time is approaching, the user will receive a warning message on the client. When the specified time arrives, the default value is 6 0 s.) The system stops all processes and unmounts all file systems. The specific usage is:
# Shutdown shut down the system
# Shutdown-Fr Quickly shut down the system and restart
# Shutdown-F Quickly shut down the system
15. talk commands
The talk command is used to talk to other end users. The specific syntax is as follows:
$ Talk username1 @ rs6k where user is the account name of the target user. At the same time, run $ talk username2 @ rs6k on the peer terminal, where rs6k is the name of the server)
16. wall command
It is used to send broadcasts to all users in the network. Syntax: wall + content
For example, the following command: $ wall good morning!
Good morning is displayed on all terminals!
17. date command
Used to display or change the time. If you change the time, You must log on as the root user. For example, to display the time, enter $ date.
To change the time input: # date 0217142592 change time to, January 1, February 17, 1992
18. clear command
Eliminate terminal screens. The specific syntax is very simple. You only need to execute $ clear.
19. whereis command
Used to determine the file location. Usage: whereis + file name. For example, to determine the location of the file example.txt, run the following command: $ whereis example.txt
20. tar command
Tar is a common and important command in unix. The tar command Copies files on the disk to the file media, for example, a floppy disk or a hard disk to a floppy disk, or restores the recorded files on the file media to files on the disk. In case of an error, the t ar command does not provide any restoration operations.
Tar command format:
# Tar-cvf or xvf) + file name + device
C-> Local to other devices
X-> other devices to the local device
R-> is to repeat a t.txt file, and then upload another r.txt file.
A tar file or folder) uses the cvf parameter;
Unbind the tar file and use the xvf parameter.
For example:
Run the following command to tar the file "/home/test" to/ANW and tar it into "exe.tar:
# Tar-cvf/anw/exe.tar/home/test
To unbind the tar file, run the following command:
# Tar-xvf/anw/exe.tar will remove exe.tar to the path specified during compression.
The extension of the tar command to generate a file can be arbitrary. For example, the file generated by the test file can be test. a and test. B extension test.tar.
21. compress command and uncompress command
These two commands are used to complete compression and decompression. For example, if you run $ compress test.tar, The test.tarfile is compressed into the test.tar. Z file. Uncompress command: $ uncompress test.tar. Z
Note: If the absolute path is input during compression, it is automatically extracted to the corresponding path during decompression.
22. View Disk Space Command df
The df command displays the total disk space and available disk space of the system. It also displays the file system parameters of the specified device, the path of the file system, and the directory to which the file system is mounted. The syntax is as follows: $ df is 512 KB, and $ df-k is 1024 kb, that is, 1 MB:
$ Df
Filesystem 512-blocks Free % Used Iused % Iused Mounted on
/Dev/hd4 327680 239248 27% 2616 4%/
/Dev/hd2 11730944 5539296 53% 84989 6%/usr
/Dev/hd9var 327680 301088 9% 709 2%/var
/Dev/hd3 327680 316448 4% 68 1%/tmp
/Dev/hd1 10092544 1426480 86% 9128 1%/home
$ Df-k
Filesystem 1024-blocks Free % Used Iused % Iused Mounted on
/Dev/hd4 163840 119624 27% 2616 4%/
/Dev/hd2 5865472 2769648 53% 84989 6%/usr
/Dev/hd9var 163840 150544 9% 709 2%/var
/Dev/hd3 163840 158224 4% 68 1%/tmp
/Dev/hd1 5046272 713236 86% 9128 1%/home
23. finger command
Displays information about the currently logged on user. This command has the same function as the f command. The syntax is as follows:
$ Finger or $ f
24. last Command
The last command is used to display the previous logon information. For example, last displays the logon information of all users in the recent period. Including the logon time and process. If you specify to display the login information of a user, you can use l ast + user account. For example, $ last user indicates the logon information of the user.
25. ifconfig command
Used to configure or display TCP/IP network interface parameters. You can run the following command to view the IP Address:
$ Ifconfig-a displays the IP address on RS6000.
26. ping Command
Used to test the physical connection of the network. The user sends an ICMPInternet Control Message Protocal) to obtain an ICMP response from the host or gateway. To test the physical connection with a host whose IP address is 192.168.0.161, run the following command:
$ Ping 192.168.0.161
PING 192.168.0.161: 192.168.0.161): 56 data bytes
64 bytes from 192.168.0.161: icmp_seq = 0 ttl = 255 time = 0 MS
64 bytes from 192.168.0.161: icmp_seq = 1 ttl = 255 time = 0 MS
64 bytes from 192.168.0.161: icmp_seq = 2 ttl = 255 time = 0 MS
64 bytes from 192.168.0.161: icmp_seq = 3 ttl = 255 time = 0 MS
64 bytes from 192.168.0.161: icmp_seq = 4 ttl = 255 time = 0 MS
64 bytes from 192.168.0.161: icmp_seq = 5 ttl = 255 time = 0 MS
64 bytes from 192.168.0.161: icmp_seq = 6 ttl = 255 time = 0 MS
---- 192.168.0.161 PING Statistics ----
8 packets transmitted, 8 packets received, 0% packet loss
Round-trip min/avg/max = 0/0/0 MS
In this case, the system receives a response from 192.168.0.161, proving that the physical connection to the host is normal.
If the following problem occurs, it indicates that there is no connection with 192.168.0.161.
$ Ping 192.168.0.161
PING 192.168.0.161: 192.168.0.161): 56 data bytes
---- 123.123.1.1 PING Statistics ----
53 packets transmitted, 0 packets received, 100% packet loss
27. su command
Used to change the user ID, together with the session. For example, if the current user is user1 and $ su-user2 is executed, the user ID is changed to user2 and can be operated as user2. When creating a user, you can choose whether to allow other users to su your user.
28. ps command
Displays the status of the currently running process. With different options, you can query all running processes or all processes with the user ID. Through the ps command, you can understand the processes that are running in the background or all the processes that have the user I D. With the ps command, you can understand the processes that are running in the background and the batch processing processes that are running. If no parameter is specified, only processes created by the current terminal are displayed. $ Ps-A lists detailed information about processes running in the system. $ Ps a lists all processes related to the terminal.
29. echo command
Used to output string standards. For example, to output Hello, you can use $ echo Hello
In the variable assignment statement, for example, U = Hello, to output Hello, use $ echo $ U. Note that a $ symbol must be added before, indicating the value of the output variable U.
30. env command
The env command can be used to display the current environment or set one or more environment variables. You can also run the specified command. However, environment changes are only valid during command execution. For example, $ env allows you to view the currently set environment variables. For example:
$ Env
_ =/Usr/bin/env
LANG = en_US
LOGIN = long
NLSPATH =/usr/lib/nls/msg/% L/% N:/usr/lib/nls/msg/% L/% N. cat
IMQCONFIGCL =/etc/IMNSearch/dbcshelp
PATH =/usr/bin:/etc:/usr/sbin:/usr/ucb:/home/long/bin:/usr/bin/X11:/sbin :.
Lc1_fastmsg = true
CGI_DIRECTORY =/var/docsearch/cgi-bin
IMQCONFIGSRV =/etc/IMNSearch
LOGNAME = long
MAIL =/usr/spool/mail/long
LOCPATH =/usr/lib/nls/loc
USER = long
DOCUMENT_SERVER_MACHINE_NAME = localhost
AUTHSTATE = compat
SHELL =/usr/bin/ksh
ODMDIR =/etc/objrepos
U = rs6k
DOCUMENT_SERVER_PORT = 49213
HOME =/home/long
TERM = vt100
MAILMSG = [you have new mail]
PWD =/home/long
DOCUMENT_DIRECTORY =/usr/docsearch/html
Z = BEIST-8BEIDT
A _ z =! LOGNAME
31. passwd command
When a user logs on, the system requires the user to enter the user name and password. Although users do not have a password, most users use the password for logon. To change the password, run the p asswd command. When executing the passwd command, the system first requires the user to enter the current password, and then enter the new password two times in a row. The new password is valid only when the new password is the same. For example, to change the password of l ong, run the following command:
$ Passwd long
Changing password for "long"
Long's Old password:
Long's New password:
Enter the new password again:
$
32. chmod command
To enhance the security of directories or files, or grant directories and files to others for access, users often need to modify the permissions of directories or files. In Unix, the permission uses an octal number ranging from 0 to 7) to specify the permission for a file or directory. There are three types of objects used for directories or files:
Owner: the user who created the file
Group members: other members in the user group of the owner
Other users: they are neither the owner nor other users of group members.
The system uses an octal number to specify the permissions of each type of visitor object. For the owner, group members, and other users, the file permission can be divided into read permission, write permission, and execution permission. Each permission corresponds to a bit of data. That is, if the read bit is 1, it indicates readable, the write bit is 1, and the execution bit is 1, it indicates executable.
Note that bit execution is special for directories. If you can execute a directory, you can access the contents of the directory. Otherwise, you cannot access the contents of the directory.
Read and Write: When three bits are combined, an octal number is displayed. the read-bit permission is 4, the write permission is 2, and the execution is 1.
Remind the user again that the execution permission of a directory is the access permission to the directory, that is, the permission to operate on the directory. If you have the write permission on the directory, you can read, write, delete, and execute all the files in the directory without restrictions on the specific file permissions.
You can use the chmod command to assign a new permission value to a file or directory. For example, if you set the file testfile permission to: the owner can read, write, and execute, and the group members can read, other users can execute. Available command: $ chmod 741 testfile
If you want to set the permission of testfile in the current directory to readable and writable for the owner and group members, run: $ chmod 660 testfile.
$ Ls-l
Total 202
-Rw ------- 1 long system 287 Dec 28 mbox
Drwxr-xr-x 3 long system 512 Dec 29mm
-Rw-r -- 1 long system 59034 Dec 29 smit. log
-Rw-r -- 1 long system 12668 Dec 21 smit. script
Drwxr-xr-x 3 long system 512 Dec 27 test
-Rw-r -- 1 long system 10240 Dec 28 test.tar
-Rw-r -- 1 long system 16949 Dec 10 websm. log
Note that in the first column on the left, the first character is-indicating the file; and d indicates the directory. Each of the following nine characters is an octal group. Each of the three characters indicates the user, the group in which the user is located, and the read and write executable permissions of other users. R indicates readable, w indicates writable, and x indicates executable.
2.4 configure Environment Variables
In order to allow users to use shell conveniently and flexibly, Unix introduces the concept of environment. The environment is some data. You can change the data, add new data, or delete some data. These data are called environment variables. Because they define the user's work environment and can be modified at the same time.
1. Browse and set Environment Variables
Each user has its own different environment variables. You can use the env command without parameters) to browse the environment variables. The output format and variable name vary with shell and system configuration. For example:
$ Env
_ =/Usr/bin/env
LANG = en_US
LOGIN = long
NLSPATH =/usr/lib/nls/msg/% L/% N:/usr/lib/nls/msg/% L/% N. cat
IMQCONFIGCL =/etc/IMNSearch/dbcshelp
PATH =/usr/bin:/etc:/usr/sbin:/usr/ucb:/home/long/bin:/usr/bin/X11:/sbin :.
Lc1_fastmsg = true
CGI_DIRECTORY =/var/docsearch/cgi-bin
IMQCONFIGSRV =/etc/IMNSearch
LOGNAME = long
MAIL =/usr/spool/mail/long
LOCPATH =/usr/lib/nls/loc
USER = long
DOCUMENT_SERVER_MACHINE_NAME = localhost
AUTHSTATE = compat
SHELL =/usr/bin/ksh
ODMDIR =/etc/objrepos
U = rs6k
DOCUMENT_SERVER_PORT = 49213
HOME =/home/long
TERM = vt100
MAILMSG = [you have new mail]
PWD =/home/long
DOCUMENT_DIRECTORY =/usr/docsearch/html
Z = BEIST-8BEIDT
A _ z =! LOGNAME
$
Sometimes you have many environment variables. If you only want to query one of them, you can use the echo command. As mentioned earlier, to indicate that the input characters represent environment variables, you must add $. note that there is no space between $ and the variable name. For example, use the echo command to display the value of the environment variable HOME:
$ Echo $ HOME
/Home/long
$
You can assign values to environment variables to generate new environment variables. You can assign values to existing environment variables to change their original values.
2.5 Public desktop environment CDE
CDE stands for Common Desktop Environment, which is a graphical interface management program. The prerequisite for using CDE is that RS6000 is connected to a graphic display. Before use, install the software packages X.11 and Dt. rte and X11.Dt. helpinfo. during installation, the system sets CDE as the default user interface. After Aix is started, the CDE registration interface is displayed. Enter the user registration name and password to enter the CDE operation environment.
2.6 Unix kernel and shell
Unix kernel: a core program that runs and manages hardware devices such as disks and printers.
Shell is a system user interface that provides an interface for user and internal and interactive operations. Shell has its own programming language for editing commands. It allows you to write a program composed of sh ell commands. Currently, shell has the following versions: BASH Linux), K shell Aix), and C shell
2.7 Unix File System Hierarchy
Unix manages resources in a file system. File systems include dynamic file systems and static file systems. Dynamic File System: executable files and configuration files
Static File System: Operating System
The basic hierarchy of Unix file systems is as follows:
/Usr/lib/sbin is mainly used to store system library files and some backup files.
/Etc is mainly a system configuration file
/Dev Device File
/Var Log File
/Tmp temporary file
/Opt application file
Oracle video tutorial follow: http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html