• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆 - 60, 文章 - 0, 評論 - 197, 引用 - 0
            數(shù)據(jù)加載中……

            Ubuntu 學(xué)習(xí)筆記

            1. 為 root 設(shè)置密碼
               sudo passwd root
               提示輸入密碼,第一次要輸入當(dāng)前帳戶的密碼,之后輸入新密碼,再輸入新密碼的確認(rèn)
               密碼, root 的密碼就會設(shè)置成功。

            2. 切換到 root 下進(jìn)行作業(yè)
               su root

            3. 設(shè)置網(wǎng)絡(luò)代理,使 apt-get 能安裝軟件
               (1)在/etc/apt目錄下新建文件 apt.conf
               (2)編輯 apt.conf 內(nèi)容如下
                  Aquire::http::your_proxy:80;
               (3)如果不想通過重啟來生效,可用如下命令:
                  export http_proxy=http://your_proxy:80     

            4. 只顯示當(dāng)前路徑下的目錄
               ls -l | grep ^d

            5. 在 Ubuntu 里安裝 VMWare-tool
               由于安裝VMware Tools需要針對新內(nèi)核重新編譯模塊,所以必須先安裝基本編譯系統(tǒng)和
               內(nèi)核頭文件。

               $ sudo apt-get install build-essential
               $ sudo apt-get install linux-headers-`uname -r`

               安裝VMware Tools。選擇VMware菜單VM|Install VMware Tools,系統(tǒng)會自動載入
               CDROM,打開一個終端窗口執(zhí)行下列命令:

               $ tar zxf /media/cdrom/VMwareTool-5.0.0-*.tar.gz
               $ cd vmware-tools-distrib
               $ sudo ./vmware-install.pl

               安裝完畢后,在 /mnt 目錄下會有個 hgfs 目錄即安裝成功,通過 VMWare 的菜單 VM
               -> Settings... -> Options -> Shared Folders 設(shè)置一文件夾,可實(shí)現(xiàn)Unbuntu
               對此文件夾的共享訪問。

            6. 使用 tar 對軟件打包解包
               tar cjvf   test.tar.bz2  test
               tar zjvf   test.tar.bz2
               或者
               tar czvf  test.tar.gz  test
               tar xzvf  test.tar.gz

            7. 如何掛接/卸載 U 盤
               mount -tvfat /dev/sdb1 /mnt/udisk
               umount /mnt/udisk

            8. 創(chuàng)建連接文件
               ln -s /usr/local/emacs22/bin/emacs-22.1 emacs

            9. 編譯 emacs22 源碼
               (1)先安裝兩個必須的軟件包
                  sudo apt-get install libidl-dev
                  sudo apt-get install libgtk2.0-dev
               (2)./configure --prefix=/usr/local/emacs22 \
                        --enable-font-backend --with-xft    \
                        --with-freetype --with-gtk             \
                        --with-x-toolkit=gtk
               (3) make bootstrap
               (4) make install

            10 配置 IP 以訪問 Internet
                (1) ifconfig eth0 ip netmask 255.255.255.0
                (2) route add default gw gateway
                (3) 編輯 /etc/resolv.conf 用以設(shè)置 DNS, 例如:
                       search domain.corp.company.com
                       nameserver 192.168.0.55
                       nameserver 192.168.0.88

            11 使用 grep 匹配當(dāng)前目錄下所有文件(包括子目錄)
                grep -r 'your_contents' ./

            12 殺掉進(jìn)程
                (1) 先通過 ps -aux 獲得進(jìn)程的 PID
                (2) kill -9 PID

            13 boot ubuntu without starting X
                (1) sudo gedit /etc/init.d/gdm
                (2) add "exit 0" at the second line

            14 修改 console 下的分辯率
                (1) 編輯 /boot/grub/menu.lst
                (2) 在 kernel 行尾添加 vga=value, 如:
                     kernel   /boot/vmlinuz-2.6.15-23-386 root=/dev/hda1 ro quiet splash  vga=791
                (3) vga 的值如何設(shè)置,可參考下表:
               

            色深

            640×480

            800×600

            1024×768

            1280×1024

            256

            769

            771

            773

            775

            32000

            784

            787

            790

            793

            65000

            785

            788

            791

            794

            16.7 Mill.

            786

            789

            792

            795


            15 遞歸顯示當(dāng)前目錄下的內(nèi)容
                ls -R $PWD

            16 修改 /etc/profile 后無需重啟而使之立即生效
               #. /etc/profile
               注意 /etc/profile 前面的點(diǎn) .

            17 在 VMware Ubuntu 7.0.4 用 Ctrl+Alt+F1~F7 實(shí)現(xiàn)多用戶切換
                在 VMware 里使用 Ubuntu 與真實(shí)機(jī)一樣,但卻無法用 Ctrl + Alt + F1~F7 實(shí)現(xiàn)多用戶切換。折騰了半天,原來是 VMware 將 Ctrl + Alt 用作了快捷鍵。可通過如下操作: VMware -> Edit -> Preference... -> Hot Keys,將里面默認(rèn)的快捷鍵改成 Ctrl + Shift + Alt, 之后重啟 VMware ,就可在 Ubuntu 里通過 Ctrl + Alt + F1~F7 實(shí)現(xiàn)多用戶切換了。

            18 獲知某一目錄的大小
               du -sh /root
             
            19 獲知用到了哪些共享庫文件
               #readelf -a hello | grep -i 'share'
               0x00000001 (NEEDED)                     Shared library: [libc.so.6]

            20 以靜態(tài)方式指定 IP
               (1) 編輯文件 /etc/network/interfaces, 添加內(nèi)容如下:
                     auto eth0
                     iface eth0 inet static
                     address 10.0.0.1
                     netmask 255.0.0.0
                     gateway 10.0.0.1
               (2) 重新啟動網(wǎng)絡(luò)服務(wù)
                    #/etc/init.d/networking restart

            21 添加服務(wù)
             (1)安裝網(wǎng)絡(luò)請求守護(hù)進(jìn)程(如果需要)
                 sudo apt-get install openbsd-inetd

             (2)配置端口并指定服務(wù)名
                在 /etc/services 添加內(nèi)容如下:
                 hello 20001/tcp
                其意義為 hello 這項(xiàng)服務(wù)的端口為 20001, 并且是一個 TCP 服務(wù)

             (3)在 /etc/inetd.conf 中添加下面這一行
                 hello stream tcp nowait root /home/jbw/hello
                各個參數(shù)意義如下:
                <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
                service_name: 服務(wù)名稱(這個服務(wù)名稱要和你在 /etc/services 中設(shè)置的服務(wù)名稱一致)
                sock_type: stream 或 dgram
                proto: 一般用 tcp/udp
                flags: wait/nowait
                user: 指定該程序要以哪一個用戶來啟動
                server_path: 服務(wù)程序的全路徑
                args: 服務(wù)程序的參數(shù)(可選)

             (4)測試服務(wù)
                telnet localhost hello
                或者
                telnet localhost 20001

            22 apt 常用命令 
                sudo apt-cache show <package> 安裝的軟件包
                sudo apt-get clean           清理所有apt下載的軟件緩存
                sudo apt-get autoremove 自動卸載不需要的軟件包
                sudo apt-get autoclean     清理舊版本的軟件緩存

            23 dd 的常見應(yīng)用
             (1) 克隆磁盤
                 dd if=/dev/sda of=/dev/sdb

             (2) 將整張光盤轉(zhuǎn)化為 ISO 文件
                 dd if=/dev/cdrom of=/tmp/cdrom.iso bs=1024
               
                 裝載該 ISO 文件
                 mount -o loop -t iso9660 /tmp/cdrom.iso /mnt

             (3) 備份 MBR
                 dd if=/dev/sda of=/boot/mbr_backup bs=512 count=1

             (4) 還原 MBR
                 dd if=/boot/mbr_backup of=/dev/sda bs=446 count=1

             (5) 制作一個 1GB 的交換文件
                 dd if=/dev/zero of=/swapfile bs=1024 count=1000000

                 加入并激活該交換文件
                 mkswap /swapfile && swapon /swapfile

            posted on 2008-01-08 14:50 Normandy 閱讀(3220) 評論(4)  編輯 收藏 引用 所屬分類: Linux Usage

            評論

            # re: Ubuntu 學(xué)習(xí)筆記  回復(fù)  更多評論   

            這個好.能不能不斷地往下寫啊.
            2008-03-31 12:16 | niube's son

            # re: Ubuntu 學(xué)習(xí)筆記  回復(fù)  更多評論   

            @niube's son
            呵呵, 一定! 很高興能對大家有點(diǎn)幫助。大家也可把自己用 Ubuntu 時(shí)遇到的困難寫出來,一起解決嘛 :-)
            2008-03-31 14:33 | Normandy

            # re: Ubuntu 學(xué)習(xí)筆記  回復(fù)  更多評論   

            大哥,多謝了阿
            2008-04-01 13:02 | niube's son

            # re: Ubuntu 學(xué)習(xí)筆記  回復(fù)  更多評論   

            很好,,,大家一起努力
            2009-08-05 00:06 | minix
            99久久国产综合精品成人影院 | 婷婷综合久久中文字幕蜜桃三电影| 久久久久久亚洲精品无码| 久久激情五月丁香伊人| 久久久久人妻一区二区三区| 午夜精品久久久久久久久| 日本精品久久久中文字幕| 久久久噜噜噜久久中文字幕色伊伊| 久久久久久久波多野结衣高潮| 国产精品美女久久久| 怡红院日本一道日本久久| 亚洲伊人久久成综合人影院| 精品永久久福利一区二区| 久久久久这里只有精品| 97久久精品午夜一区二区| 久久频这里精品99香蕉久| 51久久夜色精品国产| 亚洲国产精品无码成人片久久| 久久久久国产精品三级网| 国产精品久久久久久一区二区三区| 一本久久免费视频| 久久精品夜色噜噜亚洲A∨| 久久精品国产影库免费看| 综合久久国产九一剧情麻豆| 久久综合九色综合欧美就去吻| 日本精品久久久久中文字幕8| 亚洲精品乱码久久久久66| 婷婷国产天堂久久综合五月| 久久久WWW成人免费毛片| 99久久精品国产综合一区| 精品永久久福利一区二区| 久久久久人妻一区精品性色av| 久久久国产99久久国产一| 欧美午夜A∨大片久久| 精品99久久aaa一级毛片| 中文字幕成人精品久久不卡| 久久香蕉国产线看观看乱码| 97久久精品无码一区二区| 久久精品亚洲中文字幕无码麻豆 | 香蕉99久久国产综合精品宅男自| 91精品国产91久久久久久青草|