This is a creation in
Article, where the information may have evolved or changed.
Used primarily for the latest line view of Web service logs.
Package Main
Import"FMT""OS""Bytes")
Const (Defaultbufsize = 4096)
Func tail (filename string, n int)
When we log or text data on the server side, sometimes there is a need to delete the last few lines of a large file, then how to efficiently implement.Internet browsing finally found the DD command, pro-test as follows, delete a 32GB log file the
The content originates from the people's post and telecommunications press "linux command Application big dictionary"Tell 729 commands, 1935 examplesLearn the Linux system's reference books, desk book, Encounter the command or command options you
File Content Lookup1.CAT Displays the contents of the file starting from the first line2.TAC: Starting from the last line, you can see that the TAC is the write-down form of cat.3.nl: When displayed, by the way output line number;4.more:
1.netstatNETSTAT-TNL | grep 443 (see if Port 443 is occupied)-PNL | grep 443 (also shows the process PID that occupies the native 443 port). -A (all) show all options, default does not show listen correlation -t (TCP) only show TCP-related options
1.netstatNETSTAT-TNL | grep 443 (see if Port 443 is occupied) root user, with Netstat-pnl | grep 443 (also shows the process PID that occupies the native 443 port). -A (all) show all options, default does not show listen related-t (TCP) only show
A bloodcase caused by a lock-free Message Queue: how to be a real programmer? (3) -- location: q3.h and RingBuffer, q3.hringbufferDirectory
A bloodcase caused by a lock-free Message Queue: how to be a real programmer? (1) -- location: Cause
A
Common troubleshooting command lines in linux 1. view TCP connection status netstat-nat | awk '{print $6}' | sort | uniq-c | sort-rnnetstat-n | awk '/^ tcp/{++ S [$ NF]}; END {for (a in S) print a, S [a]} 'netstat-n | awk'/^ tcp/{++ state [$ NF]};
viewing file paths
Ls/path1/path2/filename----------------------Show full path
Dirname/path1/path2/filename-------------Show only the folder path of FileName
Basename/path1/path2/filename-----------Show Only FileName
View text
From: http://bbs.mx3g.com/viewthread.php? Tid = 101578 & extra = Page % 3d2 & SID = kbb756
(1) how to view the model work drawingsBefore we made a variety of marine models, we first came into contact with a model work drawing, which not only tells
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.