[英]How to write a unix command or script to remove files of the same type in all sub-folders under current directory?
[英]command to list all the folders and sub-folders in a directory in linux
我想檢查目錄中的所有文件夾和子文件夾。
ls -R
可以正常工作,但是它列出了每個文件夾和子文件夾中的所有文件。 結果,除非ls -R |less
否則我看不到要檢查的內容。
ls -R | less
ls -R | less
是一個好選擇,因為每個子文件夾中都有成千上萬個文件。
安裝tree
包。 您可以使用-L
輕松更改目錄的最大顯示深度。
例如:
$ tree -L 1 /
/
├── bin -> usr/bin
├── boot
├── dev
├── etc
├── home
├── lib -> usr/lib
├── lib64 -> usr/lib
├── lost+found
├── media
├── mnt
├── opt
├── proc
├── root
├── run
├── sbin -> usr/bin
├── srv
├── sys
├── tmp
├── usr
└── var
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.