下面分享几个可以提升Linux使用流畅的小技巧
1 linux改源
为了提高下载速度,这里更改源下载地址为阿里的
下面是整个source文件,可直接替换掉
**
> deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted > deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted >deb http://mirrors.aliyun.com/ubuntu/ xenial universe >deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe > deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse > deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse** > deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse > deb http://archive.canonical.com/ubuntu xenial partner > deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted >deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe > deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse > deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties > deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties > deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties > deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties > deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties > deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable > > deb-src [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable > > deb-src http://archive.canonical.com/ubuntu xenial partner
2 设置共享文件夹
设置共享文件夹就可以不用通过邮箱等传递文件了


5.进入虚拟机,安装VMware Tools


然后右键用终端打开。也可以先将其拷贝到linux里面,然后进入该目录
6.解压
tar zxvf VMwareTools-10.1.15-6627299.tar.gz
cd vmware-tools-distrib/
./vmware-install.pl
7.至此,在/mnt/hgfs/下应该就能看到刚才在虚拟机中设置的windows下的共享文件夹share了
8.最好创建一个软连接到home目录,方便进入共享目录
如,新建ishare文件夹
cd /mnt/hgfs
ln -s /mnt/hgfs/share/ ~/ishare
3.vim合理使用
4.1****普通模式
- G用于直接跳转到文件尾
- ZZ用于存盘退出Vi
- ZQ用于不存盘退出Vi
- /和?用于查找字符串
- n继续查找下一个
- yy复制一行
- p粘帖在下一行,P粘贴在前一行
- dd删除一行文本
- x删除光标所在的字符
- u取消上一次编辑操作(undo)
4.2****插入模式
在 Normal 模式下输入插入命令 i、 a 、 o进入insert模式。用户输入的任何字符都被vim当做文件内容保存起来,并将其显示在屏幕上。
- 在文本输入过程中,若想回到Normal模式下,按 Esc 键即可。
4.3****命令行模式
Normal 模式下,用户按冒号 :即可进入 Command 模式,此时 vim 会在显示窗口的最后一行 (屏幕的最后一行) 显示一个 “:” 作为 Command 模式的提示符,等待输入命令。
- :w 保存当前编辑文件,但并不退出
- :w newfile 存为另外一个名为 “newfile” 的文件
- :wq 用于存盘退出Vi
- :q! 用于不存盘退出Vi
- :q用于直接退出Vi (未做修改)
设置Vi环境:
-
:set autoindent 缩进,常用于程序的编写
-
:set noautoindent 取消缩进
-
:set number 在编辑文件时显示行号
-
:set nonumber 不显示行号
-
:set tabstop=value 设置显示制表符的空格字符个数
-
:set 显示设置的所有选项
-
:set all 显示所有可以设置的选项
4.不要随便扩容,容易失败
作者:@XiangFeiDe

被折叠的 条评论
为什么被折叠?



