Here are some exercises for Linux. This may be very simple for the great God, still hope not to spit groove.
The following exercises, may be wrong, but also hope that we can be a lot of advice ha ~ ~
One, the choice question
1. The following Linux distributions are compiled from the source code of Red Hat Linux (C)
A, Ubuntu B, Red Flag Linux C, CentOS D, Fedora
2, the following command-line operations from the normal user switch to Superuser, the correct is (C)
A, Cd/root B, Su-root C, su-d, CD root
3, the root user in the command line is identified as (C)
A, "$" B, "&" C, "#" D, "%"
4, the Linux command line, grep is handled _____, the basic syntax is (A)
A, regular expression, grep [option] pattern[file]
B, file lookup, grep [option] pattern[file]
C, regular expression, grep [file] pattern [option]
D, file Lookup, grep [file] pattern [option]
5, the following VIM edit operation is correct (B)
A, input open/home/example.txt, modify content, input: Wq;
B, input vim/home/example.txt, modify content, input: Wq;
C, input vim/home/example.txt, modify content, input: WP;
D, input vim/home/example.txt, modify content, input: q;
6. If you execute the command #chmod 746 file.txt, the file's permissions are (A).
A. Rwxr--rw-b. rw-r--r--C.--xr-rwx D. rwxr--r-
7, the command can be implemented to restart the Linux operating system (C).
A Init 0 B. Halt C. Shutdown-r D. Shutdown-h
8, the first partition of Linux's second hard disk should be expressed as: (B)
A./hda1 B. /hdb1
C./hdba D. /hda2
9. Use command find to locate the file with a. C at the end of the current directory, and the command to output the result to the standard output is (D)
A. Find. -name "? C "–print B. Find. -name "#.c" –print
C. Find. -name "!*.C" –print D. Find. -name "*.C" –print
10. How to create a new file: (C)
A. Mk hello.c B. RM hello.c
C. Touch hello.c D. New HELLO.C
11. Which of the following commands can be paginated to display large text files: (A)
A. More B. Cat
C. Type D. Less
12. When a directory is used as a mount point, the original file on the directory (B)
A, be permanently deleted B, hidden, to be mounted after the device is unloaded to restore
C, be put into the Recycle Bin D, be hidden, to be restored after the computer reboot
13, the use of VI edit text read-only, save and exit the command is. C
a:w! b:q! c:wq! D:wq
14, Linux file permissions total 10-bit length, divided into four paragraphs, the fourth paragraph of the content is (D)
A. Permissions of the group where the owner of the file is located B. Permissions of the owner of the file
C. File type D. Permissions of other users
15, storage equipment files Related documents directory: (A)
A./dev B./etc
C./lib D./bin
16, the CD-ROM/DEV/HDC uninstall command is (a)
A. Umount/dev/hdc B. Unmount/dev/hdc
C. Umount/mnt/cdrom/dev/hdc D. Unmount/mnt/cdrom/dev/hdc
17, drwxr-xr--corresponding figures are: (B)
A. 766 B. 754
C. 755 D. 645
18, in order to the current directory of all. TXT file package and compress archive to file this.tar.gz, we can use. A
A, Tar czvf this. tar.gz/*.txt B, tar./*.txt czvf this. tar.gz
C, Tar cxvf this. tar.gz./*.txt D, tar c xvf this. tar.gz./*.txt
19. In the Linux operating system, the command to assign an IP address and subnet mask for a network card named Eth0 is (B).
A. serserial eth0 202.112.58.200 netmask 255.255.255.0
B. ifconfig eth0 202.112.58.200 netmask 255.255.255.0
C. minicom eth0 202.112.58.200 netmask 255.255.255.0
D. Mount Eth0 202.112.58.200 netmask 255.255.255.0
20. In the VI Editor's command mode, the command to insert characters before the cursor position is: (C)
A. A B. A C. I D. I
21, which symbol added after the command can be in the background to execute the program: (B)
A. @ B. & C. D. *
22, if you want to load a/DEV/HDB1 WINDOWS95 partition to the/mnt/win95 directory, which command needs to run: (C)
A. Mount-t HPFS/MNT/WIN95/MNT/HDB1
B. Mount-t Hpfs/dev/hdb1/mnt/win95
C. Mount-t Vfat/dev/hdb1/mnt/win95
D. Mount-t VFAT/MNT/WIN95/DEV/HDB1
23, which of the following options is not a Linux system process type (D)
A, interactive process B, batch process C, daemon D, the Ready process
24. Which of the following statements is true? B
A. VMnet1 is a NAT network card for NAT connection
B. VMnet8 is a NAT network card for NAT connection
C. VMnet1 is a host-only network card that is used to connect networks in Host-only mode
D. VMnet8 is a host-only network card that is used to connect networks in Host-only mode
25. In the Redhat Linux system, which of the following commands can be used to mount a formatted disk or partition on a directory (D)
A.fdisk B.MKFS c.tune2fs D.mount
26. How to delete a non-empty directory/tmp (B)
A del/tmp/* B rm–rf/tmp C rm–ra/tmp/* D rm–rf/tmp/*
27, change the file owner's order for (C)
A chmod B. Touch C. Chown D. Cat
28, in the Long Format column directory, if the file test permissions described as drwxrw-r-, then the file test type and the file owner's permissions are (A)
A, directory files, read and write execution
B, directory files, reading and writing
C, ordinary documents, reading and writing
D, ordinary documents, reading
29, the first version of Linux version number is (C) version.
A 1 B. 0.1 C. 0.01 D. 0.001
30, with the standard output redirection (>), such as "> file01" can make the file file01 data (C)
A is copied B is moved c is covered D is printed
31, the file string is enclosed in single quotes, the shell will (C)
A Explains the special character B within quotation marks. Execute the command in quotation marks
C Special character D that does not interpret quotation marks. End Process
32, in red Hat Linux9 system default (A) users have full control over the entire system.
A. Root B. Guest C. Administartor D. Supervistor
33, which directory to store user password information (B)
A./boot B./etc C./var D. Dev
34, with VI to open a file, how to use the letter "new" to replace the letter "old" (a)
A.: s/old/new/g B.: s/old/new
C.: 1, $s/old/new/g D.: r/old/new
35. If you execute the command chmod 124 file.txt, the file's permissions are (B).
A Rwxr--rw-b. --x-w-r--C. --xr--rwx D. rwxr--r--
36. Which command can be used to find a line that contains only four characters in a file testfile? C
A. grep ' ^???? $ ' testfile B. grep '???? ' Testfile
C. grep ' ^....$ ' testfile D. grep ' ... ' Testfile
37, if you want to list all the files in a directory need to use the command line (C).
A. ls-l B. ls C. ls-a D. ls-d
38. The command to delete files in Linux is (C).
A CP B. MV C. RM D. Touch
39. Which of the following commands will add users to the root group when creating an XP user (C)
A. useradd-g xp root B. useradd-r root xp
C. useradd-g root xp D. useradd Root xp
40. Which of the following commands can terminate all processes of a user (D).
A. Skill all B. Skill C. Kill all
41. Which command can be used to delete a file named ' Core ' under the current directory and its subdirectories (a)
A. Find. -name core-exec rm {} \;
B. Find. -name Core-exec RM;
C. Find. -name core-exec rm {};
D. Find. -name core-exec RM {}-;
42,/dev/hda5 in Linux in the expression of what. B
A. Logical partitioning of the main disk on the IDE0 interface from disk B. IDE0 interface
C. The fifth partition on the main disk on the IDE0 interface. Extended partition from disk on IDE0 interface
43, Vim editor has (C) mode of operation.
A 1 B. 2 C. 3 D. 4
44, the function of the PWD command is what. C
A. Set the user's password B. Display the user's password
C. Displaying the absolute path of the current directory D. View files in the current directory
45, enter the "CD" command and press the ENTER key, what will be the result. C
A. Switch from current directory to root B. screen Displays current directory
C. Switch from the current directory to the user's home directory D. Switch from current directory to previous directory
46, in the following partitions, the Linux default partition is (B)
A. FAT32 B. EXT3 C.fat. Dntfs
47. Which of the following commands can terminate all processes of a user (D)
A, Skillall B. Skill C. Kill D. Killall
48, with "Rm-i", the system will indicate what to let you confirm. B
A. Each option of the command line B. Is it really deleted
C. Permission to write D. Location of files
49. Assume that a file Test.txt contains the following lines:
He's a rat
He's in a rut
The food is rotten
I like Root Beer
The output of the grep r.t Test.txt is (a).
A He's a rat
He's in a rut
B He's a rat
C He's in a rut
D I like Root Beer
50, Linux shell programming in the expression (B).
A The first column of text B. First positional parameter
C The first function name D. Number 1
51. In the Redhat Linux system, which of the following commands can be used to view process information (A).
A PS B. Mkfs C. TUNE2FS D. Mount
52. The command to find files in Linux is (a).
A Find B. CD C. LS D. Su
53, which of the following options are stored in Linux process information (C).
A /bin B. /home C. /proc D. /boot
Two, fill in the blanks question
1, in the Linux system, the way to access the device. File
2, Linux is divided into graphical interface and command line mode. Gnome/guicli/bash
3, in the Vim last line mode, the Exit command for, save and Exit command for. : Q:wq
4, the/home/stud1/wang directory to do archive compression, compressed after the generation of wang.tar.gz files, and save this file to the/home directory, to achieve the task of the TAR command format. Tar-zcvf/home/wang.tar.gz/home/stud1/wang
5, create a new user, UID is 666, the subordinate group is NASH_SU, user name is TestUser2, the way to create is:. Useradd-u 666-g Nash_su TestUser2
6, Groupadd command to create the group "Linuxcast":. Groupadd Linuxcast
7, Groupmod command to modify the "Linuxcast" as "linuxnew":. Groupmod-n linuxnew Linuxcast.
8. The command to view all the interface information of the Ethernet connection is:. Ifconfig-a
9, in shell programming, there are two types of variables:. Local variables and environment variables
10, the foreground START process use terminates. CTRL + C
11, in the Linux two link files, only to achieve a link to the file one way is:. Soft links (Symbolic links)
12, in the VI editing environment, the use of keys for conversion between the mode ESC
13, the process of operation there are two ways, that is. Run independently and using the parent process
14. If you want to modify the access rights for/HOME/USER12/ASD.C files to have all permissions for all users, the corresponding Linux command is:. chmod 777/HOME/USER12/ASD.C
15. The device file corresponding to the first partition of the first hard disk is. /dev/hda1
16, the so-called permission is to specify who can use which file or directory and the use of permissions. It is usually divided into the following 3 kinds:. R Read, w write, x execution
17. Any computer system is made up of two parts:. Computer hardware, computer software.
18, Linux can match all the three-digit 100~999 from the regular expression is. [1~9] [0~9] [0~9]
19, generally speaking, processor scheduling can be divided into 4 levels: ___. Job scheduling, switching scheduling, process scheduling, thread scheduling
20, for a process of memory space, can be logically divided into 3 parts:. Code areas, static data areas, and dynamic Data areas
21, the permission of a file is: d-rw-_r--_r--, in numeric form to indicate that permission _____, the file property is _____. 644, Directory
22. The shell automatically sets the exit status of the last executed command to the shell variable ___, which can be displayed on the terminal with the _____ command $?, Echo
23, ___ directory used to store the management program used by the system administrator. Sbin
The following is the result of performing fdisk–l after you insert the USB connector into the U disk. The command to mount the U-disk to the/MNT/USB is _________. Mount/dev/sdb1/mnt/usb
24. The command to kill a process in Linux is. Kill
25, Linux awk programming "domain" refers to the number of fields that are used in awk to record each record, and the number of rows in awk that is used to record each record.
An entry in a record, NF,NR
26, Linux to create a process of the C language function is. Fork
27, the Linux file system is a reverse-like structure. Tree Three, judgment question
1, correct in Linux, to see the contents of the file can use the "more" command.
2, the error will temporarily change the user identity as root is login.
3, the correct file.tar.gz to extract the command is TAR-ZVXF file.tar.gz.
4. The correct ls-l/home can display the file specific information in the home directory.
5, the correct grep command can implement the string lookup function.
6, the correct Linux file system to be mounted before use.
7, the error MV command can move files and directories, you can also copy files.
8, error has two files Test1 and test2,test2 have content, now execute cat test1>>test2, then test2 file content all deleted.
9. Correct Linux is a truly multitasking and time-sharing operating system that allows multiple users to run many programs at once on the same machine.
10. We can use FG command to transfer the rigid process to the front desk.
11, the error in order to allow other users to use the CD command to enter the directory, the directory needs to set other users Read permissions.
12, the error to open a file with VI, using the command: S/old/new to use "new" to replace the letter "old"
13. The correct export command is used to define the global variables of the shell.
14, the correct Linux file system is a directory tree.
15. When the network configuration is wrong, the service Netwok Restart command is used to test the connectivity between the hosts in the network.
16. Error in shell programming, all variable names are made up of strings, but variables need to be declared.
17, correct in Linux red files are generally compressed files.
18, error has two files Test1 and test2,test2 have content, now execute cat test1>>test2, then test2 file content all deleted.
19, the wrong firewall is mainly used to prevent viruses.
20, the correct shell is not only a user command interpreter, it is also a powerful programming language.
21, error VMware in the host-only mode of network configuration, then Linux can access the extranet.
22, correct VMware in the use of NAT network configuration, Windows need to select the virtual network card vmnet 8.
23, the correct Linux user information is mainly stored in the/etc/passwd file.
24. The correct use of the RM command to delete a folder needs to be added with parameter-R.
25, error Linux shell programming with ${#数组名 [*]} can get the entire contents of the array.
26, Error Linux, a user can not belong to multiple user groups.
27. The correct grep command is a text search tool that prints out the matching rows. The grep full name is global Regular Expression Print, which represents the global regular expression version, and its use permissions are all users.
28. Error Linux programs and processes are the same thing.
29. In the wrong Linux programming, the creator of the file must be the owner of the file.
30, error has two files Test1 and test2,test2 have content, now execute cat test1>>test2, then test2 file content all deleted. Four, simple answer
1, describe what the Linux system has significant features or characteristics.
(1) Compatible with UNIX (2) free software, open source (3) High performance, strong security (4) Easy customization and redevelopment (5) High interoperability.
Or
(1) Open (2) multiuser (3) multitasking (4) Good user interface (5) device Independence (6) provides rich network functionality (7) reliable system security (8) Good portability
2, in the/etc/passwd file, each row of user records include what information. How to separate from each other.
Each line of user records includes information: registration name, password, user identification number, group identification number, user name, user home directory, command interpreter. Each message is separated by ":".
3, in the Linux system, the root directory contains what content. What their respective functions are. List at least 8.
(1) Bin: An executable program that contains binary files.
(2) Sbin: Store commands for managing the system.
(3) Boot: A variety of files used to store the boot system.
(4) Etc: Very important, it contains many Linux system configuration files.
(5) Dev: A special file containing a device that is used to access all the different types of hardware in the system.
(6) Home: Is the user's starting directory base directory.
(7) MNT: The installation point where the installation file system is stored.
(8) USR: contains multiple subdirectories, which save important programs on the system for all users to share.
(9) Var: includes data to be changed when the system is running normally.
(a) Lib: A shared library that is used by the Save program at run time.
(one) root: is a directory of Superuser.
() TMP: A temporary file that is used to store a program's runtime generation.
4, please describe the Linux shell for I in ' ls ' meaning.
' ls ' indicates that all the file names in the current directory are listed, for i ' ls ' means let the variable I get all the file names in the current directory in sequence.
5. The responsibilities of the system administrator include those. What is the managed object.
System administrators are responsible for system resource management, device management, systems performance management, security management, and systematic performance monitoring. The management object is the server, the user, the server process and the system various resources and so on.
6, a brief description of several Linux operating level and its corresponding meaning.
0-shutdown mode,
1-single-user mode, single user only system administrator can log in.
2-multiuser mode, but does not support file sharing, for example, does not support NFS services. This pattern is not commonly used.
3-Full multiuser mode, support for NFS services. The most commonly used user mode, default login to the system's character interface.
4-retention mode.
5-Full multi-user mode, the default login to the X-window system, that is, login to the Linux graphical interface.
6-reboot mode, which is to perform shutdown of all running processes, and then reboot the system.
7, try to explain the contents of the following information-rwxr-xr--1 root root 599 CEC 17:12 FF
Reference answer: Ordinary documents, the owner can read, write, execute, the same group of users can read, execute, other people can only read. Owner is root, group name root, file length 599 bytes, Last modified time CEC 10 17:12, file name ff
8, what is the symbolic link (soft link), what is the hard link. What is the difference between a symbolic link and a hard link?
Reference Answer: Links are divided into hard links and symbolic links (soft links). Symbolic links (soft links) Create links to files and directories. Symbolic links (soft links) can span the file system, that is, you can partition across partitions. The file type bit of the symbolic link (soft link) is L, and the linked file has a new I node. Hard links cannot be cross file systems. It can only establish a link to a 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.
9, say the meaning of the following order
Reference answer: ①chmod o+rx a1.txt Allow other users to read and execute files a1.txt
②chmod A-rx A1.txt cancels all user readable and executable files A1.txt
③chmod g+x,o-x a1.txt Set file A1.txt to the same group executable, canceling other users to execute permissions
④chmod u=rwx,g=rx,o=r A1.txt the text