Get the App
SLTechnology News&Howtos  ›  Development  › 

Linux deletes the script sharing of invalid link files

Shulou Source: shulou.com Published: 2022-06-03 11:28:18 11月15日 Update

This article mainly introduces "linux delete invalid link file script sharing", in the daily operation, I believe that many people have doubts in linux delete invalid link file script sharing problem, Xiaobian consulted all kinds of information, sorted out a simple and easy-to-use method of operation, hope to answer "linux delete invalid link file script sharing" doubt! Next, please follow the editor to study!

Executed under the Linux terminal to delete invalid linked files.

The code is as follows:

#! / bin/shusage () {echo "RemoveBroken 0.1, a shell script to remove broken link files." Echo "License: MIT, (c) chenzhiqiang" echo "Usage:" echo "$0-- help print this help." Echo "$0-- path PATH broken links under this PATH will be removed." Echo "$0-- stdin read PATHs from stdin." Echo "$0 same as $0-- stdin."} fromStdin () {while [1 REPLY 1] do read ["$REPLY"! = ""] | | exit 0 [!-L $REPLY-o-e $REPLY] | | unlink $REPLY done} fromPath () {find $2 | $0-stdin} if [$# = 0] then usage fromStdin exit 0ficase $1 in--stdin) fromStdin-- Path) find $2 | $0-- stdin--help) usage*) echo "RemoveBroken: unknown usage." Usageesac at this point, on the "linux delete invalid link file script sharing" study is over, I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Files links scripts learning more help practical next code articles methods theories knowledge articles terminals websites materials follow questions easy to use Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Technology Docker Linux Apple