jasmine214--love

          只有當你的內心總是充滿快樂、美好的愿望和寧靜時,你才能擁有強壯的體魄和明朗、快樂或者寧靜的面容。
          posts - 731, comments - 60, trackbacks - 0, articles - 0

          Linux –常識東西---kiki整理

          Posted on 2011-01-27 16:19 幻海藍夢 閱讀(390) 評論(0)  編輯  收藏 所屬分類: Linux

          Linux –常識東西

           

          第一, uniq實現文件的并集和交集

          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...;

           

          第十一,源碼安裝(.tartar.gztar.bz2tar.Z

          首先解壓縮源碼壓縮包然后通過tar命令來完成

          a.解xx.tar.gztar zxf xx.tar.gz
          b
          .解xx.tar.Ztar zxf xx.tar.Z
          c
          .解xx.tgztar zxf xx.tgz
          d
          .解xx.bz2bunzip2 xx.bz2
          e
          .解xx.tartar xf xx.tar

           

          第十二,Ubuntu中軟件包的卸載方法

          1)移除式卸載:apt-get remove softname1 softname2 …;(移除軟件包,當包尾部有+時,意為安裝)

          2)清除式卸載 apt-get --purge remove softname1 softname2...;(同時清除配置) 

           

          第十三,apt-cache search # ------(package 搜索包)

           

          第十四,系統負載監測

          1 使用uptime命令

          2. #cat /proc/loadavg
               0.40 0.79 0.70 2/245 4101
               Cat /proc/loadavg
          提供以下數據:
              1
          秒鐘平均負載;5秒鐘平均負載;15秒鐘平均負載;總作業數;正在運行的作業總數。

          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命令是包含內核統計量,提供以下數據:CPU 以及CPU0、每行的每個參數意思(以第一行為例)為:
              user (432661)
          從系統啟動開始累計到當前時刻,用戶態的CPU時間(單位:jiffies ,不包含 nice值為負進程。1 jiffies=0.01
              nice (13295)
          從系統啟動開始累計到當前時刻,nice值為負的進程所占用的CPU時間(單位:jiffies
              system (86656)
          從系統啟動開始累計到當前時刻,核心時間(單位:jiffies
              idle (422145968)
          從系統啟動開始累計到當前時刻,除硬盤IO等待時間以外其它等待時間(單位:jiffies
              iowait (171474)
          從系統啟動開始累計到當前時刻,硬盤IO等待時間(單位:jiffies
             irq (233)
          從系統啟動開始累計到當前時刻,硬中斷時間(單位:jiffies
              softirq (5346)
          從系統啟動開始累計到當前時刻,軟中斷時間(單位: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

          ------------------------這行給出中斷的信息,第一個為自系統啟動以來,發生的所有的中斷的次數;然后每個數對應一個特定的中斷自系統啟動以來所發生的次數。

          ctxt 1111397017-----------------給出了自系統啟動以來CPU發生的上下文交換的次數。

          btime 1292227800-----------------------給出了從系統啟動到現在為止的時間,單位為秒。

          processes 78656------------------------自系統啟動以來所創建的任務的個數目。

          procs_running 1----------------------當前運行隊列的任務的數目。

          procs_blocked 0---------------------當前被阻塞的任務的數目。

             
          第十五,返回一個字符串參數的基本文件名稱。# basename  /home/kiki/shell/mkdir.sh

          mkdir.sh

           

          第十六,sh source 的區別

          shell中使用source conf.sh,是直接運行conf.sh的命令,不創建子shell,類似與htmlinclude,而sh是則創建子shell,子shell里面 的變量父shell無法使用,對環境變量的修改也不影響父shell。父shell中的局部變量,子shell也無法使用,只有父shell的環境變量, shell能夠使用。

           

          第十七,linux 清除svn保存的賬號密碼信息。

          刪除~/.subversion/auth即可

           

          第十八,sudo passwd root設置相應的密碼

           

          第十九,使用 fdisk 命令查看系統的分區表。# fdisk -l

           

          第二十,檢查當前的分區情況(使用free mcat /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

           

           

           

          主站蜘蛛池模板: 镇沅| 昆山市| 阿克陶县| 宁国市| 平塘县| 黔江区| 太康县| 乌兰浩特市| 曲水县| 永胜县| 正蓝旗| 南木林县| 呼和浩特市| 马山县| 三台县| 安多县| 通道| 乌审旗| 图们市| 梨树县| 新河县| 平山县| 二连浩特市| 东乡县| 莆田市| 宝清县| 定日县| 新邵县| 齐齐哈尔市| 介休市| 兴海县| 平舆县| 连南| 浮梁县| 石屏县| 肥乡县| 分宜县| 南川市| 韩城市| 江口县| 普定县|