13 EKİM 2010, ÇARŞAMBA
özyineleme olmadan bul
Yinelenmesine olmayacak bir şekilde find
komutu alt dizinleri kullanmak mümkün mü? Örneğin,
DirsRoot
|-->SubDir1
| |-OtherFile1
|-->SubDir2
| |-OtherFile2
|-File1
|-File2
Ve find DirsRoot --donotrecuourse -type f
gibi bir şey sonucu sadece File1, File2
olacak?
CEVAP
13 EKİM 2010, ÇARŞAMBA
-maxdepth 1
seçeneği ile istediğini elde edersin, geçerli komut yapısına bağlı bence. Eğer değilse, find
man page bakmayı deneyebilirsiniz.
İlgili giriş (kolaylık için):
-maxdepth levels
Descend at most levels (a non-negative integer) levels of direc-
tories below the command line arguments. `-maxdepth 0' means
only apply the tests and actions to the command line arguments.
Senin seçenek temelde vardır:
find DirsRoot/* -maxdepth 0 -type f #This does not show hidden files
Ya da:
find DirsRoot/ -maxdepth 1 -type f #This does show hidden files
Bunu Paylaş:
Nasıl'==' sonsuz özyineleme ...
Test olmadan Maven ambalaj (test atla)...
Kuyruk özyineleme Python optimize mu?...
-XX:XX:PermSize olmadan MaxPermSize...
Neden int i = 1024 * 1024 * 1024 * 102...