In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
2.3 use basic commands
12. Cat command
Used to display the contents of the file on standard output, but the file is not updated. The specific syntax is: cat + file name. For example, to display the contents of the / home/long/example.txt file, you can use 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 display the file / example.C on a split screen, use the following command: $more / example.C
14. Shutdown command
The shutdown command interrupts the operating system, and only users with root privileges can execute it. By default, you receive a message when you execute the shutdown command, and the system does not complete the shutdown operation until you receive the complete shutdown information. When the shutdown time is approaching, there will be a warning message on the client side. When the specified time arrives, the system ends all processes (default is 60 seconds) and unmount all file systems. The specific usage is:
# shutdown shuts down the system
# shutdown-Fr quickly shut down the system and restart
# shutdown-F Quick shutdown system
15. Talk command
The talk command is used to talk to other end users with the following syntax:
$talk username1@rs6k where user is the account name of the person you want to talk to. At the same time, run $talk username2@rs6k on the other terminal (where rs6k is the name of the server)
16. Wall command
Used to send broadcasts to all users in the network. The specific syntax is: wall + content
For example, the following command: $wall good morning!
Good morning will be displayed on all terminals!
17. Date command
Used to display or change the time. If you change the time, you must log in as root. For example, to display the time, enter: $date
To change the time input: # date 0217142592 change the time to 14:25 on February 17, 1992
18. Clear command
Eliminate the terminal screen. The specific syntax is very simple, as long as you execute $clear.
19. Whereis command
Used to determine the location of the file. Specific usage: whereis + file name. For example, locate the file example.txt, using the following command: $whereis example.txt
20. Tar command
Tar is not only a common command in unix, but also a very important command. The tar command copies the files on the disk to the archival media (for example, floppy disk to hard disk, or hard disk to floppy disk), or restores the data recorded on the archival media to files on disk. The t ar command does not provide any recovery operation when an error is encountered.
The command format of tar:
# tar-cvf (or xvf) + file name + device
C-> is local to other devices
X-> other devices to the local
R-> is an addition (such as copying a t.txt and then a r.txt
Where a file (or folder) of tar uses the cvf parameter
Unlock the tar file and use the xvf parameter.
For example:
Tar the file in / home/test into / anw and tar it into exe.tar with the following command:
# tar-cvf / anw/exe.tar / home/test
Unlock the tar files and use the following command:
# tar-xvf / anw/exe.tar will extract the exe.tar to the path specified at the time of compression.
The extension of the tar command generation file can be arbitrary, for example: the generation file of test file can be test.a, test.b, test.tar.
21. Compress command and uncompress command
These two commands are used to complete compression and decompression. For example, running $compress test.tar compresses the test.tar file into a test.tar.Z file. Use the uncompress command when decompressing: $uncompress test.tar.Z
Note that if the absolute path is entered during compression, it will be automatically unzipped to the corresponding path when decompressed.
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 to which the file system exists, and the directory in which the file system mount goes. The specific syntax is as follows: the unit displayed by $df is 512k, and the unit of disk space displayed by the command $df-k is 1024k, that is, 1m. As follows:
$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 per cent / 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 per cent / var
/ dev/hd3 163840 158224 4% 68 1% / tmp
/ dev/hd1 5046272 713236 86% 9128 1% / home
23. Finger command
Used to display information about the currently logged in user. This command has the same function as the f command. The specific syntax is as follows:
$finger or $f
24. Last command
The last command is used to display previously logged in information. For example, last displays login information for all users in the most recent period of time. Including login time and process. If you specify to display a user's login information, you can use the l ast + user account. For example: $last user displays the login information of user.
25. Ifconfig command
Parameters used to configure or display the TCP/IP network interface. You can view the IP address with the following command:
$ifconfig-a displays the IP address on the RS6000.
26. Ping command
Used to test the physical connection of the network. The user sends an ICMP (Internet Control Message Protocal) to get an ICMP response from the host or gateway. To test the physical connection to a host with an IP address of 192.168.0.161, you can use 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 = 0Applink 0 ms
This situation indicates that a corresponding message has been received from 192.168.0.161, which proves that the physical connection to the host is normal.
If the following occurs, there is no connection to 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's ID, along with the session. For example, if the current user is user1, after executing $su-user2, the user ID becomes user2 and can complete the operation as user2. When creating users, you can choose whether or not to allow other users to su your users.
28. Ps command
Used to display the status of the currently running process. With different options, the user can query all running processes or all processes with the user's ID. Through the ps command, the user can know which processes are running in the background or all processes with the user ID. Through the ps command, users can learn about the processes that are running in the background and the batch processes that are running. When there are no parameters, only the executing processes created by the current terminal are displayed. $ps-A lists the details of the processes running on the system. $ps a lists all processes related to the terminal.
29. Echo command
Used to standard output strings. For example, to output Hello, you can use $echo Hello
In variable assignment statements, such as U=Hello, to output Hello, use $echo $U, note that the value corresponding to the output variable U is preceded by a $symbol.
30. Env command
The env command can be used to display the current environment or to set one or more environment variables. You can also run specified commands. Changes in the environment are only valid during the run of the command. For example, $env, you can view the currently set environment variables. Such as:
$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:.
LC__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
TZ=BEIST-8BEIDT
Oh, my God! LOGNAME
31. Passwd command
When the user logs in, the system requires the user to enter a user name and password. Although users do not have to set a password, most users use a password when they log in. If the user wants to change the password, you can use the p asswd command. When executing the passwd command, the system first asks the user to enter the current password, and then enters the new password twice in a row. The new password is valid only when the new password is entered the same two times. For example, change the password of l ong with 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
In order to enhance the security of directories or files, or to make directories and files accessible to others, users often have to modify the permissions of directories or files. In Unix, permissions use octal numbers (0 to 7) to specify permissions for a file or directory. There are three types of objects for use with directories or files:
Owner: the user who created the file
Group members: other members of the user group in which the owner belongs
Other users: other users who are neither the owner nor a member of the group.
The system uses an octal number to specify the permissions for each type of visitor object. For owners, group members, and other users, permissions on a file can be divided into read permissions, write permissions, and execute permissions. Each permission corresponds to one bit of data. That is, if the read bit is 1, the write bit is 1, the write bit is 1, and the execution bit is 1, it is executable.
Note that for directories, the function of performing bits is special. Users can access the contents of the directory by being executable, otherwise they cannot access the contents of the directory.
The combination of three bits of read, write and execution can represent an octal row number, in which the read bit permission is 4, write is 2, and execution is 1.
Remind the user again that when the execution permission of the directory, the access to the directory, that is, the permission to operate on the directory. If you have write permission to the directory, you can read, write, delete, and execute all files in the directory at will, without the restrictions of specific file permissions.
Using the chmod command, you can assign new weight values to a file or directory. For example, if you set the permissions of the file testfile to: the owner can read, write, and execute, group members can read, and other users can execute. Available commands: $chmod 741 testfile
When the user wants to set the permissions of the file testfile in the current directory to be readable and writable by the owner and group members, it can be executed: $chmod 660testfile
$ls-l
Total 202
-rw- 1 long system 287 Dec 28 14:56 mbox
Drwxr-xr-x 3 long system 512 Dec 29 15:05 mm
-rw-r--r-- 1 long system 59034 Dec 29 14:32 smit.log
-rw-r--r-- 1 long system 12668 Dec 21 16:19 smit.script
Drwxr-xr-x 3 long system 512 Dec 27 16:21 test
-rw-r--r-- 1 long system 10240 Dec 28 12:40 test.tar
-rw-r--r-- 1 long system 16949 Dec 10 13:24 websm.log
Notice the first column on the left, with the first character-for the file and d for the directory. The next nine characters, each of which is a group (octal), represent the user, the group in which the user belongs, and the read and write executable permissions of other users. Where r is readable, w is writable, and x is executable.
2.4 configure environment variables
The concept of environment is introduced in order to make users use shell,Unix conveniently and flexibly. The environment is some data that users can change, 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 variable, which can be browsed with the env command (with no parameters). The format and variable names of the output vary depending on 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:.
LC__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
TZ=BEIST-8BEIDT
Oh, my God! LOGNAME
$
Sometimes users have a lot of environment variables, so if you want to query only one of them, you can use the echo command. As mentioned earlier, in order to indicate that the entered character represents an environment variable, you must precede it with $. Note that there is no space between $and the following variable name, for example, using the echo command to display the value of the environment variable HOME:
$echo $HOME
/ home/long
$
Users can generate new environment variables by assigning values to environment variables, and they can change their original values by assigning values to existing environment variables.
2.5 Public Desktop Environment CDE
CDE, whose full name is Common Desktop Environment, or "public desktop environment", is a graphical interface manager. The prerequisite for using CDE is that the RS6000 is connected to a graphical display. Before using it, install the software packages X.11 and Dt. Rte and X11.Dt.helpinfo. During the installation process, the system sets CDE as the default user interface, so that after Aix starts, it will directly display the CDE registration interface, and enter the user registration name and password to enter the CDE operating environment.
2.6Kernel and shell of Unix
Unix kernel: it is the heart of the system, the core program for running and managing hardware devices such as disks and printers, and is located at the bottom of the operating system.
Shell is the user interface of the system, which provides an interface for users to interact with internal harmony. Shell has its own programming language for editing commands. It allows users to write programs made up of sh ell commands. Currently, shell has the following versions: BASH (Linux), K shell (Aix), C shell
2.7 hierarchical structure of the Unix file system
Unix manages resources in a file system manner. File system is divided into dynamic file system and static file system. Dynamic file systems: executable files, configuration files
Static file systems: operating system
The following is the basic hierarchy of the Unix file system:
/ 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
For the oracle video tutorial, please follow: http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.