SORU
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ş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • 30GB

    30GB

    14 AĞUSTOS 2006
  • Alfredo Garcia

    Alfredo Garc

    25 Mayıs 2007
  • Peter Sharp

    Peter Sharp

    11 ŞUBAT 2013