linux的常见命令(linux mint)
查看进程
ps top(任务管理器)
杀死进程
kill PID(PID号需要自己输入,可用查看进程查看)
删除lock文件
sudo rm /var/lib/apt/lists/lock
删除文件
sudo rm -r filename(-r向下递归,不管多少级,都删除, -f强行删除,不提示)
卸载软件
sudo apt-get autoremove-- purge softname(softname自己输入)
查找文件路径
whereis filename(filename自己输入)
find / -name filename(filename自己输入)
查看当前进程
pwd
C++文件编译及运行
g++ test.cpp -0 test
./test
mv移动的命令
mv 12 1234 (将文件12重命名为1234)
mv /a /b/c (将/a文件夹 移动到/c下)
cp复制的命令
cp /home/work /home/temp (将work文件复制到temp下)
解压,压缩文件
zip xx.zip 压缩
unzip xx.zip 解压
tar zcvf xx.tar.gz 压缩
tar zxvf xx.tar.gz 解压
关于vim
vim的配置文件路径 /etc/vim/vimrc
vim保存没有权限的文件
:w !sudo tee% 或者 :w !sudo tee% > /dev/null
vim里找词 /word (word要找的词)
vimrc配置C++
1 syntax on 2 set shiftwidth=4 3 set tabstop=4 4 set softtabstop=4 5 set autoindent 6 set smartindent 7 set cursorline 8 set showmatch 9 set number 10 set cindent 11 inoremap( ()<ESC>i 12 13 map<F5> :call CR()<CR> 14 func! CR() 15 exec "w" 16 exec "!g++ -w -g % -o %<" 17 exec "! ./%<" 18 endfunc 19 map<F3> :call SetModel()<CR> 20 func SetModel() 21 let l = 0 22 let l = l + 1 | call setline(l, '#include <bits/stdc++.h>') 23 let l = l + 1 | call setline(l, '') 24 let l = l + 1 | call setline(l, 'using namespace std;') 25 let l = l + 1 | call setline(l, '') 26 let l = l + 1 | call setline(l, 'typedef long long LL;') 27 let l = l + 1 | call setline(l, '') 28 let l = l + 1 | call setline(l, 'int main() {') 29 let l = l + 1 | call setline(l, ' //freopen("in.txt","r",stdin);') 30 let l = l + 1 | call setline(l, ' //freopen("out.txt,"w",stdout");') 31 let l = l + 1 | call setline(l, ' ios_base::sync_with_stdio(0);cin.ti e();') 32 let l = l + 1 | call setline(l, '') 33 let l = l + 1 | call setline(l, ' return 0;') 34 let l = l + 1 | call setline(l, '}') 35 exec "8" 36 endfunc
ip简易设置
1 ifconfig eth0 202.199.117.12 netmask 255.255.254.0 2 route add default gw 202.199.117.254 3 echo "nameserver 202.96.64.68" > /etc/resolv.conf 4 echo "nameserver 8.8.8.8" >> /etc/resolv.conf