虚拟机里面linux下生成软链接文件共享

安装虚拟机vmware  tools

VMware Tools是VMware虚拟机中自带的一种增强工具,相当于VirtualBox中的增强功能(Sun VirtualBox Guest Additions),是VMware提供的增强虚拟显卡和硬盘性能、以及同步虚拟机与主机时钟的驱动程序。

把svn到wamp里面去的目录同步到虚拟机里面去

看看挂载情况

linux  df 命令

linux中df命令参数功能:检查文件系统的磁盘空间占用情况。可以利用该命令来获取硬盘被占用了多少空间,目前还剩下多少空间等信息。

  语法:df [选项]

  说明:linux中df命令可显示所有文件系统对i节点和磁盘块的使用情况。

  该命令各个选项的含义如下:

  -a 显示所有文件系统的磁盘使用情况,包括0块(block)的文件系统,如/proc文件系统。

  -k 以k字节为单位显示。

  -i 显示i节点信息,而不是磁盘块。

  -t 显示各指定类型的文件系统的磁盘空间使用情况。

  -x 列出不是某一指定类型文件系统的磁盘空间使用情况(与t选项相反)。

  -T 显示文件系统类型。

  功能:检查文件系统的磁盘空间占用情况。可以利用该命令来获取硬盘被占用了多少空间,目前还剩下多少空间等信息。

文件夹共享

实例:ln -s /mnt/hgfs/www   /home/wwwroot/www

linux下的软链接类似于windows下的快捷方式

ln -s a b 中的 a 就是源文件,b是链接文件名,其作用是当进入b目录,实际上是链接进入了a目录

如上面的示例,当我们执行命令   cd /home/wwwroot/www/的时候  实际上是进入了/mnt/hgfs/www

值得注意的是执行命令的时候,应该是a目录已经建立,目录b没有建立。我最开始操作的是也把b目录给建立了,结果就不对了

删除软链接:

   rm -rf  b  注意不是rm -rf  b/

ln  a b 是建立硬链接

建立链接的使用方法如下:

[root@localhost ~]# ln --help
Usage: ln [OPTION]... [-T] TARGET LINK_NAME (1st form)
or: ln [OPTION]... TARGET (2nd form)
or: ln [OPTION]... TARGET... DIRECTORY (3rd form)
or: ln [OPTION]... -t DIRECTORY TARGET... (4th form)
In the 1st form, create a link to TARGET with the name LINK_NAME.
In the 2nd form, create a link to TARGET in the current directory.
In the 3rd and 4th forms, create links to each TARGET in DIRECTORY.
Create hard links by default, symbolic links with --symbolic.
When creating hard links, each TARGET must exist. Symbolic links
can hold arbitrary text; if later resolved, a relative link is
interpreted in relation to its parent directory.

Mandatory arguments to long options are mandatory for short options too.
--backup[=CONTROL] make a backup of each existing destination file
-b like --backup but does not accept an argument
-d, -F, --directory allow the superuser to attempt to hard link
directories (note: will probably fail due to
system restrictions, even for the superuser)
-f, --force remove existing destination files
-i, --interactive prompt whether to remove destinations
-L, --logical make hard links to symbolic link references
-n, --no-dereference treat destination that is a symlink to a
directory as if it were a normal file
-P, --physical make hard links directly to symbolic links
-s, --symbolic make symbolic links instead of hard links
-S, --suffix=SUFFIX override the usual backup suffix
-t, --target-directory=DIRECTORY specify the DIRECTORY in which to create
the links
-T, --no-target-directory treat LINK_NAME as a normal file
-v, --verbose print name of each linked file
--help display this help and exit
--version output version information and exit

原文地址:https://www.cnblogs.com/examine/p/4644524.html