Ubuntu_1

##

1. Linux中的$PATH$HOME

$PATH: 指当前的环境变量
$HOME: 用户目录 /home/arcsinw,也就是~

以上都可以在bash中用echo打印出来

1
2
echo $PATH
echo $HOME

2. Ubuntu 安装golang时配置GOROOTGOPATH的问题

GOROOT:
GOPATH:

3. sudo: unable to resolve host ubuntu

原因是主机名与host中的不对应

修改主机名为ubuntu

1
vi /etc/hostname

或修改host,增加一条

1
127.0.0.1| ubuntu

再reboot

4. VMware 扩展Ubuntu虚拟机磁盘

1
sudo apt-get install gparted

扩展的unallocated空间在分区最右边的的位置,无法直接被合并到sda1
先把unallocated空间和左边相邻的分区(如sda2合并,合并后交换unallocatedsda2的位置(resize/move里鼠标拖动),再resize把unallocated这部分空间排挤出来,这样unallocated就和sda1相邻了,可以合并到sda1

5. ubuntu中减小root盘大小

使用gparted live cd启动虚拟机

6. 减小Vmware中Ubuntu虚拟机磁盘

分为三步:

1. Defragment (no need to un/remount anything)

1
sudo e4defrag /

Ignore any errors. Some files like symlinks and device files can’t be defragmented.

2. Zero-fill all unused space so VMware knows it’s indeed unused:

1
dd if=/dev/zero of=wipefile bs=1M; sync; rm wipefile

3. 在ubuntu虚拟机中, Run the shrink operation:

1
sudo vmware-toolbox-cmd disk shrinkonly

Reference

  1. https://superuser.com/questions/211798/how-to-reduce-the-size-of-vmware-disk