Text.1
1. In CentOS, check to see if the Ext4 file system has been installed and mount the partition/dev/sad5 is normal, if it fails, what are the commands and parameters that can be automatically repaired?
Fsck-a/DEV/SAD5
2. Please describe the philosophical thinking of Linux.
1. All Documents
2. Consists of a multitude of small, single-function programs that can accomplish complex tasks:
3. Save the program's configuration information using a plain text file;
Provide user authentication
4. Try not to interact with the user
3. How to delete files that have not been accessed for more than 30 days in the current directory.
Find-atime +29 | Xargs RM-RF
4. Write out the layers names and functions of the OSI Reference model?
1) Application layer: Provides network services for application processes (e-mail, file transfer)
2) Presentation layer: Data representation:
Ensure that the receiving system can be alone with the data, format the data, build the data, negotiate the data transfer syntax for the application layer, provide encryption
Turn information that people can read into information that computers can read
3) Session Layer:
Inter-host communication: Point-to
Establish, manage, and terminate sessions between applications
4) Transport Layer
1. Ensure the reliability of data transmission
2. Establish maintenance and termination of virtual circuits
3. Pass error detection and recovery
4. Information flow control to ensure reliability
5.sed '/^[[:space:]]\*$/d ' file
6. How do I get the history command to record and display the exact time of the command execution?
1. Temporary display
[Email protected] ~]# export histtimeformat= "%F%T"
[Email protected] ~]# history
1 2017-06-08 19:03:43mount-o REMOUNT/MNT/B1
2 2017-06-08 19:03:43QUOTACHECK-CUMG/MNT/B1
3 2017-06-08 19:03:43df-h
4 2017-06-08 19:03:43mount
5 2017-06-08 19:03:43LS/MNT/B1
2. Permanent display
Edit/ETC/BASHRC File
Add histtimeformat= "%F%T"
Export Histtimeformat
Save and exit, exit the current shell and log on again.
7. Briefly describe the working principle and characteristics of the three working modes of RAID0,RAID1,RAID5.
Categories of disk Arrays:
An external disk array:
The longest is used on large servers, with the characteristics of heat exchange, but the prices of such products are very expensive.
An internal disk array:
The price is cheap and requires high installation technology. The hardware array can provide online expansion, dynamic modification of array level, automatic data recovery, drive roaming, ultra-high-speed buffering and other functions. It delivers performance, data protection, reliability, availability, and manageability solutions. Array card-specific processing unit for operation.
Using software to simulate:
Refers to the disk management function provided by the network operating system itself to configure multiple hard disks on the attached common SCSI card into logical disks to form an array. Software arrays can provide data redundancy, but the performance of the disk subsystem will be reduced, some of the decrease is still relatively large, up to 30% or so. This will slow down the speed of the machine and is not suitable for large data traffic servers.
RAID0:
Strip Reel
Advantages: Increase the capacity of the hardware in full times
Cons: No redundant fault tolerance, if one disk is damaged, all data is unusable
Use a minimum of two disks
RAID1:
Mirrored volumes
Advantages: Good redundancy and fault tolerance
Cons: The cost is multiplied, the disk utilization is only 50%,
Requires at least two disks
RAID5:
Distributed parity for independent disk structures
Improved read and write performance
Need to calculate checksum information
Free space: (N-1) *min (s1,s2,...)
Fault tolerance: Allow up to 1 disks to be damaged
Minimum number of disks: 3,
8. List the compression and decompression commands commonly used by several Linux system midfielders.
Gzip:
gzip, Gunzip, zcat-compress or expand files
-D: Unzip
-#: Compression with the specified compression ratio, 1-9,9 to the highest level; default 6
-C: The compression results are output to standard output, the original file will not be compressed;
Gzip-c/path/to/file >/path/to/compress_file.gz
BZIP2:
bzip2, bunzip2-a block-sorting file compressor, v1.0.4
bzcat-decompresses files to stdout
-D: Unzip
-#: Specify compression ratio for compression, 1-9, default is 6
-K: Keep the original file not deleted, create a new compressed file;
Xz
XZ, UNXZ, xzcat-compress or decompress. xz files
-D: Unzip
-#: Specify compression ratio for compression, 1-9, default is 6
-K: Keep the original file not deleted, create a new compressed file;
There is a row in the 9./etc/fstab file
/DEV/VOLGROUP/LOGVOL/EXT3 fefaults 1 1 The meaning of each field.
/dev/volgroup/logvol Mounting Equipment
/mount point
Ext3 File System type
FEFAULTS specifies that the file system that loads the device is a specific parameter option that needs to be used, and that multiple parameters are separated by a tease
RO load the file system in read-only mode
Sync does not buffer the write operation of the device
User allows a normal user to load the file system
Quota forcing a disk quota limit on this file system
1 This option is used by the "Dump" command to check how fast a file system should dump, if not required, 0;
1 This field is used by the fsck command to determine the order of the file systems that need to be scanned at startup, the file system should have a value of 1 for the field, and the other file system should be 2. If the file system does not need to start
The field is set to 0 when the scan is
10.VI Editor is a pattern-based full-screen editor, please describe its specific working mode?
Last-line mode, insert mode, edit mode, visualization mode, replacement mode
11. What is the difference between a soft connection and a hard link?
Hard Links:
The data block pointer points to the file of the same data block;
Cannot create hard links across file systems
Catalog files cannot create hard links
Increasing the Inode reference count each time a hard connection is created
Symbolic links (Soft links)
The file used to store the path to the linked file
Can be created across file systems
You can also create a table of contents
Two sets of paths must be found each time
12. Please explain the following terms of the mechanical disk: track, sector, cylinder.
Track: When the disk is rotated and the head remains in one position, each head will draw a circular trajectory on the disk surface called the track.
Cylinder: In a disk group consisting of multiple platters, a cylindrical face consisting of a surface of different platters, but a plurality of tracks in the same radius circle.
Sector: Each track on a disk is divided into segments that are sectors of the hard disk (Sector). The first sector of a hard disk, called a boot sector
What are the user interfaces provided by the 13,centos system? What are the usual?
Cli:bash
Ksh
Sh
Gui:gnome
Kde
XFACE
14.
In a large Linux version of a rhel or CentOS system, which files are the default user account and group account authentication and parsing libraries? and describes
The meaning of each field of the user account authentication library.
Authentication Library for user accounts:/etc/shadow
User Account Parsing Library:/etc/passwd
Certification library for group accounts:/etc/gshadow
Analytic Library of group accounts:/etc/group
Authentication Library for user accounts:/etc/shadow:
Login name:encrypted password:date of last password change:minimum password age:maximum password age:password wa rning Period:password Inactivity period:account expiration date:reserved field
Login Name: User's login name;
Encrypted Password: encrypted password
Format: $ algorithm $salt$ true meaning of encrypted password
If the location is!, the user's password is disabled, if the location is *, the user is a system user, cannot log on, or if the field is empty, the user can log into the system without entering a password;
Date of last password change:
Relative time concept, relative to the number of days from January 1, 1970 to the date the password was last modified;
Minimum password Age:
How long the password cannot be changed, the default value is 0, meaning: At any time can change the password, if it is not 0 of the other numbers, meaning that in such a long period of days can not change the password;
Maximum password Age:
After how long the password expires, the default is 99999, meaning that it is permanently valid;
Password Warning Period:
The number of friendly reminders days before the password expires, default to 7 days;
Password Inactivity Period:
The grace period after the password expires, the default is-1, meaning the permanent grace period;
Account Expiration Date:
A user account password expires on the date, which is an absolute expiration period, xxxx/xx/xx;
Reserved field:
Keep The fields for later use;
15. Please write out the metacharacters of the basic regular expression and its meaning;
*: 0 Goods multiple The ordinary character that appears before the * character
Example: Example: Hel*o can represent helo, hello, Helllo, etc.
.: matches any character (matches only a single character)
For example:. 7 can indicate that any single character starts with a string that ends
^: The beginning of the line anchor or the character behind the non-
Example: ^you matches lines that begin with you
$: End of line anchoring
Example: you$ matches lines ending with you
[]: Match character set and
For example: [0-9] matches the MO characters between 0-9
\: Escape character, masking the special meaning of a meta-character
\<\>: Exact match symbol
For example:\<you\> exact match you this word
\{n\}: Matches the preceding character stringing n times
Example: Yo\{3\}u repeat character o appears 3 times
\{n,\}: Matches the preceding character at least n times
For example: yo\{3,\}u repeat character o appears at least 3 times,
\{n,m\}: Matches the preceding character appears n-m times
Example: Yo\{3,5\}u Repeat character o appears at least 3-5 times
16. Please indicate that in the assignment operation of variables, let var2=var1++
Var2=++var1 the difference between two assignment statements?
Let var2=var1++: Assign value first and then calculate
Let VAR2=++VAR1: First operation and then assignment
17. What are the common ways to declare arrays in bash?
1.declare command
Declare-i Name: Declares the name as an integer variable;
Declare-x Name: Declares the name as an environment variable;
Declare-a Name: Declares the name as an indexed array (if supported);
Declare-a Name: Declares the name as an associative array (if supported);
Declare-a name= ("value1" "value2" "value3" ...)
Declare-a name= ([0]= "value1" [1]= "value2" [5]= "Value3" ...)
2. Declare the array directly:
Assign a value directly to an array:
Array_name= ("value1" "value2" "value3" ...) declare a dense array;
Array_name= ([0]= "value1" [1]= "value2" [5]= "Value3" ...) declares a sparse array;
To define the elements of an array and create an array:
Array_name[0]=value1
Array_name[1]=value2
Cases:
1. Array values:
Adobe= (' Flash ' Flex ' Photoshop ')
Echo ${adobe[0]}
# Print
# Flash
2. Array Length:
Using the special subscript "@", you can extend the array into a list, and then you can use the operator "#" in bash to get the length of the variable to get the number of elements in the array:
Adobe= (' Flash ' Flex ' Photoshop ')
echo ${#adobe [@]}
# Print
# 3
3. Getting part of an array
Adobe= (' Flash ' Flex ' Photoshop ' "Dreamweaver ' Premiere ')
Echo ${adobe[@]:1:3}
# Print
# Flex Photoshop Dreamweaver
Echo ${adobe[@]:3}
# Print
# Dreamweaver Premiere
4. Link two arrays
Adobe= (' Flash ' Flex ' Photoshop ' "Dreamweaver ' Premiere ')
adobe2= (' Fireworks ' Illustrator ')
Adobe3= (${adobe[@]} ${adobe2[@]})
echo ${#adobe3 [@]}
# Print
# 7
Common features of 18.bash
1. References 2. Alias of the Command 3. Shortcut 4. Command completion
5. Deployment of the command line
6. Execution status result of the command "
7. Wildcard characters
8. Command history
9. Variables
10.IO redirection
11. Piping
Configuration file for 12.bash
13. Escape function
19. Please explain the meaning of the device number of the hardware facility.
Major: The main device number, distinguishing the type of device, used to indicate the driver required by the device;
Minor: Secondary device number, distinguish the same type of different devices, is a specific device access to the portal;
20.bash have you bought those configuration files? Briefly describe its role.
The role of the configuration file: so that we rely on the configuration information can be long-term effective, as long as not modify the contents of the configuration file, each time the shell opened to make the previous configuration to take effect;
Profile class:
Global: A configuration file that is valid for all users;
/etc/profile
/etc/profile.d/*.sh
Note: In the Rhel or CentOS series of operating systems, typically, if a configuration file a lot of content, the format is complex, we will cut it into multiple fragments, the cut out of the pieces of the unified in the "program name. D" directory, in such a directory to save the fragment file, Most of them are named by the unified file suffix name;
User personal: Just a valid profile for a user;
~/.bash_profile
The profile class configures the role of the file:
1. Used to define the user's environment variables;
2. Used to run scripts or execute commands;
BASHRC class:
Global:
/etc/bashrc
User personal:
~/.bashrc
The BASHRC class configures the role of the file:
1. Used to define local variables;
2. The alias used to define the command;
3. Definition of umask;
Note: Only Superuser root can modify the configuration file of the global class, and ordinary users can only modify the personal profile in their home directory;
The following configuration files are loaded sequentially by the interactive logon shell process:
/etc/profile--/etc/profile.d/*.sh--and ~/.bash_profile--~/.BASHRC--/ETC/BASHRC
For non-interactive logon shell processes, the following configuration files are loaded in order:
~/.BASHRC--/ETC/BASHRC-/etc/profile.d/*.sh
Note: All commands executed at the command line, as long as no file modifications are involved, are generally valid only for the current shell life cycle, as long as the shell process is complete and all settings are invalidated;
Linux Learning Second Quiz