An Introduction
Links created using the ln command are divided into soft links and hard links:
Soft Link: "ln–s source file Destination file" will only generate a mirror image of a file in the selected location and will not occupy disk space, similar to Windows shortcuts
Hard link: "ln source file Destination file", without parameter-s, generates a file of the same size as the source file at the selected location
The link created by the LN command, whether it is a soft link or a hard link, will control the file synchronization changes
It is important to note that the Mount–bind command can also create links, unlike Ln-s, where theMount–bind is to mount a directory to another directory, which is equivalent to creating a hard link
two to store Tomcat's logs on the home partition
If one of our Tomcat is installed under the /usr/local/apache-tomcat-sso path and then the log file is stored in the /home/usr/sso/logs directory, we can use LN- s creates a shortcut under the Tomcat path, the real path to the log file is/home/usr/sso/logs, and the command is as follows:
[Email protected] logs]# ln-s/home/usr/sso/logs/usr/local/apache-tomcat-sso[[email protected] logs]# ls-l/usr/local /apache-tomcat-sso
After creating a soft link, the effect is as follows:
Total 88
Drwxr-xr-x. 2 root root 4096 May 6 14:21 bin
Drwxr-xr-x. 3 root root 4096 May 6 14:21 conf
Drwxr-xr-x. 2 root root 4096 May 6 14:21 Lib
-rw-r–r–. 1 root root 57862 May 6 14:21 LICENSE
lrwxrwxrwx. 1 root root 6 14:32 logs- /home/usr/sso/logs
Drwxr-xr-x. 2 root root 4096 May 6 14:21 Temp
Drwxr-xr-x. 7 root root 4096 May 6 14:21 WebApps
Drwxr-xr-x. 3 root root 4096 6 14:21 work
This article is from "Zifangsky's personal blog" blog, make sure to keep this source http://983836259.blog.51cto.com/7311475/1835382
Store Tomcat's run log in the home partition via soft link ln-s