Linux學習筆記 1 環境變數 2 vi命令

來源:互聯網
上載者:User

標籤:

1 環境變數篇

1.1  修改 查看 生效 系統內容變數

    1 涉及系統內容變數的檔案   -->  .bash_profile

               --> /etc/profile

    2 該檔案位置 /root/.bash_profile

    3 檔案編輯器開啟  vi .bash_profile

    4 檔案末尾加入 

                    

JAVA_HOME = /usr/share/jdk 1.6.0PATH = $JAVA_HOME/bin:$PATHCLASS_PATH=.$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jarexport JAVA_HOMEexport PATHexport CLASSPATH5 檔案生效       source /root/.bash_profile6 驗證環境變數      export JAVA_HOME         echo $JAVA_HOME

 

VI 命令篇章 輸入指令 a   退出指令 :q  強退:q!   儲存且退出 :wq                                    存成新檔案  :w newfile尋找指令  : ?____   <要尋找的單詞>                 /  ____  要查的詞           n    finding the dedicate word then moving to the next                N    oppersite direction                :set nu <---show the line number                  :set nonu <---remove line numberdirection :                 k             h   j  linput: i  insert in front of the cursor          a insert behind the cursor         o  insert in the next line of the cursor delete:             x:delete the char of the cursor            X :delete the char of the cursor            dd:delete the current row            5dd:delete the currrent line and the next 5 line            :1,5d delete1 to 5 line            x delete one charactorvi substitute:s /cici/titi         replace the line cici with titi:s/cici/titi/g       replace all the cici with titi in the current line:n,$s/cici/titi    the line n to the last line.each line cici replace with titi:n,$s /cici/titi/g  the line n to the last line.each line cici replace with titi:.,$s/cici/titi     replace all the words in the passages from the first line                      to the last line repalce confirmation command.adding character c behind the comma:s/cici/titi/gc  all the cici replace with titi  + confirmationshow line number :set nudw  delete current words3dw delete 3 wordscopy and attachyw  copy wordy5w copy all 5 wordsyy copy all the line 5yy copy 5 linesp copy after the current line:1,2co3 copy from line1 to line2 after line 3:4,5m6          1          1          2          2          3          3          4          6          5          4          6          5location command              gg moving to the front of the file              G moving to the end of file               :20 moving to line 20              J  merge 2 line              shift + 8 :                             finding the word which is in the position of cursor

 

Linux學習筆記 1 環境變數 2 vi命令

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.