Linux face questions

Source: Internet
Author: User
Tags diff gz file time and date domain lookup

  1. In a Linux system, access the device as a file.
  2. When the Linux kernel boots, read the file system to be loaded from the file/etc/fstab
  3. Each file in the Linux file system is identified by the I node.
  4. All disk blocks consist of four parts, namely the boot block, the private block, the I node table block, and the data storage block.
  5. Links are divided into: hard links and symbolic links.
  6. The super block contains important file system information such as the I node table and the free block table.
  7. The permissions for a file are: drw-r-r--, (r-4, 2-2, X-1), which represents the permission in numeric form, the octal number is: 644, and the file's properties are directory.
  8. The foreground-initiated process is terminated using CTRL + C.
  9. After the static route is set, if the network topology changes, the system administrator should modify the routing settings.
  10. The important tasks of network management are: control and monitoring.
  11. When installing a Linux system on a hard disk partition, there must be two types of partitions: File system partition and swap partition.
  12. The script file must be given permission to execute before the shell program is written.
  13. One of the tasks of system management is the ability to secure, backup, restore, and update programs and data in a distributed environment.
  14. The system swap partition is an area of system virtual memory.
  15. Kernel sub-process management system, memory management system, I/O management system and file management system, such as four subsystems.
  16. The user ID and user name are uniquely identified for each user.
  17. The RIP protocol becomes the dynamic routing protocol and is the most common internal protocol.
  18. All content in a Linux system is represented as a file, and various methods of organizing files are called file systems
  19. DHCP can implement dynamic IP address assignment.
  20. The VI editor has two modes of operation: Command mode and input mode.
  21. You can use the Ls–al command to view the permissions of a file, each file has 10-bit permissions and is divided into four segments, where the first segment is 1 bits, the file type, and the second segment is 3 bits, indicating the file owner's permissions on the file.
  22. The difference between the process and the program is that its dynamic, dynamic generation and termination, from the generation to the termination process can have the basic state: the Operation state, the ready state and the waiting state (blocking state).
  23. DNS is actually a database of host information distributed over the Internet, and it is implemented to convert between IP addresses and host names.
  24. There are two types of backups that can be made on Linux systems: System backup and user backup. The former is a backup of the operating system, which refers to the backup of the application and user files.
  25. The command to limit the user's use of disk space is quota.
  26. In a Linux system, the directory used to store the configuration files and subdirectories required for the system is/etc.
  27. Hard links can only establish links to files. Symbolic links can be created across different file systems.
  28. The command to end a background process is kill.
  29. A process runs in two ways, running independently and using the parent process.
  30. All the processes running on the Linux system are displayed under Superuser, with the commands and parameters Ps–aux.
  31. Use the standard output of the previous command as the standard input for the latter command, called a pipeline.
  32. Specifies the execution rights for the script the ear command and parameters are chmod a+x filename.
  33. The command to log on remotely is telnet.
  34. The DNS server's process is named named, and when it starts, it automatically loads the DNS partition database files defined in the named.conf file in the/etc directory.
  35. The Apache server process configuration file is httpd.conf.
  36. In a Linux system, the command to produce a suffix. gz file after compressing a file is gzip.
  37. When editing a file with VI, the contents of the file are stored in the Test.txt file and should be typed in command mode: w test.txt
  38. Commands and parameters that can display the full year calendar on standard output are cal–y.
  39. In a Linux system, a client command that tests whether a DNS server can correctly resolve a domain name is nslookup.
  40. Under the Linux system, the hard drive (slave disk) of the second IDE channel is identified as a HDB.
  41. The RM command can delete a file or directory, the main difference being whether to use a recursive switch –r or-R
  42. The MV command allows you to move files and directories, and also to rename files and directories
  43. The ping command is used to test the connectivity of the network, and the ping command is implemented via the ICMP protocol.
  44. With >;>; The symbol attaches the output redirect content to the back of the source text.
  45. The command to add a user is: AddUser or Useradd.
  46. For string lookups, use the grep command.
  47. Connection-oriented protocols are Transmission Control Protocol
  48. The cut command intercepts the data for the specified content from each line of the text file.
  49. NFS is a network file system
  50. The TR command can be used to perform backup to tape in the Linux security system.
  51. The files of the Linux file system are placed in the relevant directory according to their function, and in the case of external device files, they should be placed in the/dev directory.
  52. When you restart the Linux system and write the information in memory to the hard disk, you should use the # shutdown–r now command.
  53. This paper briefly introduces the working process of transforming the logical structure and physical structure of the file through the I node in Linux file system: Linux transforms the logical and physical structure of the file through the I node table. The I node is a 64-byte long table that contains information about the file, including the size of the file, the owner of the file, how the file is accessed, and the type of the file, among other important information. The most important content in the I node table is the disk address table. There are 13 block numbers in the disk Address table, and the files will read the corresponding blocks sequentially in the order in which they appear in the Disk Address table. Linux file system by connecting the I node and file name, when the need to read the file, the file system in the current directory table to find the corresponding entry of the file name, so that the file corresponding to the I node number, through the I node's disk address table to the scattered file physical block connected to the logical structure of the file.
  54. Briefly describe the start of a process
  55. How to terminate and how to view the process: Starting a process in Linux has two methods: (1) manual start: The user issues commands at the input and starts a process directly. Can be divided into: 1. The foreground starts and the command is entered directly into the shell. 2. Background transfer: Initiate a process that is not currently urgent, such as a printing process. (2) Scheduling start: The system administrator according to the system resources and processes occupy resources, advance scheduling, specify the time and place for the task to run, then the system will automatically complete the task. The frequently used process scheduling commands are: At, batch, crontab.
  56. Describes the process of DNS for domain name resolution: First, the client sends out a DNS request to translate the IP address or host name. After the DNS server receives the client's request: (1) checks the cache of the DNS server and, if the requested address or name is found, sends a reply to the client. (2) If not found, then find in the database, if the requested address or name, that is, to send a reply to the client. (3) If not found, the request is sent to the root domain DNS server, and sequentially from the root domain to find the top-level domain, the top-level lookup two-level domain, two-level domain lookup three-level domain, until the address or name to be resolved, that is, the DNS server on the network to send the response information, the DNS server received Then, the parsing results are sent to the client. (4) If not found, an error message is returned.
  57. What are static routes and what are their characteristics? What is dynamic routing and what is its characteristic? A static route is a route that is defined by a routing table that is designed and built by the system administrator. The network that adapts to the limited number of gateways, and the network topology structure does not change frequently. The disadvantage is that it cannot adapt dynamically to the change of network condition, and the routing table must be modified by network administrator when the network changes. Dynamic routing tables are dynamically constructed by routing protocols, and routing protocols update the contents of the routing table in real time by exchanging the routing information they own. Dynamic routing can automatically learn the topology of the network and update the routing table. The disadvantage is that the routing broadcast update information will occupy a large amount of network bandwidth.
  58. What commands are used for the view and dispatch of the process separately? The commands that the process looks at are PS and top, and the process scheduler commands are at, crontab, Batch,kill.
  59. What are symbolic links and what are hard links? What is the difference between a symbolic link and a hard link? Symbolic links can establish links to files and directories. Symbolic links can span file systems, which can be partitioned across disks. The file type bit for the symbolic link is 1, and the linked file has the new I node. Hard links can not cross file systems. It can only establish a link to the file, the hard-link file type bit is--and the hard link file's I node is the same as the I node of the linked file.
