#命令模式下輸入:光標移動到第34行第15個字符 34<Enter>15l(這是小寫的L)
ctrl+u刪除光標前面的字符html
ctrl+j刪除光標後面的字符python
在Linux下用VIM打開大小几個G、甚至幾十個G的文件時,是很是慢的。mysql
這時,咱們能夠利用下面的方法分割文件,而後再打開。linux
1 查看文件的前多少行web
head -10000 /var/lib/mysql/slowquery.log > temp.logsql
上面命令的意思是:把slowquery.log文件前10000行的數據寫入到temp.log文件中。chrome
2 查看文件的後多少行shell
tail -10000 /var/lib/mysql/slowquery.log > temp.logapache
上面命令的意思是:把slowquery.log文件後10000行的數據寫入到temp.log文件中。ubuntu
3 查看文件的幾行到幾行
sed -n '10,10000p' /var/lib/mysql/slowquery.log > temp.log
上面命令的意思是:把slowquery.log文件第10到10000行的數據寫入到temp.log文件中。
acmer之ubuntu下安裝Eclipse(附有CB16.01的安裝和chrome的安裝)
發現孤兒進程的ppid並不等於1,是967,這個967是桌面的祖先進程
管道(pipe),流管道(s_pipe)和有名管道(FIFO)
信號(signal)
消息隊列
共享內存
信號量
套接字(socket)
1. 臨界區(Critical Section):適合一個進程內的多線程訪問公共區域或代碼段時使用
2. 互斥量 (Mutex):適合不一樣進程內多線程訪問公共區域或代碼段時使用,與臨界區類似。
3. 事件(Event):經過線程間觸發事件實現同步互斥
4. 信號量(Semaphore):與臨界區和互斥量不一樣,能夠實現多個線程同時訪問公共區域數據,原理與操做系統中PV操做相似,先設置一個訪問公共區域的線程最大鏈接數,每有一個線程訪問共享區資源數就減一,直到資源數小於等於零。
ctrl+alt+F1進入字符界面,再次運行剛纔程序,出現告終果,ppid=1.
ctrl+alt+F7進入圖形界面,就能夠繼續愉快的圖形界面了
pwd:print work directory 打印當前目錄 顯示出當前工做目錄的絕對路徑
ps: process status(進程狀態,相似於windows的任務管理器)
netstat -s命令
[root@server ~]# netstat -s | egrep "listen|LISTEN" 667399 times the listen queue of a socket overflowed 667399 SYNs to LISTEN sockets ignored
好比上面看到的 667399 times ,表示全鏈接隊列溢出的次數,隔幾秒鐘執行下,若是這個數字一直在增長的話確定全鏈接隊列偶爾滿了。
[root@server ~]# netstat -s | grep TCPBacklogDrop 查看 Accept queue 是否有溢出
ss命令
[root@server ~]# ss -lnt State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 :6379 : LISTEN 0 128 :22 : 若是State是listen狀態,Send-Q 表示第三列的listen端口上的全鏈接隊列最大爲50,第一列Recv-Q爲全鏈接隊列當前使用了多少。 非 LISTEN 狀態中 Recv-Q 表示 receive queue 中的 bytes 數量;Send-Q 表示 send queue 中的 bytes 數值。
十個提升效率的命令別名
#解壓 alias untar='tar -zxvf ' #支持斷點下載 alias wget='wget -c ' #生成一個 20 個字符的隨機數密碼 alias getpass="openssl rand -base64 20" #校驗checksum alias sha='shasum -a 256 ' #正常下無數次,能夠設置一個合理次數 alias ping='ping -c 5' #啓動web服務器進行測試 alias www='python -m SimpleHTTPServer 8000' #網速測試,須要下載 alias speed='speedtest-cli --server 2406 --simple' #查看公網IP alias ipe='curl ipinfo.io/ip' #查看局域網IP alias ipi='ipconfig getifaddr en0' #清屏,能夠ctrl+L, alias cls='clear'
經常使用參數:-auxf
ps -auxf 顯示進程狀態
df: disk free 其功能是顯示磁盤可用空間數目信息及空間結點信息。換句話說,就是報告在任何安裝的設備或目錄中,還剩多少自由的空間。
du: Disk usage
rpm:即RedHat Package Management,是RedHat的發明之一
rmdir:Remove Directory(刪除目錄)
rm:Remove(刪除目錄或文件)
cat: concatenate 連鎖
cat file1file2>>file3 把文件1和文件2的內容聯合起來放到file3中
insmod: install module,載入模塊
ln -s : link -soft 建立一個軟連接,至關於建立一個快捷方式
mkdir:Make Directory(建立目錄)
touch
man: Manual
su:Swith user(切換用戶)
cd:Change directory
ls:List files
ps:Process Status
mkdir:Make directory
rmdir:Remove directory
mkfs: Make file system
fsck:File system check
uname: Unix name
lsmod: List modules
mv: Move file
rm: Remove file
cp: Copy file
ln: Link files
fg: Foreground
bg: Background
chown: Change owner
chgrp: Change group
chmod: Change mode
umount: Unmount
dd: 原本應根據其功能描述「Convert an copy」命名爲「cc」,但「cc」已經被用以表明「CComplier」,因此命名爲「dd」
tar:Tape archive (磁帶檔案)
ldd:List dynamic dependencies
insmod:Install module
rmmod:Remove module
lsmod:List module
文件結尾的"rc"(如.bashrc、.xinitrc等):Resource configuration
Knnxxx /Snnxxx(位於rcx.d目錄下):K(Kill);S(Service);
nn(執行順序號);xxx(服務標識)
.a(擴展名a):Archive,static library
.so(擴展名so):Shared object,dynamically linked library
.o(擴展名o):Object file,complied result of C/C++ source file
RPM:Red hat package manager
dpkg:Debian package manager
apt:Advanced package tool(Debian或基於Debian的發行版中提供)
部分Linux命令縮寫
bin = Binaries (二進制文件)
/dev = Devices (設備)
/etc = Etcetera (等等)
/lib = LIBrary
/proc = Processess
/sbin = Superuser Binaries (超級用戶的二進制文件)
/tmp = Temporary (臨時)
/usr = Unix Shared Resources
/var = Variable (變量)
FIFO = First In, First Out
GRUB = GRand Unified Bootloader
IFS= Internal Field Seperators
LILO = LInux LOader
MySQL = My 是最初做者女兒的名字,
SQL = Structured QueryLanguage
PHP = Personal Home Page Tools = PHP HypertextPreprocessor
PS = Prompt String
Perl = "Pratical Extraction and Report Language"(實際的抽取和報告語言) ="Pathologically Eclectic Rubbish Lister"
Python 得名於電視劇Monty Python's Flying Circus
Tcl = Tool Command Language
Tk = ToolKit
VT = Video Terminal
YaST = Yet Another Setup Tool
apache = "a patchy" server
apt = Advanced Packaging Tool
ar = archiver
as = assembler
awk = "Aho Weiberger and Kernighan"三個做者的姓的第一個字母
bash = Bourne Again SHell
bc = Basic (Better) Calculator
bg = BackGround
biff = 做者HeidiStettner在U.C.Berkely養的一條狗,喜歡對郵遞員汪汪叫。
cal = Calendar (日曆)
cat = Catenate (連接)
cd = Change Directory
chgrp = Change Group
chmod = Change Mode
chown = Change Owner
chsh = Change Shell
cmp = compare
cobra = Common Object Request BrokerArchitecture
comm = common
cp = Copy
cpio = CoPy In and Out
cpp = C Pre Processor
cron = Chronos 希臘文時間
cups = Common Unix Printing System
cvs = Current Version System
daemon = Disk And Execution MONitor
dc = Desk Calculator
dd = Disk Dump (磁盤轉儲)
df = Disk Free
diff = Difference
dmesg = diagnostic message
du = Disk Usage
ed = editor
egrep = Extended GREP
elf = Extensible Linking Format
elm = ELectronic Mail
emacs = Editor MACroS
eval = EVALuate
ex = EXtended
exec = EXECute (執行)
fd = file descriptors
fg = ForeGround
fgrep = Fixed GREP
fmt = format
fsck = File System ChecK
fstab = FileSystem TABle
fvwm = F*** Virtual Window Manager
gawk = GNU AWK
gpg = GNU Privacy Guard
groff = GNU troff
hal = Hardware Abstraction Layer
joe = Joe's Own Editor
ksh = Korn SHell
lame = Lame Ain't an MP3 Encoder
lex = LEXical analyser
lisp = LISt Processing = Lots of IrritatingSuperfluous Parentheses
ln = Link
lpr = Line PRint
ls = list
lsof = LiSt Open Files
m4 = Macro processor Version 4
man = MANual pages
mawk = Mike Brennan's AWK
mc = Midnight Commander
mkfs = MaKe FileSystem
mknod = Make Node
motd = Message of The Day
mozilla = MOsaic GodZILLa
mtab = Mount TABle
mv = Move
nano = Nano's ANOther editor
nawk = New AWK
nl = Number of Lines
nm = names
nohup = No HangUP
nroff = New ROFF
od = Octal Dump
passwd = Passwd
pg = pager
pico = PIne's message COmposition editor
pine = "Program for Internet News &Email" = "Pine is not Elm"
ping = 擬聲 又 = Packet Internet Grouper
pirntcap = PRINTer CAPability
popd = POP Directory
pr = pre
printf = Print Formatted
ps = Processes Status
pty = pseudo tty
pushd = PUSH Directory
pwd = Print Working Directory
rc = runcom = run command, rc仍是plan9的shell
rev = REVerse
rm = ReMove
rn = Read News
roff = RunOFF
rpm = RPM Package Manager = RedHat PackageManager
rsh, rlogin, rvim中的
r = Remote
rxvt = ouR XVT
seamoneky = 我
sed = Stream Editor
seq = SEQuence
shar = Shell ARchive
slrn = S-Lang rn
ssh = Secure Shell
ssl = Secure Sockets Layer
stty = Set TTY
su = Substitute User
svn = SubVersion
tar = Tape ARchive
tcsh = TENEX C shell
tee = T (T形水管接口)
telnet = TEminaL over Network
termcap = terminal capability
terminfo = terminal information
tex = τέχνη的縮寫,希臘文art
tr = traslate
troff = Typesetter new ROFF
tsort = Topological SORT
tty = TeleTypewriter
twm = Tom's Window Manager
tz = TimeZone
udev = Userspace DEV
ulimit = User's LIMIT
umask = User's MASK
uniq = UNIQue
i = VIsual = Very Inconvenient
vim = Vi IMproved
wall = write all
wc = Word Count
wine = WINE Is Not an Emulator
xargs = eXtended ARGuments
xdm = X Display Manager
xlfd = X Logical Font Description
xmms = X Multimedia System
xrdb = X Resources DataBase
xwd = X Window Dump
yacc = yet another compiler compiler
Fish = the Friendly Interactive SHell
su = Switch User
MIME = Multipurpose Internet Mail Extensions
ECMA = European Computer ManufacturersAssociation