Day 8 interview questions

First, the choice (2 points)

##### 1.1 set super user root current directory is: After the / usr / local, type cd command, current directory user (B)

A: / Home B: / the root C: / Home / the root D: / usr / LOCA
##### 1.2 Three view files the Linux command, if desired reviewing a document process can be used to move the cursor up and down to view the file content, use the command (C)

A: CAT B: More C: less D: Me
##### 1.3 In the Linux system, the system used to store the required configuration files and subdirectories are (A)

A: / etc B: / var C: / the root D: / Home
##### 1.4 the Linux file system security files are placed in different categories related to its role in the directory, file for an external device, generally should be placed (C) directory

A: / bin B: / etc C: / dev D: / lib
##### for 1.5 Unless otherwise specified, cp file to be copied is assumed in the following that directory (D)
A: the user directory B: home directory C: root directory D: current directory
at ##### 1.6 vi editor in command mode, type (B) can be added to a new row in the cursor is currently located.
A: B A: O C: ID: A
##### 1.7 (D) command to intercept the data from the specified content file each line of text.
A: CP B: C dd: FMT D: Cut
##### 1.8 Press (A) can terminate a key command
A: ctrl -c B: ctrl -f C: ctrl -b D: ctrl -d
##### 1.9 Find the given file consistent with the condition and find the command string corresponding to the command file as a directory: (C)
a: B grep: the gzip C: Nd Fi
##### 1.10 the following Links description, the error is (B)
a: hard link is to make the link file pointing to the i-node number of the i-node link file B: hard and symbolic links are generating a new node i C: link divided into hard and symbolic links D: hard links can not link directory files

Second, the principle question

##### 2.1 bash commonly used shortcut keys (2 points)
Ctrl + c to terminate the current running programs
ctrl + l clear screen
ctrl + w words or conduct by the space delete forward
ctrl + -> press the word to the right
crrl + <- move left by word
ctrl + a cursor jumps to the beginning of the line
ctrl + e cursor jumps to the end of the line
ctrl + z temporarily into the background
ctrl + u cursor before deleting all contents
of all content after deleting the cursor ctrl + k
ctrl + r command had been executed search
##### 2.2 What are the common characteristics bash?
###### tab key completion, command shortcuts,
###### command aliases, history command history,
man help manual,
##### (2 points) 2.3 What is GNU, what is the GPL
# ##### GNU is free software operating system, GPL copyright license agreement common
action ##### (3 points) 2.4 the following directories (7.5)
directory where Bin average user command
boot system kernel and bootloader more in directory
dev directory device files
etc directory profile
Tmp temporary files directory
home ordinary user's home directory   
  points mnt temporary mount     
directory of third-party software package resides opt
proc virtual file system, stored processes and kernel information directory
directory usr system software and related user program is located
root directory where super administrator 
    run the process of storing information about files
directory where the command sbin administrator
lib library directory     
var can changing data

DESCRIPTION command process ##### 2.5 (2 min)
if the command is determined by the absolute path ###### executing
###### alias determines whether there is an alias command
###### determines a user input a built-in command or external command
###### internal commands executed directly detect the presence of an external command buffer
###### Find command by $ PATH variable, there is executed without error
##### 2.6 What It is the absolute path, what is the relative path (2 points)
###### absolute path: all paths to the root of the
###### relative path: a path relative to the current directory beginning of the
##### 2.7 Brief He said the difference between soft and hard-wired connection (2 points)
###### soft link is a shortcut for Windows, if you delete the source files will affect the soft link.
###### hard link is equivalent to a copy of the source file, if you want to delete a file must remove all the hard links and file so that the file will be completely removed
### 2.8 vim several modes, each are What to do (2 points)

1. Normal Mode: mainly to control cursor movement, the text can copy, paste, delete, and so on.

###### When using vim filename edit a file, enter the file is a normal mode of.
###### In this mode, the cursor can be moved, copied, deleted, paste operation.

2 Edit Mode ####: mainly text editing and modifications
###### enter the edit mode from the normal mode, you simply press a button (i, I, a, A , o, O)
###### when entering the edit mode, the bottom line of the screen will appear "INSERT" mark
###### from edit mode back to normal mode simply press the ESC key to the upper left of the keyboard.

