linux一些操作,記著給自己用的

來源:互聯網
上載者:User
1.解壓tar.bz2

tar jxvf android-ndk-r5c-linux-x86.tar.bz2

2.linux IP可以訪問網域名稱無法訪問

vi /etc/resolv.conf

添加,

nameserver 202.106.46.151

3.linux 安裝deb檔案

sudo dpkg -i ibus-sogoupycc_0.2.5-1_i386.debibus-sogoupycc-data_0.2.5-1_all.deb

4.UBUNTU清理記憶體(sudo su下執行)

echo 1 > /proc/sys/vm/drop_caches

5.UBUNTU查看記憶體free -m

6.給VMWARE虛擬機器硬碟瘦身

sudo vmware-toolbox之後在shrink標籤中進行

--------------------------------

http://www.linuxcast.net 不錯的linux學習網站,最近看視頻才想起這個部落格,繼續記錄吧

7,程式暫停,前台,後台執行的問題

正在執行的進程可以使用Ctrl+Z暫停掉

jobs看後台作業,帶序號的

可以使用fg <序號>將暫停jobs前台運行

bg <序號>將暫停Jobs後台運行

8.ESC+.可以得到上次命令的參數
9.建立硬碟分區

使用fdisk /dev/vdb,對vdb做操作,進入操作介面按m根據提示操作即可,建立主要磁碟分割,建立擴充分區,在擴充分區基礎上建立邏輯分區

10.建立邏輯卷1.需要建立物理卷(PV),會分成若干物理擴充PE(4M大小),使用命令pvcreate /dev/vdb,使用pvs/pvdisplay查看2.在該物理卷上建立邏輯卷組(VG) test,vgcreate test /dev/vdb,建立完使用vgs/vgdisplay查看下3.在該卷組中建立2G大小的邏輯卷(LV) test-1, lvcreate -n test-1 -L 2G test ,使用lvs/lvdisplay查看4.之後mkfs再mount即可使用,路徑是/dev/{vg-name}/{lv-name}5.umount之後刪除邏輯卷,lvremove /dev/{vg-name}/{lv-name}6.刪除卷組, vgremove /dev/{vg-name}7.清除物理卷,pvremove /dev/vdb11.screen的使用

  • screen建立一個會話
  • screen -ls 列出已存在的會話
  • screen -r {id} 切換到指定id的會話
  • Ctrl+a d 退出當前的會話,但會話還在後台,可以resume
  • 在會話中Ctrl+d則完全結束會話
  • 在會話中Ctrl+a c可建立新視窗
  • 在會話中Ctrl+a S可以橫向分屏,Ctrl+a |可豎向分屏
  • 在會話中Ctrl+a tab可以再分屏中切換
  • 在會話中Ctrl+a {數字}可以切換視窗,即Ctrl+a c建立的,Ctrl+a n是下一個視窗,Ctrl+a p是前一個視窗
  • 在會話中Ctrl+a A可以設定視窗名
  • Ctrl+a ?查看協助
  • screen用vi開啟退出後依然保留,http://stackoverflow.com/questions/9979318/how-to-avoid-emacs-or-vi-remaining-on-your-screen-after-closing-when-using-gnu,在~/.screenrc增加altscreen on,再ctrl+a :source ~/.screenrc
12.missing LSB tags最近在debian上安裝screen出現這個問題導致安裝不完整,出現類似下面的問題
insserv: warning: script 'K01monitor' missing LSB tags and overridesinsserv: warning: script 'monitor' missing LSB tags and overridesinsserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!insserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!insserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!insserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!insserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!insserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!insserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!insserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!insserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!insserv: Starting monitor depends on stop-bootlogd and therefore on system facility `$all' which can not be true!

解決見http://forum.directadmin.com/showthread.php?t=42174與其他的服務指令碼對比,需要對應服務/etc/init.d/monitor加上(因為這裡是monitor服務,其他服務也對應檔案加就行)

### BEGIN INIT INFO# Provides:             monitor# Required-Start:       $syslog# Required-Stop:        $syslog# Should-Start:         #named# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: Start and stop directadmin# Description: DirectAdmin### END INIT INFO

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.