Home  >  Article  >  Operation and Maintenance  >  How to delete soft links in linux?

How to delete soft links in linux?

藏色散人
藏色散人Original
2019-05-21 16:03:3330693browse

How to delete soft links in linux?

How to delete soft links in Linux:

First we create a file

#mkdir test_chk
#touch test_chk/test.txt   
#vim test_chk/test.txt (这一步随便在这个test.txt里写点东东即可)

Let’s create a soft link to the test_chk directory

#ln-s test_chk     test_chk_ln

Now that the soft link is created, let’s see how to delete it

Correct deletion method (Delete soft links, but not actual data)

rm -rf  ./test_chk_ln

Wrong deletion method

rm -rf ./ test_chk_ln/ (This will delete the content under the original test_chk)

Now you can see the difference, so in the future everyone will use rm -rf to delete When using soft links, be careful! ! ! !

Related learning recommendations: linux video tutorial

The above is the detailed content of How to delete soft links in linux?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn