zoukankan      html  css  js  c++  java
  • 数学之路-分布式计算-linux/unix技术基础(4)

    pwd显示当前文件夹,ls查看文件夹下的文件,cd 进入文件夹

    -bash-4.2$ pwd

    /home/myhaspl
    -bash-4.2$ ls
    abc        hadoop-2.4.1             mydoclist  mypylst   mypylsts  numpy
    abd        hadoop-2.4.1-src.tar.gz  myl2       mypylst1  myrun     pypy-2.3.1-src
    error.log  hadoop-2.4.1.tar.gz      mylist     mypylst2  myse      se
    -bash-4.2$ cd numpy
    -bash-4.2$ ls
    BENTO_BUILD.txt  build           INSTALL.txt  numpy        runtests.py       TEST_COMMIT
    bento.info       COMPATIBILITY   LICENSE.txt  pavement.py  setupegg.py       THANKS.txt
    branding         DEV_README.txt  MANIFEST.in  README.txt   setup.py          tools
    bscript          doc             mydoclist    release.sh   site.cfg.example  tox.ini

    -bash-4.2$ 

    mkdir建立文件夹

    rm 删除文件 r參数表示递归删除。连同子文件夹以及其内含删除,f參数表示强制删除

    -bash-4.2$ mkdir abcd
    -bash-4.2$ cd abcd
    -bash-4.2$ mkdir abcd1
    -bash-4.2$ cd ~
    -bash-4.2$ ls
    abc        hadoop-2.4.1             myl2      mypylst2  numpy
    abcd       hadoop-2.4.1-src.tar.gz  mylist    mypylsts  pypy-2.3.1-src
    abd        hadoop-2.4.1.tar.gz      mypylst   myrun     se
    error.log  mydoclist                mypylst1  myse
    -bash-4.2$ rm -rf abcd
    -bash-4.2$ ls
    abc        hadoop-2.4.1             mydoclist  mypylst   mypylsts  numpy
    abd        hadoop-2.4.1-src.tar.gz  myl2       mypylst1  myrun     pypy-2.3.1-src
    error.log  hadoop-2.4.1.tar.gz      mylist     mypylst2  myse      se
    -bash-4.2$ 

    本博客所有内容是原创,假设转载请注明来源

    http://blog.csdn.net/myhaspl/



    vim编辑器

    $vim

    启动后。显示界面


    简单操作。按i键进入插入模式,输入字符

    然后按ESC键退出插入模式,输入:wq! hello,以”hello”为文件名称,存盘退出。

    -bash-4.2$ cat hello

    hello

    world!

    -bash-4.2$

    vim 经常使用操作键


    VIM

    快捷键:

    ctags

    文件名称

    做索引

    光标移动:

    四个方向

    k

    h

    0

    l

    j

    ctrl+f,

    ctrl+b

    向下翻页,向上翻页

    ctrl+d,

    ctrl+u

    向下半翻页,向上半翻页

    $

    移动行尾

    0

    移动行首

    w

    移动下一个词

    b

    移动到上一个词

    gg

    跳到文档的開始处

    G

    跳到文档的末尾

    %

    跳到匹配的括号处("{

    }""[]""()")

    ctrl+i,tab

    跳到下一个

    jump

    point

    ctrl+o

    跳到上一个

    jump

    point

    23gg,

    23G,

    :23

    跳到第

    23

    ctrl+i,

    tab

    跳到下一个跳点(Jump

    Point)

    ctrl+o

    跳到上一个跳点

    查找替换:

    #

    从光标向后查找整个关键词

    *

    从光标向前查找整个关键词

    g#

    从光标向后查找关键词

    g*

    从光标向前查找关键词

    fx,tx,Fx。Tx

    在当前行查找字符

    查找替换样例:

    :

    s/SEARCH/REPLACE

    :

    s/If/Since

    将下一个"If"换成"Since"

    :

    %s/If/Since

    将所有"If"换成"Since"


    单词边界:

    指定单词边界:

    <

    >

    如:

    /<d[a-z]*an>

    匹配以

    d

    開始,中间包括随意个小写字母,以

    an

    结束的

    单词

    /$[0-9]*.[0-9][0-9]

    匹配查找

    $XX...X.XX

    这要的数字,有且仅仅有两位小

    数的

    经常使用的编辑命令:

    a,

    i

    在光标后插入,

    在光标前插入

    dd

    删除一行

    cc,S

    删除一行后进入

    insert

    模式

    dw

    删除一个单词

    cw

    删除一个单词后进入

    insert

    模式

    x,dl

    删除一个字符

    s,cl

    删除一个字符后进入

    insert

    模式

    p

    粘贴

    xp

    交换两个字符

    ddp

    交换两行

    y

    复制

    yy

    复制一行

    u

    撤消

    ctrl+r

    重做

    .

    反复上一次改动

    ctrl+r

    重做

    .

    反复上一次改动


    shell 基础、

    编辑下面shell文件,扩展名命名为".sh"

    -bash-4.2$ cat test1.sh
    #!/bin/sh
    ls -la
    cd numpy
    ls
    -bash-4.2$ chmod a+rx test1.sh
    -bash-4.2$ ./test1.sh


  • 相关阅读:
    JavaScript cookie详解
    Javascript数组的排序:sort()方法和reverse()方法
    javascript中write( ) 和 writeln( )的区别
    div做表格
    JS 盒模型 scrollLeft, scrollWidth, clientWidth, offsetWidth 详解
    Job for phpfpm.service failed because the control process exited with error code. See "systemctl status phpfpm.service" and "journalctl xe" for details.
    orm查询存在价格为空问题
    利用救援模式破解系统密码
    SSH服务拒绝了密码
    C# 调用 C++ DLL 中的委托,引发“对XXX::Invoke类型的已垃圾回收委托进行了回调”错误的解决办法
  • 原文地址:https://www.cnblogs.com/yjbjingcha/p/6794487.html
Copyright © 2011-2022 走看看