Note: switch from chinaunix
Original article:Http://bbs.chinaunix.net/forum/8/050409/527573.html
Common system maintenance configuration files
1./etc/hosts
The host name resolution file that corresponds to the Host Name and IP address.
2./etc/passwd
Password File with the following content:
Logon Username: encrypted password: User ID: Group ID: retain: initial working directory: Shell path
3./etc/group
Content:
Group Name: encrypted password: Group ID: all users in the group.
4./etc/profile
If this file exists, each user will execute this file upon logon. This file is generally used to set some common environment variables. If the. profile file exists in the user's home directory, the user's. profile file will be executed after/etc/profile is executed.
5./etc/inittab
After internal initialization, the system starts the deamon process/etc/init so that the/etc/init process has control over the boot sequence. The INIT process obtains instructions from the file/etc/inittab (init table, initialization table). The content of this file controls all the init states, and also controls the regeneration of dead processes.
6./etc/fstab
Information of the file system that can be mounted in the system.
7./etc/lvmtab
Run the following command:
# Strings/etc/lvmtab; view system VG and disk information.
8./etc/rc. config. d/netconf
Contains the system name and network configuration information, such as the IP address, subnet mask, and route information.
9./STAND/System
Contains the system driver and subsystem information, kernel device information, and some system adjustable parameter information.
Basic System maintenance commands
1) tail and head
You can use the tail command to view the end of the file, and the head command to view the file header.
# Tail filename
# Tail-f filename; enables tail to run continuously. When a file is written, the new row of the file is displayed.
# Head filename
2) date and Cal
The cal command displays the calendar.
# Cal 2000
# Cal1 2000
3) find
The find command is one of the most powerful commands, but it is also one of the most difficult commands to grasp the command line structure.
# Find/-print | WC-l displays the number of all files and directories in the system.
# Find/-user $ LOGNAME-print: displays all files and directories of the user in the system.
# Find/-size 100-print: the file size is 100 blocks.
# Find/-size-100-print: the file size is smaller than 100 blocks.
# Find/-size + 100-print: the file size is greater than 100 blocks.
# Find/-name core-exec RM {}/; find and delete the core file.
# Find.-exec chown $ LOGNAME {}/; modify the user of all files in a directory.
# Find.-type D-exec chmod 770 {}/; modify the permissions of all directories in a directory.
4) stty
This command is used to check and modify the communication parameters of the user's current registered terminal.
# Stty-A; view the communication parameters of the currently registered terminal.
# Stty-ixon; Set ixon to off.
# Stty ixon; Set ixon to on.
# Stty sane; when the terminal is chaotic, it can usually produce beneficial results.
5) tset
Set the terminal type.
Tset-S-Q-m ':? HP'
6) Cron
Cron (chronography, timing), wake up every minute, view the control file to determine whether there is a job to be run at that time, and run it if there is.
# Crontab filename; create a Cron
# Crontab-R; remove cron from crontab
Crontab is located in the/var/spool/cron/crontabs directory. The Cron file name of each user is the user name.
7) ioscan
# Ioscan-FN (using this command, we can see information about all devices and their files .)
For example: view the device files for the CD-ROM
# Ioscan-fncdisk
Class I h/W path driver S/W State H/W type description
========================================================== ======================================
Disk 6 4.8.0 sdisk claimed device Seagate st34371w
/Dev/DSK/c0t8d0/dev/rdsk/c0t8d0
Disk 7 4.11.0 sdisk claimed device Seagate st34371w
/Dev/DSK/c0t11d0/dev/rdsk/c0t11d0
Disk 5 16/5. 2.0 sdisk claimed device Toshiba CD-ROM XM-5401TA
/Dev/DSK/c3t2d0/dev/rdsk/c3t2d0
Http://www.uxma.com/sheke/news/pic/8.swf
The device described as "toshba CD-ROM XM-5401TA"
Is the CD-ROM, the device file is/dev/DSK/c3t2d0.
8) BDF
This command is used to check the usage of the file system.
# BDF
Filesystem Kbytes used avail % used mounted on
/Dev/vg00/lvol1 67733 35561 25398 58%/
/Dev/vg01/lvol1 20480 11675 8247 59%/home
Meaning of each column:
Filesystem: File System name
Kbytes: number of bytes, in K
Used: used space
Avail: available space
% Used: Percentage of used space in the total space of the file system.
Mounted on: installation directory
Note: When % used reaches 90% or more, necessary file cleanup should be considered
9) lanscan
Run the lanscan command to view the NIC in the host. For example:
# Lanscan
Hardware station crd hdw net-interface nm Mac HP-DLPI dlpi
Path address in # state nameppa ID type support mjr #
10/4/8 0x00108318e6e8 0 up lan0 snap0 1 ether Yes 119
10/12/6 0x0060b0c44462 1 up lan1 snap1 2 ether Yes 119
The preceding command shows that there are three NICs in the host. Their related parameters are as follows:
The hardware addresses are 10/4/8 and 10/4/12 respectively (hardware path)
Nic names are lan0 and lan1 (net-Interface Name columns)
The nmid of each network adapter is 1 and 2 (nmid column)
The working statuses of each network adapter are up, down, and up (HDW state columns)
The MAC address of each Nic is the column corresponding to the station address.
To enable a network adapter to work normally, the network-interface name must be up.
Run the ifconfig command to view the IP address of the NIC. For example:
# Ifconfig lan0
Lan0: Flags = 863 <up, broadcast, notrailers, running, multicast>
Inet 15.85.114.14 netmask fffff800 broadcast 15.85.119.255
The IP address on the LAN 0 is 15.85.114.14 (Inet), The subnet mask is ffff800, and the broadcast address is 15.85.119.255.
10) ifconfig
# Ifconfig lan0
Lan0: Flags = 863 <up, broadcast, notrailers, running, multicast>
Inet 15.85.114.14 netmask fffff800 broadcast 15.85.119.255
The IP address on the NIC lan0 is 15.85.114.14 (Inet), The subnet mask ffff800, and the broadcast address.
15.85.119.255
11) change the Host IP Address
1. First, use the "lanscan" and "ifconfig" commands to find the device name of the NIC.
2. Run the VI command to edit the/etc/rc. config. d/netconf file. Find
Interface_name [0] = lan1
Ip_address [0] = ""
Subnet_mask [0] = ""
Broadcast_address [0] = ""
Change the original IP address and subnet_mask to a new value.
3. Use the VI command to edit the/etc/hosts file and change the IP address of the corresponding host name.
4. Note: Do not directly change the IP address in the CDE environment. Exit the CDE environment and complete the modification process.
Http://www.uxma.com/sheke/news/pic/8.swf
The device described as "toshba CD-ROM XM-5401TA"
Is the CD-ROM, the device file is/dev/DSK/c3t2d0.
8) BDF
This command is used to check the usage of the file system.
# BDF
Filesystem Kbytes used avail % used mounted on
/Dev/vg00/lvol1 67733 35561 25398 58%/
/Dev/vg01/lvol1 20480 11675 8247 59%/home
Meaning of each column:
Filesystem: File System name
Kbytes: number of bytes, in K
Used: used space
Avail: available space
% Used: Percentage of used space in the total space of the file system.
Mounted on: installation directory
Note: When % used reaches 90% or more, necessary file cleanup should be considered
9) lanscan
Run the lanscan command to view the NIC in the host. For example:
# Lanscan
Hardware station crd hdw net-interface nm Mac HP-DLPI dlpi
Path address in # state nameppa ID type support mjr #
10/4/8 0x00108318e6e8 0 up lan0 snap0 1 ether Yes 119
10/12/6 0x0060b0c44462 1 up lan1 snap1 2 ether Yes 119
The preceding command shows that there are three NICs in the host. Their related parameters are as follows:
The hardware addresses are 10/4/8 and 10/4/12 respectively (hardware path)
Nic names are lan0 and lan1 (net-Interface Name columns)
The nmid of each network adapter is 1 and 2 (nmid column)
The working statuses of each network adapter are up, down, and up (HDW state columns)
The MAC address of each Nic is the column corresponding to the station address.
To enable a network adapter to work normally, the network-interface name must be up.
Run the ifconfig command to view the IP address of the NIC. For example:
# Ifconfig lan0
Lan0: Flags = 863 <up, broadcast, notrailers, running, multicast>
Inet 15.85.114.14 netmask fffff800 broadcast 15.85.119.255
The IP address on the LAN 0 is 15.85.114.14 (Inet), The subnet mask is ffff800, and the broadcast address is 15.85.119.255.
10) ifconfig
# Ifconfig lan0
Lan0: Flags = 863 <up, broadcast, notrailers, running, multicast>
Inet 15.85.114.14 netmask fffff800 broadcast 15.85.119.255
The IP address on the NIC lan0 is 15.85.114.14 (Inet), The subnet mask ffff800, and the broadcast address.
15.85.119.255
11) change the Host IP Address
1. First, use the "lanscan" and "ifconfig" commands to find the device name of the NIC.
2. Run the VI command to edit the/etc/rc. config. d/netconf file. Find
Interface_name [0] = lan1
Ip_address [0] = ""
Subnet_mask [0] = ""
Broadcast_address [0] = ""
Change the original IP address and subnet_mask to a new value.
3. Use the VI command to edit the/etc/hosts file and change the IP address of the corresponding host name.
4. Note: Do not directly change the IP address in the CDE environment. Exit the CDE environment and complete the modification process.