#### 3 line mode: used to save or exit the text.
###### In the normal mode, enter a ":" or "/" to enter command mode.
###### In the command mode, the operation can be performed, in the display line numbers, search, replace, save and exit.
##### 15 2.9 write command learned (15 minutes)
##### 2.10 The following special meanings represented by the symbols (2.5)
. The current directory
.. on a directory
/ root
# hypervisor members of prompt
$ prompt ordinary users

Third, the command title

##### 3.1 Create a directory / old / boy / (2 points)
mkdir -p / old / boy /
##### 3.2 using a command to create bgx1.txt in / old / boy / directory, bgx2.txt , bgx3.txt three documents (2 points)
Touch / old / boy / Bax {1..3} .txt
3.3 to copy all the contents / old / boy / ##### to the directory / root / directory ( 2 points)
CP -R & lt / old / Boy / / the root /
##### to 3.4 / old directory moved to / tmp / (2 points)
Music Videos / old / / tmp /
##### 3.5 of the I am student input into /root/bgx1.txt in (2 points)
echo >> "the I AM student" / root / bgx1. TXT
##### 3.6 /root/bgx1.txt view the contents of a file (four methods) ( 4 points)
CAT /root/bgx1.txt
More /root/bgx1.txt
less /root/bgx1.txt
vim /root/bgx1.txt
which file types (2 ##### 3.7 View / tmp / old / belong points)
file / tmp / Old /
All content (2 points) at ##### 3.8 delete the / tmp directory
rm -fr / tmp /
under 3.9 ##### delete / root of all files beginning with a (2 points)
rm -fr a

##### 3.10 View / etc / 7th and 8th row (3 points) passwd file
sed -n '7,8'p / etc / passwd
##### 3.11 Clear Command History (3 points)
History -c
##### 3.12 upload files from Windows to centos system what command (3 points)
rz
##### 3.13 /root/bgx1.txt how to download the file to the windows system (3 points)
sz /root/bgx1.txt
##### 3.14 how to compare the contents of two files What is the difference (in two ways, and outlined the difference between two kinds of ways) (6 points)
vimdiff diff
vimdiff more clearly, with intuitive view their difference
##### 3.15 Ali known source address http://mirrors.aliyun.com/repo/Centos-7.r epo download it to the etc / directory and name under yum.repos.d Centos -7.repo (3 points)
wget -O /etc/yum.repos.d/CentOS-7.repo http://mirrors.aliyun.com/repo/Centos-7
how to install ##### 3.16 vim ( 3 points)
yum the install Vim -Y
##### 3.17 creates a flexible connection etc etc-test (3 minutes) in / tmp / directory
ln -s / tmp / etc / tmp / etc-test
How to view all files ##### 3.18 (3 points) in the home directory
LS -a ~
##### 3.19 to set the alias hello, hello to each use the output "Hello" (3 points)
Alias hello = "echo hello"
##### 3.20 cancel hello command aliases (3 points)
unalias
### Fourth, the face questions
##### 4.1 shows the contents of the line 3 through 10 1.txt file? (3 min)
Sed -n '3,10p' 1.txt
##### 4.2 write queries fi le.txt abc row end (3 points)
grep "$ abc" file.txt
##### 4.3 delete fi le.txt file blank lines (3 points)
grep -v "^ $" file.txt
##### 4.4 find a number between 1-255 ifcon fi g command results; (3 points)
ifconfig | -n Sed '/ [1-255] / P'
##### 4.5 of 5 access.log statistics in the apache access up to 5 ip (IP as a first column) (4 points)
awk -F '{Print . 1} $ '| Sort -n | the uniq -C | Sort -n | head -5
##### 4.6 lookup case insensitive "mysql" string in / var / sync / log / cef_watchd -20080424.1og file command (points)
grep -i "MySQL"
##### 4.7 command line to change the con fi g.txt file, to which all the "name" is changed to "address" (4 points)
sed "S # name # # G address" | config.txt
##### 4.8 Get the penultimate column of the third row in the file field (3 points) with awk
awk 'NR == {3-Print $ of NF}. 1'
##### 4.9 fi le display file foo string matching the line and 5 lines 5 lines before, and after the match foo (4 points)
grep-C5 "foo" file
##### 4.10 Find content contains the keyword "helloworld" of fi le.log file, its contents up and down two rows save from the orientation to 1.txt. Please write command (4 points)
grep -C2 "the HelloWorld" file.log >> 1.txt

Guess you like

Origin www.cnblogs.com/baozexu/p/11372820.html