Linux 명령 과 셸 명령

6368 단어 Linux 기반
vim 명령 어
●     
    
1)i       ,   
2)a       ,   
3)I   
4)A   

    :ESC
    :shift + ;
1)w   
2)wq     
3)q!      

   :dd
  :ctrl + f(   ) ctrl + b(   )
   :yy
  :p
        :u 
           :Ctrl+r 

●     
?pattern Enter
n        
N        

기타 명령

     :reset

    :
    
ls -l 
ls -la   
ls -l ja*      

    
touch today.c

    
cp src.txt dest.txt
cp -i src.txt dest.txt   
cp src.txt .        
cp -R    dest            
cp c_?1 ../            

    
rm file

    
rm -rf   

      :
file   

      :
cat file
cat -n file     

      10 
tail -n 10 file
        10 
head -n 10 file

    
useradd -m jack        ,   home  
userdel -r jack     

   
groupadd androidgroup
      
usermod -G androidgroup jack

    
r  w  x  
drwxr-xr-x
d rwx r-x r-x
d  
1.           (root            )
2.               ( 、  )
3.            ( 、  )

rwx       

  		   		   
---			000			0
--x			001			1
-w-			010			2
-wx			011			3
r--			100			4
r-x			101			5
rw-			110			6
rwx			111			7

      
chmod 644 file
         
chmod u+x file

           
umask 026

777-026

       
chown user.group file
chown user file
chown .group file

----------------------shell  
  
echo 

#!/bin/bash                                                                 
NDK=10
text="i love shell"

#                
text1=`date`
text2=$(who)

echo $NDK
echo $text
echo "$text very much"
echo "\$NDK"
echo $text1
echo $text2

     :reset

    :
    
ls -l 
ls -la   
ls -l ja*      

    
touch today.c

    
cp src.txt dest.txt
cp -i src.txt dest.txt   
cp src.txt .        
cp -R    dest            
cp c_?1 ../            

    
rm file

    
rm -rf   

      :
file   

      :
cat file
cat -n file     

      10 
tail -n 10 file
        10 
head -n 10 file

    
useradd -m jack        ,   home  
userdel -r jack     

   
groupadd androidgroup
      
usermod -G androidgroup jack

    
r  w  x  
drwxr-xr-x
d rwx r-x r-x
d  
1.           (root            )
2.               ( 、  )
3.            ( 、  )

rwx       

  		   		   
---			000			0
--x			001			1
-w-			010			2
-wx			011			3
r--			100			4
r-x			101			5
rw-			110			6
rwx			111			7

      
chmod 644 file
         
chmod u+x file

           
umask 026

777-026

       
chown user.group file
chown user file
chown .group file

----------------------shell  
  
echo 

#!/bin/bash                                                                 
 2 NDK=10
 3 text="i love shell"
 4 
 5 #                
 6 text1=`date`
 7 text2=$(who)
 8 
 9 echo $NDK
10 echo $text
11 echo "$text very much"
12 echo "\$NDK"
13 echo $text1
14 echo $text2

         :
0   
127       
1     
126       

  if         0,    then  
if   
then 
     
fi

test    
-gt
-eq   
-le 
-ne    

test     
str1 == str2
str1 != str2
str1 < str2
-n str1      0
-z str1      0

    
-d       ,       
-e   file    
-f       ,       
-r       ,    
-w、-x
file1 -nt file2 file1 file2 
file1 -ot file2 file1 file2 

case  
case    in
pattern1)   ;;
pattern2)   ;;
*)     ;;
esac

for  
for var in list
do
	  
done	

while  
while test command
do
	  
done	

     :reset

    :
    
ls -l 
ls -la   
ls -l ja*      

    
touch today.c

    
cp src.txt dest.txt
cp -i src.txt dest.txt   
cp src.txt .        
cp -R    dest            
cp c_?1 ../            

    
rm file

    
rm -rf   

      :
file   

      :
cat file
cat -n file     

      10 
tail -n 10 file
        10 
head -n 10 file

    
useradd -m jack        ,   home  
userdel -r jack     

   
groupadd androidgroup
      
usermod -G androidgroup jack

    
r  w  x  
drwxr-xr-x
d rwx r-x r-x
d  
1.           (root            )
2.               ( 、  )
3.            ( 、  )

rwx       

  		   		   
---			000			0
--x			001			1
-w-			010			2
-wx			011			3
r--			100			4
r-x			101			5
rw-			110			6
rwx			111			7

      
chmod 644 file
         
chmod u+x file

           
umask 026

777-026

       
chown user.group file
chown user file
chown .group file

----------------------shell  
  
echo 

#!/bin/bash                                                                 
 2 NDK=10
 3 text="i love shell"
 4 
 5 #                
 6 text1=`date`
 7 text2=$(who)
 8 
 9 echo $NDK
10 echo $text
11 echo "$text very much"
12 echo "\$NDK"
13 echo $text1
14 echo $text2

         :
0   
127       
1     
126       

  if         0,    then  
if   
then 
     
fi

test    
-gt
-eq   
-le 
-ne    

test     
str1 == str2
str1 != str2
str1 < str2
-n str1      0
-z str1      0

    
-d       ,       
-e   file    
-f       ,       
-r       ,    
-w、-x
file1 -nt file2 file1 file2 
file1 -ot file2 file1 file2 

case  
case    in
pattern1)   ;;
pattern2)   ;;
*)     ;;
esac

for  
for var in list
do
	  
done	

while  
while test command
do
	  
done	


       
./14.sh 1> test7          test7  ,        


  ffmpeg
  shell    ,   ./configure --disable-yasm,              ,     gcc   ,   config.mak   

Maven、ANT、Gradle    

Makefile     ,    make                

   C/C++     ,configrue                (            Makefile       )
Makefile                

     Makefile  ?
1.        ,     ,   ,  
2.         ,       

plus.c
minus.c
multi.c
divi.c
main.c

.c -> .o    
.o ->   myapp,     

  make,        
       ,make main.o


  my-dir  ,  Android.mk       
LOCAL_PATH := $(call my-dir)      ,        
include file Makefile       Makefile  
include $(CLEAR_VARS)      ,  LOCAL_MODULE   
LOCAL_MODULE     
LOCAL_SRC_FILES         
LOCAL_C_INCLUDES       
LOCAL_SHARED_LIBRARIES         
gdb  

    -g  
gcc test1.c -g -o test1

    
gdb test1

    
start

    
list-  l
list     (      )
list   (      )

     
next-  n

    
print    -  p

       
step-  s

    
break   (gdb    )-  b

    
continue-       -  b

      
info breakpoints

    
delete breakpoints     

      
set var   = 

      
                ,        “ ”,        0   
backtrace-  bt

    
frame 1(         )

    
display    
      
undisplay   (       )

      
x /20   
x /20 buff-  buff    20   

       ,      ?
1.ulimit -a   core        
2.ulimit -c 1024    core     1024  
3.gcc test2.c -g -o test2         -g        
4../test2     ,   core    
5.gdb test2 core       ,              

좋은 웹페이지 즐겨찾기