Linux Note 3 20160715_2

vi, vim

vi is a very strong command line edit software.
vim was the advanced version of vi, adding the support of GUI.
Except vim, emacs is even stronger than vim.

vim + path to use vim

three modes of vi

  • command mode
    default
    i : insert text at the cursor
    o : insert a new line below the current one
    dd : delete the whole row
    yy : put the current row's content to the ram(copy the current line)
    n+yy: put n rows' content to the ram(copy n lines)
    p : paste
    u : revoke the last manipulation
    r : replace current character
    / : find key word

  • insert mode
    i
    Esc : back to the command mode

  • ex mode
    :

:w     #save
: q    #quit
:q!    #force to quit
:set number    #show the line number
:! system command # execute a system command
:sh #return to the command line  and 'ctrl + d' can return to the vim 

Basic concept of disc

转速越快,磁盘性能越强。但是,功率发热量都会高。
SATA

  • 柱面(cylinder)
    立体,多碟片叠加的柱面圈
  • 扇区(sector)
    中心扩散出来的扇形
  • 磁头(head)
    读写数据,每个磁盘上下都有个磁头

磁盘在linux中的表示

设备名称一般为hd[a-z]或sd[a-z],如hda,hdb,sda,sdb
IDE设备的名称为hd[a-z],SATA,SCSI,SAS,USB等设备名称为sd[a-z]

concept of partition

将一个磁盘逻辑的分为几个区,每个区当作独立磁盘,以方便管理。
不同分区用: 设备名称 + 分区号 ,如sda1,sda2
主流的分区机制分为MBR和GPT两种。

MBR

Master Boot Record. Traditional one. Applied to most BIOS PC device.

  • support 32bit and 64bit
  • there is a limit for partition
  • support no more than 2T hard disk.

MBR partition

  • main partition
    at most 4
  • extended partition
    take a place of the main partition.
    can't be used. still need logical partition.
  • logical partition
    can only be created by creating an extended partition first.
    Linux can support at most 63 IDE partition and 15 SCSI partition.

GPT

A new one.

  • support more than 2T
  • compatible with MBR
  • only can be used on the hardware that supports UEFI
  • only 64bit
  • Mac,Linux both support GPT
  • Windows 7 64bit, windowsServer2008(win10,win8?)

你可能感兴趣的:(Linux Note 3 20160715_2)