A concise tutorial on Linux command line
  1. Any one system is divided into the core layer and the application layer. The core layer directly operates the hardware device, and arranges the management of various software execution, and manages each user who uses the computer. The application layer generally uses the interface provided by the core layer to work.
  2. A feature of the Linux system: multi-user. In this system, there can be multiple users, who may have their own directories and can use or even control different parts of the system.
  3. Root is an account that is set up by the Linux system for system maintenance.
  4. A Linux system is a preemptive multitasking system with a priority for each process.
  5. Each program that a computer executes is called a process.
  6. The directory system under Linux is a reason mount system unites the directory system under each partition into a tree-like whole.
  7. Links are divided into two symbolic links and hard links. A symbolic link should be a file that has a relative path to the destination file for the link, and the file is accessed automatically by a relative path when accessing the file. If the relative path is not valid, the symbolic link is also invalid.
  8. System files, such as directories and files in/bin and/usr/bin, are the owner of root. The owner of the catalogue and documents created by the individual is the creator himself. Directories and files also have the concept of "all groups", which is the group where the owner resides.
  9. The kernel of Linux uses ANSI internal code.
  10. LS---Lists files, lists directories and files, like the dir command for Windows. Usage: ls [parameter] [filename]
  11. Parameters:-A lists hidden files, which are files that begin with.-D may find the corresponding directory when using wildcards to find the file, LS will display the contents of the directory,-H can make the method of displaying the file size more "humanized";-l enumerate the file's permissions, size and other details;-L when I encounter a link, Displays the location of the real files;-r sort by flashback;-R recursively enumerates the files in all subdirectories under a directory;-S is sorted by file size;-T is sorted by the file's last modified time;-X is arranged by file extension to find the same type of file.
  12. The CD---Change the current directory. Usage: cd [directory] ... represents the current directory,.. Represents a previous level of directory. Do not add parameters to the home directory.
  13. PWD---show current directory
  14. File---identify files. Usage: file [parameter] [filename] .... Parameter:-Z If the file is compressed, try to obtain the original file type;
  15. Cat---Displays all the contents of the file. Usage: cat [parameters] [filename] .... Parameters:-B Displays line numbers for non-empty rows only;-e displays the character of $ at the end of each line;-n Displays line numbers for all rows.
  16. You can enter many file names in turn, separated by spaces. These files are then exported sequentially. In order to be able to read the output by screen, you can use the more command
  17. Head/tail---Display the contents of the file before and after, head by default displays the first ten lines of the file, and Taqil by default displays the following 10 lines of the file. Usage: head/tail [parameter] [filename] .... Parameters:-C n Displays the contents of the pre (post) n bytes; n n Displays the contents of the front (last) n rows.
  18. OD---Special file Display tool. Usage: od [parameter] [file name]. Parameters:-A RADIX indicates the output of the information in which location of the output data is in the file;-j BYTES skips BYTES bytes at the beginning of the file, then outputs;-n BYTES reads only the BYTES bytes of the file;-t TYPE selects the output style;-W BYTES Specifies the number of words to output per line. The radix options are: D decimal output, O octal output, x hexadecimal output, n not output. The options for type A are: a according to the character output, some of which cannot output the control (ASCII code less than 32) the name of the output control character, c ASCII characters, if not output, the output C format in the notation of \; d size in size bytes, Convert data from each unit into a signed integer.
  19. mkdir---Create a directory. Usage: mkdir [parameter] directory name. Parameter:-P can build a very deep subdirectory through this command, it will automatically establish the corresponding parent directory structure without error.
  20. RmDir---Delete the directory, the parameters are the same as mkdir. Only empty directories can be deleted.
  21. RM---Delete files or directories. Usage: RM [parameter] File name/directory name. Parameters:-I prompt each time the deletion;-R deletes the entire directory, along with a bunch of subdirectories;
  22. The MV---is not just for moving files. Usage: MV [parameter] source file purpose Location [+ file name]. Parameters:-B If the destination file exists (that is, there is a duplicate name), then create a backup, this backup is the source file names plus a ~ symbol;-F forcibly move, overwrite the file when the destination file exists, default option;-I and-F instead, once to overwrite, ask if you agree;-U updates the move, Only the source file moves later than the last modification date of the destination file or the destination file does not exist;-V shows the moving process.
  23. cp-copy files. Usage: CP [parameter] source file destination file. Parameter:-h When copying a file, if the link is encountered, it is copied together with the original file pointed to by the link;-l does not copy the file, but the corresponding hard link;-l copy it with the symbolic link;-p is copied with all attributes, including the last modification time.-P and –l, If the symbolic link is broken, it is forced to copy;-r–r copies the entire directory tree;-s just establishes the corresponding symbolic link.
  24. ln-Creating Links
  25. Searching for files in the find-file system
  26. The difference between locate and find is that the Find command searches for files by accessing the file system, while the locate command accesses the database to search for files.
  27. Search for the specified string within the grep-file
  28. diff-comparing files by row: Compares the size of two text files. Usage: diff [parameter] file 1 file 2. Parameters:-I ignores the difference in case,-E ignores tab tabs cause the difference,-B ignores the difference that is greater than one continuous space, and-B ignores blank lines, and the all of the spaces do not;-D try to find the same place, i.e. try to find the intersection of two files;-R compares two directories. And even the files in the subdirectory are compared, and the-Y is compared in two columns. The original file is displayed in the two columns of the screen corresponding to the comparison;-p shows which C function is where the difference occurs
  29. cmp-compare Files by byte. Usage: cmp [parameter] file 1 file 2 [-I [Skip 1] [Skip 2]]. Parameters:-B outputs different places, output as characters;-I skips a few bytes at the beginning of two files, determined by [Skip 1]. If there is [Skip 2] exists, then skip [Skip 1] bytes to the first file, skip [Skip 2] bytes to the second file, and-l will output all the different, by default, as long as there is a difference, stop the comparison;-N bytes only compare the previous bytes so much content, The bytes is calculated as bytes.
  30. comm.-comparison of sorted files: Two files sorted by row compared to the ordered one. Usage: Comm [parameter] file 1 file 2. Parameters:-1 do not output [file 1] specific wording;-2 do not output [file 2] specific language;-3 do not output a total of two files in common
  31. whereis-find the directory where the command is located: Whereis searches only for system commands. Usage: whereis [parameters] command. Parameter:-B searches only the executable file;-m searches only the command's man document;-S only searches the source code of the command.
  32. Which---a light whereis.
  33. Gzexe/bzexe---executable file compression. Usage: gzexe/bzexe [parameter] [filename]. Parameter:-F unzip the file, no parameter represents the compressed file. The file name after compression is the same as the original file, and the original file filename is appended with the ~ to show the difference
  34. Gzip/gunzip---LZW compression. Usage: gzip [parameter] [filename] gunzip [file name]. Gzip Parameters:-L Displays the contents of the compressed file, that is, unzip the file to the screen;-R compresses the contents of the subdirectory, and-v displays the file name and compression ratio of the files being compressed;-T verifies the integrity of the compressed file;-L The fastest compression, compression ratio is very low; G best compression, compression ratio is very high But it's slow.
  35. Tar---File packager. Usage: tar [parameter] [file name]. Parameters: The following is the main parameter, after each tar command must be followed by a:-A to add the file to the tar package;-C to create a new tar package;-D to compare the files in the tar package and the file system;-delete Delete the contents of the tar package;-T lists the contents of the tar package;-R Add files at the end of the tar package;-U compares the files in the tar package to the file system, replaces the modified date with the new files in the tar package, and the-X extracts the files from the tar package. The following are auxiliary parameters:-f Specifies the name of the tar file for the operation, and automatically outputs to the screen if not specified;-H does not contain linked files, but instead joins the real files they point to,-j uses bzip2 to compress the files before adding the tar package;-K does not change the existing files; Displays the name of the file being processed;-Z using Gzip/gunzip to process the tar file
  36. Zip/unzip---zip compression. Usage: Zip [parameters] [zip file name] [original file] and unzip [parameter] [ZIP file name] [filename to unzip]. Parameters: The parameters of the zip:-u update file;-d delete the files in the zip package;-R contains the files in the subdirectory;-M moves the files to the package. Zip does not resemble gzip, the original file will be deleted after compression, 1 fast compression;-9 slow compression;-V shows the details of the compression process;-T toilet compression pack. Unzip parameters:-L do not press the file, only display the file list;-t test compression package;-D directory is extracted to the directory directory;-x file extracts files other than
  37. df-cares about the porcelain disk space tool. Usage: DF [parameter]. Parameters:-H with G, M, K and other marks to facilitate reading;-T displays the format of the file system.
  38. date-Time and date
  39. Who-Show Active Users
  40. WHOAMI---show current user
  41. PS---show list of processes
  42. nice-Set Process Run priority
  43. PIDOF---Show the sequence number of the process
  44. FG/BG---front office switch
  45. Whatis---Display simple command annotations
  46. man-user manual for display commands
  47. Complete Manual for info---command

Linux face questions

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.