Basic Operations For A New Ubuntu System
Preliminary
安装与卸载
1
2
wsl --list
wsl --unregister Ubuntu
更改密码
1
2
sudo passwd update
su
添加代理
cat /etc/resolv.conf
查看IP地址,记作yourip- 查看代理窗口(如Clash客户端界面),记作yourport
- 进入WSL Ubuntu,执行
export ALL_PROXY="http://yourip:yourport"
- 当主机ip发生变化时需重新设置
换源
需要保证源的正确性:
- 通过
lsb_release -a
查看Ubuntu版本 - 参考网址:sunanli 复制源,更改
/etc/apt/sources.list
文件 sudo apt-get update
安装软件
sudo apt install vim
sudo apt install build-essential
sudo apt install valgrind
更改文件/目录权限
chown
命令,详见wuling129
wsl与windows文件相互访问
- wsl访问windows文件:
/mnt/
目录下即为windows磁盘 - windows访问wsl文件:文件管理器左侧显示的
Linux
即为wsl
Git 操作
设置用户信息
git config --global user.name ""
git config --global user.email ""
查看用户信息
git config user.name
git config user.email
设置记住密码
git config credential.helper store
常见操作
git clone xxx
git add/reset xxx
git commit -m ""
git push
git config --global --unset http.proxy
git config --global --unset https.proxy
Vim 操作
sudo apt-get install vim
.vimrc
配置文件
vim ~/.vimrc
open the config file- install Vundle and use it to install plugs you’d like to use.
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
- edit your .vimrc file and put your plug installation statement between
call vundle#begin()
andcall vundle#end()
. Just do it as follows:1 2 3 4 5 6 7 8
call vundle#begin() " default installation Plugin 'VundleVim/Vundle.vim' " install doxygen for better comments, usage like, :Dox, :DoxAuthor Plugin 'vim-scripts/DoxygenToolkit.vim' " install Chinese vim document, usage like, :help Plugin 'asins/vimcdoc' call vundle#end()
then, save the file and use
:PluginInstall
to start installation.
https://vimcdoc.sourceforge.net/
安装插件