Linux 명령 정리 (2)

7039 단어 Linux
-         
-     
-              
-        
- yum   lamp

      

curl  -O    

wget  -c  

http://mirrors.hust.edu.cn/apache/httpd/         http://nodejs.cn/download/

  

    vim /root/.bashrc  
    alias l='ls -al'   # l                
    
               
    
    source /root/.bashrc   #           
    
    
    #      
    
    alias m='mkdir -p'

               

    chown   
         -R #                   
    chown -R yinshan:yinshan /test   

         

    cat        #                     
    more      #                   q       
    head -n 10     #     10    
    tail -n 10     #     10     
    tail -f     #              
    watch -n 1  index.php    #          
    |         #                 cat /etc/passwd        | grep yinshan 
              yinshan         
    history  #        
    !52  #         52    

Linux    

          useradd     
    
         
         userdel             /etc/passwd       home                 
    userdel  -r          /etc/passwd          home                 
    
          passwd                root   
    
            su               root  
    
           usermod  -l                
    
    
               /home                           
    
         /etc/passwd              
    
    
    
    
    root:x:0:0:root:/root:/bin/bash
    bin:x:1:1:bin:/bin:/sbin/nologin
    daemon:x:2:2:daemon:/sbin:/sbin/nologin
    sync:x:5:0:sync:/sbin:/bin/sync
    shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
    halt:x:7:0:halt:/sbin:/sbin/halt
    mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
    yinshanshan:x:500:501::/home/yinshanshan:/bin/bash
    
    
        : yinshanshan    
        :x         
        :   id  
        : id  
        :         
        : /home/yinshanshan           
        : /bin/bash                              /sbin/nologin                                
    
    
                     
    useradd test -s /sbin/nologin  





     

    groupadd     #         
    #    /etc/group            
    wenhai:x:503:    
    #           id 
    groupdel    #         
    groupmod -n              #    
    
    
    
    usermod  -g             #                 
    useradd -g             #                    
    
    
    gpasswd  -a            #                      
    gpasswd  -d            #                



           

    /etc/passwd 
    /etc/group 
    /etc/shadow 



    

    sd  storage  disk     
    HD Hard Disk  

- df
- du
- fdisk  

df            

    df      kb    
        -a           
        -h            
        -m  MB    
        -k  KB   

du                  

    du       KB      
        -a           
        -h            
        -m  MB    
        -k  KB   





fdisk               windows     diskmgmt.msc

    fdisk -l                                           df -h                
    
    
    1.fdisk /dev/sdb   #               
    m     
    n          
    d        
    w           
    q       
    p       
    
    
    n     
    	extend      
    	primary     
    	
    p  
    	              
    	               
    +10G 
    
    w       
    
    
    fdisk -l        /dev/sdb1     
    
    
    2.              
    
    
             
    	windows  NTFS  
    	Linux ext4  
    
    mke2fs -t ext4 /dev/sdb1   
    
    
    3.     
    	mkdir -p /home/guazai  
        
        mount -t ext4 /dev/sdb1 /home/guazai       
        
        df -h             /dev/sdb1    
        
                          guazai        home        
        
        umount /home/guazai   #       
        
                                
         
     4.         
        vim /etc/fstab
    	/dev/sdb1               /home/guazai            ext4    defaults        0 0
           				            			                    
        0          dump          mysqldump 0       1     
        0              	0      1           
        
        mount -a             
        umount /home/guazai         



    

    free   
         -h             
         swap              



      

zip rar 7zip cab iso    windows     



zip gz bz2 xz  Linux      



gz   gzip    

    yum -y install  gzip 
    gzip -h  #    
    gzip   1   2   3 #                    .gz          
    -f      
    gzip          
    gzip -d 1.php.gz 2.php.gz  #          
    

bz2    bzip2    

    bzip2 -z 1.php 2.php 3.php#                     .bz2     
    bzip2 -h #        
    bzip2 -d 1.php.bz2 2.php.bz2 3.php.bz2       #          
    
              





xz

    xz -h #      
    xz -z    1   2   3   4           #           .xz                
    xz -d 1.php.xz 2.php.xz  



     

    tar 
       -c      
       -x   
       -f        
       -t        
       -v         
       
    tar -cvf kangbazi.tar  1.php 2.php 3.php test #                           
    
    tar -xvf kangbazi.tar  #    
    
    tar -tf kangbazi.tar  #          



gz      

    tar 
    	-z
     tar -zcvf kangbazi.tar.gz 4.php 5.php 6.php haha                 kangbazi.tar.gz         



gz       



    tar 
    	-z
    	tar -zxvf kangbazi.tar.gz   #       

 

bz2       



    tar 
    	-j
    	 tar -jcvf kangbazi.tar.bz2 4.php 5.php 6.php haha                 kangbazi.tar.bz2         



bz2       



    tar 
    	-j
    	tar -jxvf kangbazi.tar.bz2   #       



xz       

    tar 
    	-J
    	tar -Jcvf test2.tar.xz 4.php 5.php 6.php haha                test2.tar.xz         



xz       

    tar 
        -J  
        tar -Jxvf test2.tar.xz 

 

wget     

    -c         
    -r,        。
    -k                          
    -p,          HTML           。
    -np,        。
    -nc,             



    

    1.rpm     
    2.yum     
    3.         

rpm   redhat package management  .rpm

  :       rpm   

  :               2         1

    rpm -qa          rpm   
    
    i386 i586 i686 32  
    x86_64 64 
    
    rpm -qa | grep vim  
    vim-minimal-7.4.629-5.el6.x86_64   4 
    vim-enhanced-7.4.629-5.el6_8.1.x86_64  2 
    vim-common-7.4.629-5.el6_8.1.x86_64   3
    vim-filesystem-7.4.629-5.el6_8.1.x86_64  1   
    
    http://rpm.pbone.net/index.php3/stat/4/idpl/30823637/dir/scientific_linux_6/com/vim-filesystem-7.4.629-5.el6.x86_64.rpm.html
    rpm -i     
        -v     
        -h        
        
        
    rpm -ivh ftp://ftp.pbone.net/mirror/ftp.scientificlinux.org/linux/scientific/6.8/x86_64/os/Packages/vim-filesystem-7.4.629-5.el6.x86_64.rpm    #    
    rpm -e      
    rpm -U      rpm    
    rpm -ql tree    tree      
    rpm -qi tree   tree          
    rpm -qa | wc -l #          rpm  



yum   

            App Store   360                

         rpm                                 

vim       rpm     yum           

    yum install        
    yum -y install      
    yum -y groupinstall        
    yum -y remove              
    yum -y update           
    yum -y search                  
    yum -y install  vim
    
    yum -y install tree --downloadonly --downloaddir=/tmp                       


좋은 웹페이지 즐겨찾기