Linux basic questions

Source: Internet
Author: User
Tags ftp file valid email address domain lookup ftp file transfer
Linux basic questions-Linux general technology-Linux technology and application information, the following is a detailed description. I. Fill in blank questions

1. links are divided into hard links and symbolic links.
2. When installing Linux to partition hard disks, there must be two partition types: file system partition and swap partition.
3. the kernel is divided into four subsystems: Process Management System, memory management system, I/O Management System, and file management system.
4. The vi editor has two working modes: Command mode and input mode.
5. DNS is actually a database of host information distributed on the internet. Its function is to convert IP addresses and host names.
6. Two main protocols used by the Sendmail system are SMTP and POP. The former is used to send emails and the latter is used to receive emails.
7. The mv command can move files and directories, and rename files and directories.
8. shell is not only the interpreter of user commands, but also a powerful programming language. Bash is the default shell of Linux.
9. The command for adding a user is adduser or useradd.
10. When manually configuring the network, you can change the host name by modifying the/etc/HOSTNAME file. to configure the domain name resolution client of the computer, you need to configure/etc/resolv. conf file.
11. There are two types of backup on Linux: system backup and user backup.
12. There are two ways to run a process: independent running and parent running.
In the vi editing environment, use the esck to convert the code into a format. If you want to store the file in the test.txt file, type w test.txt in command mode.
14. The pipeline uses the standard output of the previous command as the standard input of the next command.
15. DHCP is short for the Dynamic Host Configuration Protocol. It is used to allocate IP addresses in the network step by step.
16. The rm command can delete files or directories. The main difference is whether to use the recursive switch-r or-R.
17. When manually configuring the network, you can change the host name by modifying the/etc/HOSTNAME file. to configure the domain name resolution client of the computer, you need to configure/etc/resolv. conf file.
18. The ping command is used to test network connectivity. The ping command is implemented through the ICMP protocol.
19. When installing a Linux System for hard disk partitioning, there must be two partition types: ext3 and swap.
20. In Linux, The/etc directory is used to store the configuration files and subdirectories required by the system, and the/sbin directory is used to store the management programs used by the system administrator.

