Home > Article > System Tutorial > Daily practice: Linux basic knowledge exercises - counting IPs in very large files
Binetd.conf
Crc.samba
Dsmb.conf
8. The files in the Linux file system are placed in relevant directories according to their functions. For external parties
The device file should usually be placed in the (C) directory.
A/bin
B/etc
C/dev
D/lib
9. Among the following formulations, the one that does not fall within the scope of the ifconfig command is (D).
A Configure local loopback address
BConfigure the IP address of the network card
CActivate network adapter
DLoad the network card into the kernel
10. The Linux system sends messages to other users through the (C) command.
Aless
Bmesgy
Cwrite
Dechoto
11. The online help command of Linux system is (D).
A.tar
B.cd
C.mkdir
D.man
12. Start the process from the backgroundSuper large file statistics ip linux, you should add the symbol (A) at the end of the command.
A&
B@
C
#D$
13. Regarding the dns server, the correct statement is (D).
Adns server configuration does not require client configuration
When building a dns server for a certain partition, you only need to build a main dns server
CThe primary dns server needs to start the named processSuper large file statistics ip linux, but the secondary dns server does not need to
The root.cache file of the Ddns server contains information about the root subserver
14. To write the information in the video memory to the hard disk while restarting the Linux system, use the (D) command to achieve this.
A#reboot
B#halt
C#reboot
D#shutdown–rnow
2. Fill in the blanks
1. There are two ways to start the process: automatic startup and scheduled startup. The commonly used commands for scheduled startup are
at, batch and crontab.
2. In addition to being a class library for user commands, shell is also a powerful programming language
Word. bash is the default shell of Linux.
3. In Linux system, access the device as a file.
4. If a permission is expressed numerically, the eight's complement number is 644, and the file attribute is a directory, use
Thecharacters represent permissions: drw-r--r--.
5. In the Linux system, the command to generate a file with the suffix .gz after compressing the file is gzip.
6. Pipeline is to use the standard output of the previous command as the standard input of the next command.
7. The command to add a user is: adduser or useradd.
8. A complete list of linux commands when the linux kernel boots, read the file system to be loaded from the file /etc/fstab.
9. When installing a Linux system, use the netconfig program to configure the network. This should be done
The installation program will prompt the user step by step to enter necessary information such as host name, domain name, domain name server, IP address, gateway address and subnet segment.
10. The process of the DNS server is named named. When it starts, manually load the
in the /etc directory.The DNS partition database file defined in the named.conf file.
11. When editing a file with vi, to save the file content into the test.txt file, you should press
in the command mode.Enter: wtest.txt.
12. When configuring the network manually, you can change the host
by changing the /etc/hostname file.Computer name, if you want to configure the domain name resolution client of this computer, you need to configure the /etc/resolv.conf file.
13. In the Linux system, the directory used to store the configuration files and subdirectories required by the system is
/etc.
14. To search for strings, use the grep command.
15. DNS is actually a database of host information distributed on the Internet. Its function is to implement IP
Conversion between address and hostname.
3. Short answer questions
1. Briefly describe some of the more famous Linux distributions?
2. What are the characteristics of Linux system?
3. Linux system directory structure?
4. Briefly describe the several components of XWindow and the functions of each part.
Communication between servers, clients, communication channels, servers and clients
5. What is Shell and what are its functions?
Answer: Shelllinux multi-thread programming is a command line interpreter, which provides a command line-based interactive interface between the user and the operating system. The user enters commands on the command line, and SHELL interprets them and sends them to the operating system for execution.
6. (1) Create a new directory soft under user gordon’s personal directory.
(2) And search for all files and directories starting with h under the path /etc, and copy them to soft.
(3) Please complete all the contents in the soft directory into a tar package and name it soft.tar.gz.
Answer: (1) mkdir/home/gordon/soft
(2)cp-r/etc/h*.*/home/gordon/soft
(3)tar-zcvfsoft.tar.gz/home/gordon/soft
7. There is the following sentence in the /etc/rc.d/rc.inet1 file of a Linux host. Please correct the error and explain
Explain its content.
ROUTEadd–netdefaultgw192.168.0.101netmask255.255.0.0metric1ROUTEadd–net192.168.1.0gw192.168.0.250netmask255.255.0.0metric1 Answer: Fix the error
(1) ROUTE should be capitalized: route
(2) The subnet segment should be 255.255.255.0
(3) The subnet segment of the default route should be changed to 0.0.0.0
(4) The default route should be set last, otherwise the routes next to it will be invalid.
Explanation content
(1)route: Build static routing table command
(2) add: add a new route
(3)-net192.168.1.0: The network address to reach the target network
(4)default: Build a default route
(5) gw192.168.0.101: Network segment address
(6) metric: The number of hops passed to reach the target network router
8. Please elaborate on the function of RPM command?
9. (1) Reduce the two group accounts group1 and group2, and specify the group account IDs as 10100 and
respectively.10101. (2) Reduce the two user accounts user1 (UID is 2045 and belongs to group group1) and user2 (UID is 2046 and belongs to group group2).
Answer: (1)
groupadd-g10100group1
groupadd-g10101group2
(2)
useradduser1-u2045-ggroup1
useradduser2-u2046-ggroup2
10. Please write the commands for each step according to the following requirements:
(1) Create a new normal user ray and log in as ray user.
(2) View all contents under the /etc/boot path.
(3) View the contents of the file /etc/hosts.
(1)useraddray
passwdray
su-ray
(2)ls-a/etc/boot
(3)cat/etc/hosts
11. What commands are used to view and schedule processes?
The commands for process viewing are ps and top.
The commands for process scheduling include at, crontab, batch, and kill.
12. On the Linux system you are using, what is the content in the root directory? What are their respective functions?
Answer: /root: root user’s home directory, /dev: device file, /media: media, /mnt: mount, /usr: user program, /bin: system application, /user/bin: user Application, /home: home directory of other users, /boot: startup file, /lib: library file.
13. How to count the usage and idle status of the c drive space in the system.
df-h Check the usage of c drive;
4. Comprehensive design questions
1. A system administrator needs to do certain repetitive work every night. Please prepare a solution based on the following requirements
plan:
(1) Delete all subdirectories and all files in the /123 directory at 5:50 in the morning;
(2) Read the first domain of each line in the x1 file in the /456 directory every hour from 9:00 am to 5:00 pm
All data is added to the bak01.txt file in the /bak directory;
(3) Every Monday morning at 4:50, all directories and files in the /data directory will be archived and compressed into files: backup.tar.gz;
(4) Uninstall the CD-ROM from the IDE socket at 4:55 in the morning (assuming the device name is hdc);
(5) Start after turning on the computer before 8:30 at night.
solution:
(1) Use vi to create and edit a crontab file named prgx;
(2) Contents of prgx file:
5017***rm-r/123/*
09-17/1***cut-f1/456/x1>;>;/bak/bak01.txt
5016**1tarzcvfbackup.tar.gz/data
5516***umount/dev/hdc
(3) Log in as the super user and use crontab to execute the contents of the prgx file:
root@xxx:#crontabprgx; You can manually start crontab2 and shell programming after turning on the computer before 8:30 every morning
The above is the detailed content of Daily practice: Linux basic knowledge exercises - counting IPs in very large files. For more information, please follow other related articles on the PHP Chinese website!