Find files di linux

Posting kali ini berisi tentang kumpulan perintah-perintah dalam melakukan pencarian/ searching di Linux

— Find files ignore case sensitif

$ find path -iname "yangDicari"

contoh
$ cd ~/fileSaya
$ find . -iname “xu*”
maka akan mencari di dalam fileSaya
./xubuntu_master_xubuntu_pxubuntu.zip
./xubuntu512
./xubuntu512/xubuntu512.vbox
./xubuntu512/xubuntu512.vbox-prev
./xubuntu512/xubuntu.vdi

atau

$ find / -iname "xu*"

— Parameter tambahan
-maxdepth 2
mencari maksimal 2 kedalaman direktori

-not
invert pencarian
contoh
$ find / -not -iname “xu*”

— mencari file 5 terbesar

$ find . -type f -exec ls -s {} \; | sort -n -r | head -5

untuk command lebih lengkap silahkan baca disini

— Find text di foldermore

$ grep -rnw '/path/to/somewhere/' -e 'pattern'
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Powered by WordPress.com.

Up ↑

%d bloggers like this: