The linux command line--part Two Configuration And The Environment

Part 2 - Configuration And The Environment

 11 - The Environment

    printenv - Print part or all of the environment

    set - Set shell options

    export - Export environment to subsequently executed programs

    alias - Create an alias for a command

 What is stored in the environment?

   envirnoment variables and shell variables

 Examining The Environment

 What's In A Startup File?

 Modifying The Environment

 Which Files Should We Modify?

Text Editors

Using A Text Editor

12. A Gentle Introduction To vi

   vi

   :q

   :q!

  Entering Insert Mode

   "i" key

  Saving Our Work

  :w

Moving The Cursor Around

  Cursor Movement Keys


Basic Editing

  insert mode

  command mode

Opening A Line

  

Deleting Text

 Text Deletion Commands


Cutting, Copying, And Pasting Text

Yanking Commands


Joining Lines

 J command

Search-And-Replace

 Searching Within A Line

   f command

   eg. fa

 Searching The Entire File

  / command

  eg. /Log  n command  get the next

 Global Search-And-Replace

  :%s/pattern/replace/g

  

  

 Editing Multiple Files

   vi files1 file2 file3...

 Switching Between Files

   :n    To switch from one file to the next

   :N   To move back to the previous file use

   :buffers

   :buffer 2

 Opening Additional Files For Editing

  vi foo.txt

  :e foo2.txt

 Copying Content From One File Into Another

   yy (copy)

   p (paste)

 Inserting An Entire File Into Another

 :r

 Saving Our Work

  :w

   :wq

   :w filename     This act like "Save As....."

 13 – Customizing The Prompt

   Anatomy Of A Prompt

     echo $PS1

    PS1='[\u@\h \W]\$'  的意思就是:[当前用户的账号名称@主机名的第一个名字 工作目录的最后一层目录名]

 

  Trying Some Alternative Prompt Designs

  Adding Color

 

 

 

Moving The Cursor

 

Saving The Prompt

 


  


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值