Nasıl bir dizin ağacındaki sembolik tüm bulabilirim?
Benim web sitesi için bir dizin ağacı içinde sembolik bulmak için çalışıyorum. find
bunu yapmak için kullanabilirim biliyorum ama özyinelemeli dizinleri kontrol etmek için nasıl çözemiyorum.
Şu an kullandığım komut
find /var/www/ -type l
Nasıl bu dizinleri kontrol gidilir?
Güncelleme:
Ben sadece /var/www içindekileri sembolik bağ olduğunu keşfetti. Komutu değiştirdim
find -L /var/www/ -type l
ve çalıştırmak için bir süre, ancak eşleşme alıyorum.
CEVAP
Bu yinelemeli /path/to/folder
dizin ve liste sadece sembolik bağlantıları çapraz olacak:
ls -lR /path/to/folder | grep ^l
Eğer niyetiniz sembolik bağlantıları da takip etmek, find
komutunu kullanmalısınız ama -L
seçeneği içermelidir; aslında find
man sayfasına diyor ki:
-L Follow symbolic links. When find examines or prints information
about files, the information used shall be taken from the prop‐
erties of the file to which the link points, not from the link
itself (unless it is a broken symbolic link or find is unable to
examine the file to which the link points). Use of this option
implies -noleaf. If you later use the -P option, -noleaf will
still be in effect. If -L is in effect and find discovers a
symbolic link to a subdirectory during its search, the subdirec‐
tory pointed to by the symbolic link will be searched.
When the -L option is in effect, the -type predicate will always
match against the type of the file that a symbolic link points
to rather than the link itself (unless the symbolic link is bro‐
ken). Using -L causes the -lname and -ilname predicates always
to return false.
O zaman bu deneyin:
find -L /var/www/ -type l
Bu muhtemelen çalışacaktır: -xtype
seçeneği değiştirmek için -type
seçeneği kullanıyorsanız: find
man sayfasında bu elmas buldu
l symbolic link; this is never true if the -L option or the
-follow option is in effect, unless the symbolic link is
broken. If you want to search for symbolic links when -L
is in effect, use -xtype.
Sonra:
find -L /var/www/ -xtype l
Nasıl hesapların yapılabilmesi dizi il...
İki dizin ağaçları verilen dosyaları n...
Nasıl script'Python ile s dizin b...
Nasıl bir programı çalıştıran dizin bu...
Nasıl Apple'In swift listesinde ö...