ls | egrep "/$"
ls | egrep "/$" | wc -l
میاد دایکرکتوری ها رو میشماره . ls | egrep -v "/$"
اون هایی که آخرشون / نیست رو نشون میده که احتمالا همون فایل ها هستند . du --max-depth=1
یعنی اینکه مثلا شما میخواین حجم فایل ها دایرکتوی / رو ببینید . خب داخل این دایرکتوری دایرکتوری home هم هست که یکسری فایل توشه ، با این سوییچ دیگه فایل های داخل اون رو نمایش نمیده و فقط یک لایه از فایل ها رو نشون میده .
find -maxdepth 2 -mindepth 1 -name "*mo*"
./fglrx/core-modprobe.conf
./x86_64-linux-gnu/libmount.so.1.1.0
./x86_64-linux-gnu/libmount.so.1
./x86_64-linux-gnu/libsystemd-daemon.so.0.0.10
./x86_64-linux-gnu/libkmod.so.2.2.5
./x86_64-linux-gnu/libsystemd-daemon.so.0
./x86_64-linux-gnu/libkmod.so.2
./x86_64-linux-gnu/plymouth
./init/apparmor-profile-load
./udev/usb_modeswitch
./modprobe.d
./firmware/moxa
./apparmor
./recovery-mode
./recovery-mode/recovery-mode
./modules
./linux-sound-base/noOSS.modprobe.conf
./linux-sound-base/noALSA.modprobe.conf
./modules-load.d
./plymouth
find -maxdepth 2 -mindepth 1 -name "*mo*" | xargs -i echo "this name is ".'{}'
خروجی:this name is ../fglrx/core-modprobe.conf
this name is ../x86_64-linux-gnu/libmount.so.1.1.0
this name is ../x86_64-linux-gnu/libmount.so.1
this name is ../x86_64-linux-gnu/libsystemd-daemon.so.0.0.10
this name is ../x86_64-linux-gnu/libkmod.so.2.2.5
this name is ../x86_64-linux-gnu/libsystemd-daemon.so.0
this name is ../x86_64-linux-gnu/libkmod.so.2
this name is ../x86_64-linux-gnu/plymouth
this name is ../init/apparmor-profile-load
this name is ../udev/usb_modeswitch
this name is ../modprobe.d
this name is ../firmware/moxa
this name is ../apparmor
this name is ../recovery-mode
this name is ../recovery-mode/recovery-mode
this name is ../modules
this name is ../linux-sound-base/noOSS.modprobe.conf
this name is ../linux-sound-base/noALSA.modprobe.conf
this name is ../modules-load.d
this name is ../plymouth
با wc هم میتونی نتیجه دستور رو بشماری find -maxdepth 2 -mindepth 1 -name "*mo*"|wc
20 20 536
یا میتونی بعد از پایپ دستور زیر رو بدی تا برات از نتایج لیست بگیره:xargs -i ls -ltrhs '{}'