day05-Linux 기본 명령

5852 단어 Linux02-Linux
기본 명령:
date:
    date [OPTION]... [+FORMAT]:  
        FORMAT:     
            %D
            %F
            %T
    date [MMDDhhmm[[CC]YY][.ss]]:  
        MM:   
        DD:  
        hh:   
        mm:   
        YY:     
        CCYY:     
        .ss:   

    Linux     :
            : Linux    CPU          ;
            :

        hwclock:       
            -s, --hctosys
            -w, --systohc

        cal:  

       :
             
       ,   :HOME
        root: /root
            :/home/USERNAME
            /home/tom

        ~:      

    cd: 
        cd   cd ~:          
        cd ~USERNAME:            
        cd -:                  

        . :    
        .. :     

               :
            PWD:         ;
            OLDPWD:         ;

    pwd:       

    ls: list
                    ;

        ls [OPTION]... [DIR]...
            -a, --all:       ,      ;
            -l:    
                -rw-r--r-- 1 root root 44800 Aug 14 14:32 install.log
                    -rw-r--r--:
                               :    
                            -, d, l, b, c, p, s
                           9 :    ,perm
                      :         ;
                     root:    owner
                     root:    group
                    44800:   size
                    Aug 14 14:32 :              
                    install.log:    
            -h, --human-readable:    
            -d:            ;    -l    ;
            -r, --reverse:     
            -R, --recursive:   



    stat /PATH/TO/SOMEFILE:          

          :cat, tac
        cat [OPTION]... [FILE]...
            -E:       $
            -n:             

              :file
        file /PATH/TO/SOMEWHERE

        :echo
        -n:           ;
        -e:        ;
            
: \t: echo "$VAR_NAME": , echo '$VAR_NAME': , which: which [OPTION] COMMAND --skip-alias: whatis: mkwhatis ; : : halt, poweroff, shutdown, init 0 : reboot, shutdown, init 6 : who, whoami, w : halt, poweroff reboot -f: , shutdown -p: shutdown: shutdown [OPTION]... TIME [MESSAGE] -r: reboot -h: halt -c:cancel TIME: now: +m: , ; +3; hh:mm: , ; : whoami: ; who: ; w: ; : cd, pwd, ls mkdir, rmdir, tree mkdir [options] /path/to/somewhere -p: , ; -v: -m MODE: ; tree: -d: -L level: -P pattern: pattern ; rmdir: rmdir [OPTION]... DIRECTORY... -v: ; : (1) /tmp/x/y1, /tmp/x/y2, /tmp/x/y1/a, /tmp/x/y1/b, /tmp/x/y2/a, /tmp/x/y2/b mkdir /tmp/x/{y1,y2}/{a,b} (2) x_m, y_m, x_n, y_n mkdir {x,y}_{m,n} (3) /tmp/bin, /tmp/sbin, /tmp/usr, /tmp/usr/bin, /tmp/usr/sbin mkdir -p /tmp/{bin,sbin,usr/{bin,sbin}}

텍스트 파일 보기 클래스 명령:cat, tac more,less,tail,head
more
    more [OPTIONS...] FILE...
        -d:          

less
    less [OPTIONS...] FILE...

head
    head [OPTION]... [FILE]...
        -c #:      #  
        -n #:      # 
            -#:

tail 
    tail [OPTION]... [FILE]...
        -c #:      #  
        -n #:      # 
            -#:
        -f:             ;

파일의 타임 스탬프 관리 도구:touch
  :metadata, data
          :stat

         :
        access time:    ,   atime,      
        modify time:     , mtime,      (  )
        change time:     , ctime,       

touch  :
    touch [OPTION]... FILE...
        -a: only atime
        -m: only mtime
        -t STAMP:
             [[CC]YY]MMDDhhmm[.ss]
        -c:       ,     

회고: 파일 시스템, bash의 기초 특성, 디렉터리 관리 및 파일 보기
        :
        boot, bin, sbin, lib, lib64, dev, home, root, mnt, media, etc, proc, sys
        usr
        var

    bash     :
            
            
            
             :
            ~, {}
               
              :0
              :1-255

        :mkdir, rmdir

        :more, less, tail, head

         :touch
        -a, -m, -t
        -c

파일 관리:cp,mv,rm
    :cp
    cp [OPTION]... [-T] SOURCE DEST
    cp [OPTION]... SOURCE... DIRECTORY
    cp [OPTION]... -t DIRECTORY SOURCE...

    cp SRC DEST
        SRC   :
                   :  DEST,  SRC      DEST ;
                  :
                  DEST   : SRC       DEST ;
                         cp    -i  ;
                  DEST   : DEST            ,  SRC          ;

    cp SRC... DEST
        SRC...:    
            DEST    ,    ,        ;

    cp SRC DEST
        SRC   :
                  :-r

              DEST   :       ,  SRC        DEST ;
              DEST  :
                  DEST   :  
                  DEST   :

        :
        -i:   
        -r, -R:               ;
        -a:   ,   -dR --preserv=all
            -d:--no-dereference --preserv=links
            --preserv[=ATTR_LIST]
                mode:   
                ownership:     
                timestamp: 
                links
                xattr
                context
                all
        -p: --preserv=mode,ownership,timestamp
        -v: --verbose
        -f: --force

mv: move,    
   mv [OPTION]... [-T] SOURCE DEST
   mv [OPTION]... SOURCE... DIRECTORY
   mv [OPTION]... -t DIRECTORY SOURCE...

       :
        -i:    
        -f:   

rm: remove,  
    rm [OPTION]... FILE...

        :
        -i:    
        -f:     
        -r:   

        rm -rf 

     :nano
         

좋은 웹페이지 즐겨찾기