2. Write the command to complete the following functions.
1. Delete all files and folders in non-empty folders/daisy: rm? R/daisy
2. Change the file a.txt to B .txt: mv a.txt B .txt.
3. Load the USB flash drive content to the/mnt/udisk Folder: mount? T vfat? O iocharset = gb2312/dev/sda1/mnt/udisk
4. Change the user root password. (At the # prompt): passwd root
5. view the local Website: ifconfig eth0
6. In the/root folder, find the file with the suffix. c: find/root? Name \ *. c
7. terminate a process with process number 1001: kill 1001
8. view the installed rpm software package: rpm-qia
9. Run B .txt: cp a.txt B .txt ON THE a.txt file.
10. view the mkdir help document: man mkdir
11. compress the/home/stud1/wangdirectory and generate the wang.tar.gz file. Save the file to the/home directory tar-zcvf/home/wang.tar.gz/home/stud1/wang.
12. Check whether the installed file system/dev/had5 is normal. If the check is incorrect, it will be automatically repaired: fsck? A/dev/had5
13. To send 10 packets to test the connectivity with the host abc.tuu.edu.cn: ping abc.tuu.edu.cn? C 10
14. When the parent directory does not exist, create the parent directory command: mkdir? P
15. To make the file named fido have the following permissions-r-xr-x command: chmod 551 fido
16. In the/root folder, find the file with the suffix ". cpp": find/root? Name \ *. cpp
17. Command Used to disable linux (do not restart): halt
18. Command for uninstalling the CD/dev/hdc: umount/dev/hdc
19. If stud1 is known to a user, its user directory is/home/stud1. If the current directory is/home, run the/home/stud1/test command: cd stud1/test.
20. view the help documentation for music videos: man Music

Iii. Short answer questions.
1. What are the responsibilities of the system administrator? What are managed objects?
System Administrators are responsible for system resource management, device management, system performance management, security management, and system performance monitoring. Management objects are processes of servers, users, servers, and various resources of the system.
2. What is Static Routing and its characteristics?
Static Routing is defined in the route table designed and constructed by the system administrator. Suitable for networks with a limited number of gateways and the network topology does not change frequently. The disadvantage is that the network condition cannot be dynamically applied. When the network condition changes, the network administrator must modify the route table.
3. What is dynamic routing and its characteristics?
Dynamic Routing is dynamically built based on the routing selection protocol. The routing protocols update the content of the route table in real time by exchanging their own routing information. Dynamic Routing automatically learns the topology of the network and updates the route table. The disadvantage is that the route broadcast update information occupies a large amount of network bandwidth.
4. Briefly describe Network File System NFS and describe its function.
Network File System is an application service at the application layer. It is mainly used for file or directory sharing between Linux and Linux systems, Linux and Unix systems. Users can easily access the remote file system through NFS, making it part of the local file system. After NFS is used, the logon process is saved, which facilitates user access to system resources.
5. What commands are used for viewing and scheduling processes?
The command for viewing processes is ps and top.
Process Scheduling Commands include at, crontab, batch, and kill.
6. When the file system is damaged, how do I check and repair the system?
To successfully repair a file system, you must have more than two primary file systems and ensure that the file system to be repaired is uninstalled before the restoration. Use the command fsck to repair the damaged file system. Fsck checks the file system in five steps. Each step checks the connection characteristics of different parts of the system and verifies and modifies the previous step. When executing the fsck command, check that the disk block, path name, directory connectivity, number of links, idle block linked list, And I-node are allocated starting from the super block.
7. What are symbolic links and hard links? What is the difference between a symbolic link and a hard link?
Links are divided into hard links and symbolic links. Symbolic Links can be used to establish links to files and directories. Symbolic Links can be used across file systems, that is, cross-disk partitions. The file type bit of the symbolic link is l, and the linked file has a new I node.
Hard links cannot be used across file systems. It can only establish links to files. The type bits of hard links are-, and the I nodes of hard links are the same as those of the connected files.
4. analyze calculation questions.
1. Try to describe the process initiation and termination methods and how to view the process.
In Linux, there are two ways to start a process: Manual start and scheduling start:
(1) Manual start
The user issues a command at the input end to start a process directly. It can be divided:
① Foreground startup: directly enter the command in SHELL to start.
② Start the background: Start a non-urgent process, such as a printing process.
(2) start scheduling
The system administrator schedules the system resources and processes in advance to specify the time and occasion for running the task. The system will automatically complete the task at that time.
Commonly used process scheduling Commands include at, batch, and crontab.
2. Try to describe the DNS domain name resolution process.
First, the client sends a DNS request to translate the IP address or host name. After the DNS server receives a request from the client:
(1) Check the DNS server cache. If the request address or name is found, a response message is sent to the client;
(2) If the request is not found, search in the database. If the request address or name is found, a response message is sent to the client;
(3) If no query is made, the request is sent to the root domain DNS server, and the top-level domain is queried from the root domain in sequence. The top-level lookup second-level domain and second-level domain lookup third-level domain, the DNS server sends a response to the DNS server in the network where the client is located. After receiving the response, the DNS server stores the response in the cache and sends the resolution result to the client.
(4) If no error is found, an error message is returned.
3. A line in A/etc/fstab file is as follows:/dev/had5/mnt/dosdata msdos defaultsusrquota 1. Please explain its meaning.
(1) first column: name of the file system to be loaded;
(2) Column 2: Installation points of the file system;
(3) Column 3: file system type;
(4) Column 4: set parameters;
(5) Column 5: used by the backup program to determine the number of days from the last backup to the present;
(6) Column 6: Check the file system sequence during system boot.
4. What should a common user do to regularly back up/user/backup to the/tmp directory at 00:00 every Sunday?
(1) Method 1:
Should the user use crontab? E command to create the crontab file. The format is as follows:
0 0 ** sun cp? R/user/backup/tmp
(2) Method 2:
Create a file in your directory. The file content is as follows:
0 ** sun cp? R/user/backup/tmp, and then execute crontab file to make it take effect.
5. What are the two logon methods for file transfer using ftp? What are their differences? What are common ftp File Transfer commands?
(1) ftp has two logon modes: Anonymous logon and authorized logon. For anonymous logon, the username is anonymous and the password is any valid email address. For authorized logon, the username is the user account in the remote system, the password is the user password in the remote system.
Difference: Anonymous logon can only access resources under the ftp directory. By default, the configuration can only be downloaded. The authorized logon permission is greater than anonymous logon, and can be uploaded or downloaded.
(2) There are two ftp file transmission modes: ASCII mode and binary mode. ASCII mode is used to transmit text files, while other files are transmitted in binary mode.
(3) commonly used ftp file transmission Commands include bin, asc, put, get, mput, mget, prompt, and bye.
6. Try to describe the DNS domain name resolution process.
First, the client sends a DNS request to translate the IP address or host name. After the DNS server receives a request from the client:
(1) Check the DNS server cache. If the request address or name is found, a response message is sent to the client;
(2) If the request is not found, search in the database. If the request address or name is found, a response message is sent to the client;
(3) If no query is made, the request is sent to the root domain DNS server, and the top-level domain is queried from the root domain in sequence. The top-level lookup second-level domain and second-level domain lookup third-level domain, the DNS server sends a response to the DNS server in the network where the client is located. After receiving the response, the DNS server stores the response in the cache and sends the resolution result to the client.
(4) If no error is found, an error message is returned.
7. Use Shell programming to determine whether a file is a character device file. If it is copied to the/dev directory.
#! /Bin/sh
FILENAME =
Echo "Input file name :"
Read FILENAME
If [-c "$ FILENAME"]
Then
Cp $ FILENAME/dev
Fi

8. A system administrator needs to do some repetitive work every day. Prepare a solution according to the following requirements:
(1) Delete All subdirectories and all files under the/abc directory;
(2) From ~ At pm, all data in the first domain of each line in the x1 file under the/xyz directory is read to the bak01.txt file under the/backupdirectory;
(3) archive and compress all directories and files under the/data directory as files at every Monday: backup.tar.gz;
(4) uninstall the CD-ROM of the IDE interface at PM (assuming the device name of the CD-ROM is hdc );
(5) Start the instance before a.m.
(1) Use vi to create and edit a crontab file named prgx;
(2) prgx file content:
50 16 * rm-r/abc /*
0 8-18/1 *** cut-f1/xyz/x1>;/backup/bak01.txt
50 17 *** tar zcvf backup.tar.gz/data
55 17 *** umount/dev/hdc
(3) log on to the Super User and use crontab to execute the content in the prgx file:
Root @ xxx: # crontab prgx; crontab can be automatically started after it is started up before every morning. Automatically Start crontab.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.