我是靠谱客的博主 笑点低铃铛,这篇文章主要介绍windows 下使用 ubuntu 子系统,现在分享给大家,希望可以做个参考。

首先可以按照 这篇博文 对 terminal 进行美化!

更换软件源

ubuntu官方的源下载较慢,换成阿里云的!参考链接

替换 /etc/apt/source.list 为以下内容,做好备份!!

复制代码
1
2
3
4
5
6
7
8
9
10
11
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

最后使用 sudo apt update 更新

实用工具安装

name作用
tldr查看命令帮助
tesseract-ocr图片文字识别
ffmpeg视音频处理工具
git不知道就不用装
tree目录树
autojump目录直达
poppler-utils包含一系列pdf处理工具 pdfunite等
unar解压工具
复制代码
1
2
3
4
5
6
7
8
9
10
sudo apt update sudo apt install tldr tesseract-ocr git ffmpeg tree autojump poppler-utils unar # autojump 安装好后,还不能直接使用,直接运行以下命令: echo ". /usr/share/autojump/autojump.bash" >> ~/.bashrc # 更改权限 sudo chmod 755 /usr/share/autojump/autojump.bash # 更新 .bashrc source ~/.bashrc
  • github 配置
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# git config --list # 显示当前的Git配置 # git config -e [--global] # 编辑Git配置文件 git config [--global] user.name "[name]" # 设置提交代码时的用户信息 git config [--global] user.email "[email address]" git config --global color.ui true # 让Git显示颜色,会让命令输出看起来更醒目 # 配置别名 git config --global alias.st status git config --global alias.co checkout git config --global alias.ci commit git config --global alias.br branch git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" # 配置SSH Key ssh-keygen -t rsa -C "youremail@example.com" # 配置免密 # 下次执行git push再次输入用户名之后,git就会记住用户名密码并在上述目录下创建.git-credentials文件,记录的就是输入的用户名密码。 vim ~/.gitconfig # 在后面追加如下两行 cat>>~/.gitconfig<<EOF [credential] helper=store EOF
  • 自定义一些别名
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
cat>>~/.bashrc<<EOF # alias set alias la='ls -A' alias lh='ls -lh' alias l='ls' alias cp='cp -v' alias mv='mv -v' alias rm='rm -v' alias vi='vim' alias lm='ls -l|grep "^-"| wc -l' #当前目录下文件个数 EOF
  • 配置vim
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
cat>>~/.vimrc<<EOF " 自动匹配括号 inoremap { {}<LEFT> set number set ruler set showcmd set hls "this will make mouse active set mouse=a "Set up tab spaces set tabstop=4 softtabstop=4 shiftwidth=4 expandtab set autoindent "To speed up vim set re=1 set ttyfast set lazyredraw set scrolljump=10 "设置非输入模式时按enter也换行 nmap <CR> o<Esc> EOF
  • 设置 page up/page down 来快速定位历史命令

  • 设置终端仅显示当前文件夹名称

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
# 修改 ~/.bashrc 第 60 行的 w 改为大写的 W 即可 59 if [ "$color_prompt" = yes ]; then 60 PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]W[33[00m]$ ' 61 else 62 PS1='${debian_chroot:+($debian_chroot)}u@h:w$ ' 63 fi

最后

以上就是笑点低铃铛最近收集整理的关于windows 下使用 ubuntu 子系统的全部内容,更多相关windows内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(76)

评论列表共有 0 条评论

立即
投稿
返回
顶部