Temukan file dengan kueri seperti SQL
Meskipun tidak cenderung sepenuhnya menggantikan find tradisional dan ls , Fselect memiliki fitur -fitur bagus ini:
.gitignore , .hgignore , dan .dockerignore dukungan (eksperimental)Lebih banyak sedang berlangsung!
cargo install fselect Paket AUR, terima kasih untuk @asm0dey
Paket Aur Bin, terima kasih untuk @4censord
fselect di nixpkgs , terima kasih untuk @filalex77
Bangunan statis dengan musl.
Binary yang dikompilasi secara statis tersedia di unduhan GitHub.
winget install -e --id fselect.fselect choco install fselect scoop install fselect brew install fselect sudo port selfupdate
sudo port install fselect
fselect [ARGS] COLUMN[, COLUMN...] [from ROOT[, ROOT...]] [where EXPR] [group by COLUMNS] [order by COLUMNS] [limit N] [into FORMAT]
fselect -i
Deskripsi yang lebih rinci. Lihatlah contoh terlebih dahulu.
Temukan file sementara atau konfigurasi (jalur dan ukuran lengkap):
fselect size, path from /home/user where name = '*.cfg' or name = '*.tmp'
Pengguna Windows dapat menghilangkan kutipan:
fselect size, path from C:Usersuser where name = *.cfg or name = *.tmp
Atau masukkan semua argumen ke dalam kutipan seperti ini:
fselect "name from /home/user/tmp where size > 0"
Cari dalam nama direktori dengan spasi (backtick juga didukung):
fselect "name from '/home/user/dir with spaces' where size > 0"
fselect "name from `/home/user/dir with spaces` where size > 0"
Atau cukup lepas dari satu kutipan:
fselect name from '/home/user/dir with spaces' where size gt 0
Tentukan ukuran file, dapatkan jalur absolut, dan tambahkan ke hasilnya:
cd /home/user
fselect size, abspath from ./tmp where size gt 2g
fselect fsize, abspath from ./tmp where size = 5m
fselect hsize, abspath from ./tmp where size lt 8k
fselect name, size from ./tmp where size between 5mb and 6mb
Kueri yang lebih kompleks:
fselect "name from /tmp where (name = *.tmp and size = 0) or (name = *.cfg and size > 1000000)"
Fungsi agregat (Anda dapat menggunakan kawat gigi keriting jika Anda mau, dan bahkan menggabungkannya dengan tanda kurung biasa):
fselect "MIN(size), MAX{size}, AVG(size), SUM{size}, COUNT(*) from /home/user/Downloads"
Fungsi pemformatan:
fselect "LOWER(name), UPPER(name), LENGTH(name), YEAR(modified) from /home/user/Downloads"
Dapatkan tahun file tertua:
fselect "MIN(YEAR(modified)) from /home/user"
Gunakan satu kutipan jika Anda perlu membahas file dengan spasi:
fselect "path from '/home/user/Misc stuff' where name != 'Some file'"
Ekspresi reguler rasa karat didukung:
fselect name from /home/user where path =~ '.*Rust.*'
Meninggalkan ekspresi reguler:
fselect "name from . where path !=~ '^./config'"
Globs sederhana berkembang secara otomatis dan bekerja dengan = dan != Operator:
fselect name from /home/user where path = '*Rust*'
Klasik seperti:
fselect "path from /home/user where name like '%report-2018-__-__???'"
Operator pertandingan yang tepat untuk mencari dengan RegExps dinonaktifkan:
fselect "path from /home/user where name === 'some_*_weird_*_name'"
Temukan file berdasarkan tanggal:
fselect path from /home/user where created = 2017-05-01
fselect path from /home/user where modified = today
fselect path from /home/user where accessed = yesterday
fselect "path from /home/user where modified = 'apr 1'"
fselect "path from /home/user where modified = 'last fri'"
Lebih spesifik untuk mencocokkan semua file yang dibuat pada interval antara jam 3 sore dan 4 sore:
fselect path from /home/user where created = '2017-05-01 15'
Dan bahkan lebih spesifik:
fselect path from /home/user where created = '2017-05-01 15:10'
fselect path from /home/user where created = '2017-05-01 15:10:30'
Interval tanggal dan waktu mungkin (temukan semuanya diperbarui sejak 1 Mei):
fselect path from /home/user where modified gte 2017-05-01
Default adalah direktori saat ini:
fselect path, size where name = '*.jpg'
Cari di dalam beberapa lokasi:
fselect path from /home/user/oldstuff, /home/user/newstuff where name = '*.jpg'
Dengan kedalaman minimum dan/atau maksimum yang ditentukan ( depth adalah sinonim untuk maxdepth ):
fselect path from /home/user/oldstuff depth 5 where name = '*.jpg'
fselect path from /home/user/oldstuff mindepth 2 maxdepth 5, /home/user/newstuff depth 10 where name = '*.jpg'
Opsional ikuti symlink:
fselect path, size from /home/user symlinks where name = '*.jpg'
Pencarian di dalam arsip (saat ini hanya zip-archives yang didukung):
fselect path, size from /home/user archives where name = '*.jpg'
Atau dalam kombinasi:
fselect size, path from /home/user depth 5 archives symlinks where name = '*.jpg' limit 100
Aktifkan .gitignore atau .hgignore Dukungan HGignore:
fselect size, path from /home/user/projects gitignore where name = '*.cpp'
fselect size, path from /home/user/projects git where name = '*.cpp'
fselect size, path from /home/user/projects hgignore where name = '*.py'
Cari dengan dimensi gambar:
fselect CONCAT(width, 'x', height), path from /home/user/photos where width gte 2000 or height gte 2000
Temukan gambar persegi:
fselect path from /home/user/Photos where width = height
Temukan gambar dengan bagian nama yang diketahui tetapi ekstensi yang tidak diketahui:
fselect path from /home/user/projects where name = "*RDS*" and width gte 1
Temukan file mp3 rap sekolah lama:
fselect duration, path from /home/user/music where genre = Rap and bitrate = 320 and mp3_year lt 2000
Pintasan ke ekstensi file umum:
fselect path from /home/user where is_archive = true
fselect path, mime from /home/user where is_audio = 1
fselect path, mime from /home/user where is_book != false
Bahkan cara yang lebih sederhana menggunakan kolom boolean:
fselect path from /home/user where is_doc
fselect path from /home/user where is_image
fselect path from /home/user where is_video
Temukan file dengan izin berbahaya:
fselect mode, path from /home/user where other_write or other_exec
fselect mode, path from /home/user where other_all
Ekspresi seperti glob sederhana atau bahkan ekspresi reguler pada mode file dimungkinkan:
fselect mode, path from /home/user where mode = '*rwx'
fselect mode, path from /home/user where mode =~ '.*rwx$'
Temukan file oleh uid atau gid pemilik:
fselect uid, gid, path from /home/user where uid != 1000 or gid != 1000
Atau dengan nama pemilik atau grup:
fselect user, group, path from /home/user where user = mike or group = mike
Temukan file khusus:
fselect name from /usr/bin where suid
fselect path from /tmp where is_pipe
fselect path from /tmp where is_socket
Temukan file dengan xattrs, periksa apakah XATTR tertentu ada, atau dapatkan nilainya:
fselect "path, has_xattrs, has_xattr(user.test), xattr(user.test) from /home/user"
Sertakan teks sewenang -wenang sebagai kolom:
fselect "name, ' has size of ', size, ' bytes'"
Hasil Grup:
fselect "ext, count(*) from /tmp group by ext"
Hasil Pesanan:
fselect path from /tmp order by size desc, name
fselect modified, fsize, path from ~ order by 1 desc, 3
Akhirnya batasi hasilnya:
fselect name from /home/user/samples limit 5
Format output:
fselect size, path from /home/user limit 5 into json
fselect size, path from /home/user limit 5 into csv
fselect size, path from /home/user limit 5 into html
MIT/APACHE-2.0
Didukung oleh JetBrains Ide Lisensi Open Source