current position:Home>Soft connection, hard connection, Linux easy to mix words
Soft connection, hard connection, Linux easy to mix words
2022-01-26 23:29:44 【Websoft9】
This is my participation 8 The fourth of the yuegengwen challenge 5 God , Check out the activity details :8 Yuegengwen challenge
In the process of our study and practice , We often encounter two relative words :Linux Soft connection in 、 Hard to connect . These two words are easily confused 、 It's hard to distinguish , It will bring some problems in our use . today , Xiao Jiu will take you to sort out these two words ~
Soft connection
A soft connection is a file that points to another file , similar Windows Shortcut file in .
Soft connection query method
How can I know which files are soft link files ?
Let's get in first etc Catalog , Then list the files ( With re Keywords are screened as results )
[email protected]:/etc# ls -l | grep re
-rw-r--r-- 1 root root 367 Jan 27 2016 bindresvport.blacklist
drwxr-xr-x 2 root root 4096 Apr 9 06:04 firefox
lrwxrwxrwx 1 root root 33 Dec 25 16:13 localtime -> /usr/share/zoneinfo/Asia/Shanghai
-rw-r--r-- 1 root root 105 Jan 30 20:28 lsb-release
lrwxrwxrwx 1 root root 21 Jan 30 20:28 os-release -> ../usr/lib/os-release
drwxr-xr-x 4 root root 4096 Dec 25 16:13 resolvconf
lrwxrwxrwx 1 root root 29 Dec 25 16:13 resolv.conf -> ../run/resolvconf/resolv.conf
-rw-r--r-- 1 root root 3663 Jun 9 2015 screenrc
-rw-r--r-- 1 root root 4141 Jan 25 2018 securetty
-rw-r--r-- 1 root root 1656 Jul 25 2019 tmpreaper.conf
[email protected]:/etc# ls -l | grep ^l
lrwxrwxrwx 1 root root 33 Dec 25 16:13 localtime -> /usr/share/zoneinfo/Asia/Shanghai
lrwxrwxrwx 1 root root 19 Dec 26 00:11 mtab -> ../proc/self/mounts
lrwxrwxrwx 1 root root 21 Jan 30 20:28 os-release -> ../usr/lib/os-release
lrwxrwxrwx 1 root root 29 Dec 25 16:13 resolv.conf -> ../run/resolvconf/resolv.conf
lrwxrwxrwx 1 root root 23 Dec 25 16:08 vtrgb -> /etc/alternatives/vtrgb
Copy code
In the example above , We're running ls -l
command , Shows several different types of files :
- lrwxrwxrwx: This kind of l The beginning is the soft connection file
- drwxr-xr-x: This kind of d The beginning is the directory
- -rw-r--r--: This kind of - The beginning is the file
How to create soft connection
After knowing what soft connection is , We can do the soft connection by ourselves :
cd /root
ln -s /usr/share/zoneinfo/Asia/Shanghai2 mysoftlink
file mysoftlink
Copy code
Delete method of soft connection
rm -rf mysoftlink
Copy code
Be careful :
- The name of the connected file ( route ) Absolute path is recommended
- Wrong soft connection ( Also known as disconnection ) Use
ls -l
It's shown in red when you are - Soft link is a file , There are data blocks in the hard disk
- The path information is stored in the database of soft connection file , Not real data
- Soft connections can be multi-level nested , for example :B Connect A,C Connect B,D Connect C
Hard to connect
Hard connection is relative to soft connection , It will be a little difficult to understand . Hard connection is to map different file names to the same storage block node .
for example : There is a data block in the server hard disk, which is a small video , The file name of this small video is :/data/mymedia.mp4.
Create a hard connection , Just use ln
Command is enough
cd /data
ln /data/mymedia.mp4 mymedia2.mp4
Copy code
matters needing attention :
- The name of the connected file ( route ) Absolute path is recommended
- If a file adds a corresponding hard connection , Then the data will not be deleted when deleting the file
- Hard wired files store real block locations
- Only hard connections can be made to files , Instead of establishing a hard connection to a directory
Hard link and the same website in domain name management , use A The two domain names in the record configuration are of the same principle . Soft connection and domain name management cname Analysis is a similar principle .
This paper is written by Websoft9 Original release , Reprint please indicate the source .
copyright notice
author[Websoft9],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201262329418740.html
The sidebar is recommended
- Spring IOC container loading process
- [thinking] the difference between singleton mode and static method - object-oriented programming
- Hadoop environment setup (MySQL environment configuration)
- 10 minutes, using node JS creates a real-time early warning system for bad weather!
- Git tool
- Force deduction algorithm - 92 Reverse linked list II
- What is the sub problem of dynamic programming?
- C / C + +: static keyword summary
- Idea does not have the artifacts option when configuring Tomcat
- Anaconda can't open it
guess what you like
-
I don't know how to start this
-
Matlab simulation of transportation optimization algorithm based on PSO
-
MySQL slow log optimization
-
[Vue] as the window is stretched (larger, smaller, wider and higher), the text will not be displayed
-
Popular Linux distributions for embedded computing
-
Suzhou computer research
-
After installing SSL Certificate in Windows + tomcat, the domain name request is not successful. Please answer!!
-
Implementation time output and greetings of jQuery instance
-
The 72 year old uncle became popular. Wu Jing and Guo fan made his story into a film, which made countless dreamers blush
-
How to save computer research
Random recommended
- Springboot implements excel import and export, which is easy to use, and poi can be thrown away
- The final examination subjects of a class are mathematical programming, and the scores are sorted and output from high to low
- Two pronged approach, Tsinghua Professor Pro code JDK and hotspot source code notes, one-time learning to understand
- C + + recursive knapsack problem
- The use of GIT and GitHub and the latest git tutorial are easy to understand -- Video notes of crazy God speaking
- PostgreSQL statement query
- Ignition database test
- Context didn't understand why he got a high salary?, Nginxfair principle
- Bootstrap switch switch control user's guide, springcloud actual combat video
- A list that contains only strings. What other search methods can be used except sequential search
- [matlab path planning] multi ant colony algorithm grid map path planning [including GUI source code 650]
- [matlab path planning] improved genetic algorithm grid map path planning [including source code phase 525]
- Iinternet network path management system
- Appium settings app is not running after 5000ms
- Reactnative foundation - 07 (background image, status bar, statusbar)
- Reactnative foundation - 04 (custom rpx)
- If you want an embedded database (H2, hsql or Derby), please put it on the classpath
- When using stm32g070 Hal library, if you want to write to flash, you must perform an erase. If you don't let it, you can't write continuously.
- Linux checks where the software is installed and what files are installed
- SQL statement fuzzy query and time interval filtering
- 69. Sqrt (x) (c + + problem solving version with vs runnable source program)
- Fresh students are about to graduate. Do you choose Java development or big data?
- Java project: OA management system (java + SSM + bootstrap + MySQL + JSP)
- Titanic passenger survival prediction
- Vectorization of deep learning formula
- Configuration and use of private image warehouse of microservice architect docker
- Relearn JavaScript events
- For someone, delete return 1 and return 0
- How does Java dynamically obtain what type of data is passed? It is used to judge whether the data is the same, dynamic data type
- How does the database cow optimize SQL?
- [data structure] chain structure of binary tree (pre order traversal) (middle order traversal) (post order traversal) (sequence traversal)
- Webpack packaging optimization solution
- 5. Operation element
- Detailed explanation of red and black trees
- redhat7. 9 install database 19C
- Blue Bridge Cup notes: (the given elements are not repeated) complete arrangement (arrangement cannot be repeated, arrangement can be repeated)
- Detailed explanation of springboot default package scanning mechanism and @ componentscan specified scanning path
- How to solve the run-time exception of test times
- Detailed explanation of k8s management tool kubectl
- Android system view memory command