ubuntu 에서 Liux 상용 명령 소결

4127 단어 ubuntulinux지령
실험실 에 온 지 거의 한 달 이 되 었 는데 윈도 우 를 거의 건 드 리 지 않 고 ubuntu 에서 개발 한 후에 최근 에 자주 사용 하 는 Liux 명령 을 정리 하고 싶 습 니 다.
(0)su 와 sudo:루트 권한 획득

su    root  
sudo command    root  ,  command,         
su liaohuqiang        
(1)apt:패키지 설치 에 사용

apt list          
apt show        
sudo apt install      
sudo apt remove      
sudo apt-get check     
sudo apt update          
sudo apt upgrade     /         
(2)pip:python 모듈 을 설치 하 는 데 사용 합 니 다.(Liux 의 기본 명령 이 아니 라 sudo apt install pip 를 자체 적 으로 설치 해 야 합 니 다)

pip install    
pip uninstall    
pip list        
pip show          
pip check     
pip --version   pip     
pip help     
pip help install   install     option  
(3)ssh 와 scp:호스트 간 통신

ssh username@ip        
scp local_file username@ip:remote_directory            
scp -r local_directory username@ip:remote_directory             
(4)압축 및 압축 풀기:zip,unzip,tar

zip -r target.zip .                    
zip target.zip       ,             (     -r)
unzip source.zip -d 'folder'    folder   
unzip source.zip         
tar -zcvf target.tar.gz sorceFoler c    ,z   gzip   /  ,v        ,f         
tar -zxvf source.tar.gz -C 'folder'    folder   ,,  z  gzip   ,x    ,v           ,f               。
tar -xvf source.tar.gz     ,   z   ,    
(5)디스크 의 저장 소 점용 보기:du;파일 시스템 의 저장 소 점용 보기:df.

du -s --summarize      ,         。
du -h  K,M,G   ,        。
df -h  K,M,G   ,        。
df -T x        
(6)찾기 명령
6.1 which 는 PATH 변수 가 지정 한 경로 에서 시스템 명령 의 위 치 를 검색 하고 첫 번 째 검색 결 과 를 되 돌려 줍 니 다.
6.2 whereis 는 프로그램 이름 의 검색 에 만 사용 할 수 있 고 바 이 너 리 파일(파라미터-b),man 설명 파일(파라미터-m)과 소스 코드 파일(파라미터-s)만 검색 할 수 있 습 니 다.인 자 를 생략 하면 모든 정 보 를 되 돌려 줍 니 다.
6.3 locate 는 데이터베이스 에 맞 춰 파일 위 치 를 봅 니 다.Liux 는 시스템 내 모든 파일 을 데이터베이스 파일 에 기록 하지만 이 데이터 베 이 스 는 실시 간 으로 업데이트 되 지 않 습 니 다.
6.4 find 실제 하 드 디스크 검색 파일 이름.

find . -name '*.conf'           .conf   
updatedb      
locate                    
whereis python
which python
(7)파일 권한

chmod [ugoa][+-=][rwx]                    
u        ,g             ,o    
+      ,-      ,=        
r  ,w  ,x   
chmod u+x test               
     ,  r=4, w=2, x=1,
chmod 777 test                  
chown    [:  ]                      
(8)파일 과 텍스트 작업

grep str /tmp/test    /tmp/test   str
grep ^str /tmp/test    /tmp/test    str    
ls -ld */              
ls -l | grep '^d'              
wc -l       
wc -w       
ls -l | wc -l            ,     “   ”   
cp -a dir1 dir2     
mv dir1 dir2   /     
mkdir -p /tmp/dir1/dir2        
rm -f file1     
rm -rf dir1     
(9)프로 세 스

ps -e       
ps -f        
ps -u 'liaohuqiang' | grep 'tmux'            ,      'tmux'      
kill -2 pid   ctrl+C,               ,   
kill -9 pid         
top         
top -i              
k      
n          
u       
P  CPU      
q   
(10)네트워크

netstat       
netstat -a       
netstat -l        
netstat -t     tcp  
netstat -p         pid     
netstat -n     ip  ,        
         :netstat -anp | grep ssh
            :netstat -anp | grep ':80'
ifconfig       
(11)기타

date     
whoami        
who            
curl 'url' -O --progress     ,-O      (          ), --progress         
(curl  linux     ,     apt install curl)
echo $SHELL           shell
echo $PATH       
위 에서 말 한 것 은 편집장 이 여러분 에 게 소개 한 ubuntu 에서 Liux 가 자주 사용 하 는 명령 소결 입 니 다.여러분 에 게 도움 이 되 기 를 바 랍 니 다.만약 에 궁금 한 점 이 있 으 면 저 에 게 메 시 지 를 남 겨 주세요.편집장 은 제때에 여러분 에 게 답 할 것 입 니 다.여기 서도 저희 사이트 에 대한 여러분 의 지지 에 감 사 드 립 니 다!

좋은 웹페이지 즐겨찾기