Linux –常識東西
cat file1 file2 | sort | uniq ----------------去重(并集)
cat file1 file2 | sort | uniq -d -------------repeated(重復)交集:
cat file1 file2 | sort | uniq –u-------------uniq(唯一)去除交集后的并集
cat file | sort | uniq –c --------------------count
第二 ,sudo –s 轉成root用戶,方便操作。
第三,設置IP, vi /etc/network/interfaces
加入:
auto eth0
iface eth0 inet static
address 172.28.6.239
netmask 255.255.0.0
gateway 172.28.16.1
第四,Sudo nano /etc/resolv.conf
是一個編輯工具,設置DNS。
加入:nameserver 10.58.100.1
第五,重新啟動 networking 服務:
sudo /etc/init.d/networking restart
第六,apt-get update 先更新一下源。
第七,安裝VIM
apt-get install vim
第八,搭建SVN需要安裝的東西:安裝openssh-server,安裝subversion,安裝subversion-tools,安裝apache2,安裝libapache2-svn,安裝tree,設置apache2下的SVN: vim /etc/apache2/dav_svn.conf
第九,dpkg –l | grep apache查找到所安裝的軟件包
第十,Ubuntu中軟件安裝方法
(1)普通安裝:apt-get install softname1 softname2 …;
(2)修復安裝:apt-get -f install softname1 softname2... ;(-f Atemp to correct broken dependencies)
(3)重新安裝:apt-get --reinstall install softname1 softname2...;
第十一,源碼安裝(.tar、tar.gz、tar.bz2、tar.Z)
首先解壓縮源碼壓縮包然后通過tar命令來完成
a.解xx.tar.gz:tar zxf xx.tar.gz
b.解xx.tar.Z:tar zxf xx.tar.Z
c.解xx.tgz:tar zxf xx.tgz
d.解xx.bz2:bunzip2 xx.bz2
e.解xx.tar:tar xf xx.tar
第十二,Ubuntu中軟件包的卸載方法
(1)移除式卸載:apt-get remove softname1 softname2 …;(移除軟件包,當包尾部有+時,意為安裝)
(2)清除式卸載 :apt-get --purge remove softname1 softname2...;(同時清除配置)
第十三,apt-cache search # ------(package 搜索包)
第十四,系統(tǒng)負載監(jiān)測
1 使用uptime命令
2. #cat /proc/loadavg
0.40 0.79 0.70 2/245 4101
Cat /proc/loadavg提供以下數據:
1秒鐘平均負載;5秒鐘平均負載;15秒鐘平均負載;總作業(yè)數;正在運行的作業(yè)總數。
3 使用cat /proc/stat命令
root@svn-twsh:/home# cat /proc/stat
1 1 1 1 1 1 1 1 1
cpu 27968206 0 1447018 3054376529 10267067 14827 140419 0 0
cpu0 8429391 0 293268 377176809 808835 0 227 0 0
cpu1 1387171 0 167157 383682640 1466019 0 5396 0 0
cpu2 13788168 0 653833 371449457 862485 14827 111419 0 0
cpu3 67960 0 30035 386602192 238323 0 41 0 0
cpu4 9730 0 18773 386456871 90106 0 35 0 0
cpu5 4530 0 13114 386518863 24665 0 28 0 0
cpu6 4280555 0 270522 375858012 6768206 0 23213 0 0
cpu7 701 0 316 386631685 8428 0 60 0 0
-----------------------------------------------------------cat
/proc/stat命令是包含內核統(tǒng)計量,提供以下數據:CPU 以及CPU0、每行的每個參數意思(以第一行為例)為:
user (432661) 從系統(tǒng)啟動開始累計到當前時刻,用戶態(tài)的CPU時間(單位:jiffies) ,不包含 nice值為負進程。1
jiffies=0.01秒
nice (13295) 從系統(tǒng)啟動開始累計到當前時刻,nice值為負的進程所占用的CPU時間(單位:jiffies)
system (86656) 從系統(tǒng)啟動開始累計到當前時刻,核心時間(單位:jiffies)
idle (422145968) 從系統(tǒng)啟動開始累計到當前時刻,除硬盤IO等待時間以外其它等待時間(單位:jiffies)
iowait (171474) 從系統(tǒng)啟動開始累計到當前時刻,硬盤IO等待時間(單位:jiffies) ,
irq (233) 從系統(tǒng)啟動開始累計到當前時刻,硬中斷時間(單位:jiffies)
softirq (5346) 從系統(tǒng)啟動開始累計到當前時刻,軟中斷時間(單位:jiffies)
CPU時間=user+system+nice+idle+iowait+irq+softirq
intr 1347398884 176055350 2 0 0 0 0 0 0 20 0 0 0 4 0 0 0 0 0 0 0 0 2 604 103 27147724 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1092965705 0 51229370 0 0 0 0 0 0 0 0 0 0 0 0 0 0
------------------------這行給出中斷的信息,第一個為自系統(tǒng)啟動以來,發(fā)生的所有的中斷的次數;然后每個數對應一個特定的中斷自系統(tǒng)啟動以來所發(fā)生的次數。
ctxt 1111397017-----------------給出了自系統(tǒng)啟動以來CPU發(fā)生的上下文交換的次數。
btime 1292227800-----------------------給出了從系統(tǒng)啟動到現(xiàn)在為止的時間,單位為秒。
processes 78656------------------------自系統(tǒng)啟動以來所創(chuàng)建的任務的個數目。
procs_running 1----------------------當前運行隊列的任務的數目。
procs_blocked 0---------------------當前被阻塞的任務的數目。
第十五,返回一個字符串參數的基本文件名稱。# basename
/home/kiki/shell/mkdir.sh
mkdir.sh
shell中使用source conf.sh,是直接運行conf.sh的命令,不創(chuàng)建子shell,類似與html中include,而sh是則創(chuàng)建子shell,子shell里面 的變量父shell無法使用,對環(huán)境變量的修改也不影響父shell。父shell中的局部變量,子shell也無法使用,只有父shell的環(huán)境變量, 子shell能夠使用。
刪除~/.subversion/auth即可
第十八,sudo passwd root設置相應的密碼
第十九,使用 fdisk 命令查看系統(tǒng)的分區(qū)表。# fdisk -l
第二十,檢查當前的分區(qū)情況(使用free -m或cat /proc/Swaps )
第二十一, # mount -t auto /dev/hda5 /mnt/hda5 注:掛載/dev/hda5;
# df -lh 注:查看/dev/hda5是否被掛載;
第二十二,備份Crontab
crontab –l
00 12 * * 0 /home/inc_backup/fullybak.sh 1> /home/inc_backup/log/fullybak.log 2>&1