18年linux简学指令笔记

linux common command

powered by Movan python.

  • path

    cd
    cd ~     		# home contents
    cd ../   		# back
    cd ../../
    
    
    ls
    ls -l   		# list long
    ls -lh  		# easy to explain
    ls --help 		# see more information
    
    
  • copy

    touch file1.txt                     # create file1
    touch file2 file3
    
    
    cp old_file new_file
    cp file ../Document
    cp file1 file2                      # 会替代重名文件
    cp -i file1 file2                   # 提示
    
    cp file1 folder1/     or   cp file1 ./folder1
    cp -R folder1/  folder2/            # copy directory
    cp file* folder1/   
    
  • mv

    mv file1 folder1/
    mv file1 file2                      # rename file1 to file2
    mv folder1/ folder2
    mv --help
    
  • create

    mkdir                               # create a file directory
    
    mkdir folder1
        
    rm(remove)
        touch folder1/file1	
        rmdir folder                    # error,can't delete a directory with file
        rm file  ;  rmdir folder1   or  rm -r folder1
    
        touch f1 f2 f3 f4	
        rm -i f1 f2 f3 f4               # type y or n
        rm -I f1 f2 f3 f4               # choose
        rm -I f1 f2 f3                  # del them(number<=3) derectly
    
  • catfile

    cat *.py                            # display content
    cat t.py > t1.py  
    cat t.py t1.py > t2.py
    cat t2.py
    lots of applications
    
    cat t3 >> t2.py                     # add t3 to the end of t2
    
  • chmod

    ls -l
    file type:
        d:derectory
        _:file
    
    chmod [who]  [+/-/=] [file_name]
    
        chmod u+x c.py
        chmod ug-rw c.py
    
    python3 c.py	调用python3运行
    ./c.py		执行
    如果执行python程序,要增加#! /usr/bin python3
    
  • ssh

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值