1. Create a directory/data.
Answer:
Mkdir/data
2. Create a file oldboy.txt below the/data.
Answer:
Touch/data/oldboy.txt
3. Add the content for Oldboy.txt to "I am studying Linux."
Answer:
Echo ' I am studying Linux. ' >>/data/oldboy.txt
4. Copy the Oldboy.txt file to/tmp.
Answer:
Cp/data/oldboy.txt
5. Move the/data directory to the/root.
Answer:
Mv/data/root
6. Go to the Data directory under the/root directory and delete the Oldboy.txt file.
Answer:
CD/ROOT/DATA;RM Oldboy.txt
7. After the 6th question, exit to the previous level directory and delete the data directory.
Answer:
CD ... | RM-RF data
8. The known file Test.txt content is:
Test
Liyao
Oldboy
Please give the command that does not contain the Oldboy string when outputting the contents of the Test.txt file.
Answer:
Mkdir-v Oldboy Test.txt
9. Use a command to complete the creation of the directory/oldboy/test, that is to create the/oldboy directory and/oldboy/test directory
Answer:
Mkdir-p/lodboy/test
10. It is known that the Test.txt file already exists in/tmp and how to execute the command to overwrite the/mnt/test.txt copy to/tmp
/tmp/test.txt, and leave the system without prompting for overrides (root privileges).
Answer:
\cp/mnt/test.txt/tmp/test.txt
11. View only the contents of lines 20th through 30th in the Ett.txt file (total 100 rows)
Answer:
head-30 ett.txt|tail-11sed–n ' 20,30 ' P ett.txtgrep 20-a ett.txtgrep25-c 5 ett.txt
12. Analyze the picture service log to rank the log (the sum of each picture access number * picture size), take Top10, also
is to calculate the total access size for each URL
Description: The production environment application: This function can be used for IDC website traffic bandwidth is very high, and then by analyzing the server log which elements occupy too much traffic,
In order to optimize or cut the picture, compression JS and other measures.
The subject needs to output three indicators: "Number of visits" "Number of Visits * Single File size" "File name (can take URL)"
Test data
59.33.26.105--[08/dec/2010:15:43:56 +0800] "get/static/images/photos/2.jpg http/1.1" 200 11299
"Http://oldboy.blog.51cto.com/static/web/column/17/index.shtml?courseId=43" "mozilla/4.0 (compatible;
MSIE 6.0; Windows NT 5.1; SV1;. NET CLR 2.0.50727;. NET CLR 3.0.4506.2152;. NET CLR 3.5.30729) "
59.33.26.105--[08/dec/2010:15:43:56 +0800] "get/static/images/photos/2.jpg http/1.1" 200 11299
"Http://oldboy.blog.51cto.com/static/web/column/17/index.shtml?courseId=43" "mozilla/4.0 (compatible;
MSIE 6.0; Windows NT 5.1; SV1;. NET CLR 2.0.50727;. NET CLR 3.0.4506.2152;. NET CLR 3.5.30729) "
59.33.26.105--[08/dec/2010:15:44:02 +0800] "get/static/flex/vedioloading.swf http/1.1" 200 3583
"Http://oldboy.blog.51cto.com/static/flex/adobevideoplayer.swf?width=590&height=328&url=/[[dynamic]]/2 "
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;. NET CLR 2.0.50727;. NET CLR 3.0.4506.2152;. Net
CLR 3.5.30729) "
124.115.4.18--[08/dec/2010:15:44:15 +0800] "GET/?= http/1.1" 200 46232 "-" "-"
124.115.4.18--[08/dec/2010:15:44:25 +0800] "get/static/js/web_js.js http/1.1" 200 4460 "-" "-"
124.115.4.18--[08/dec/2010:15:44:25 +0800] "get/static/js/jquery.lazyload.js http/1.1" 200 1627 "-" "-"
Answer:
13, the/oldboy directory and its subdirectories, all the files ending with the extension. SH contain the./hostlists.txt string
Replace All to: /idctest_iplist. Additional questions: Add points, not the classmate can give up not answer.
Answer:
This article from "Slag 0 basic operation and Maintenance Road" blog, declined reprint!
Linux OPS pre-Test exam questions