4P by xguru 2019-09-15 | favorite | 댓글 1개

fselect path, size from /usr where size > 10M order by size desc limit 10

파일 시스템에 있는 정보 컬럼부터 exif 및 mp3 tag 정보까지 다양하게 사용가능

SUM,LENGTH,COUNT,AVG,YEAR,MIN,MAX 등 함수도 지원

name, path, abspath, size, fsize, uid, gid, accessed, created, modified, mode, user, group, sha1, sha256, sha512 등의 컬럼

지원하는 필드 리스트

이미지의 width,height
mp3 의 title,artist,album 등 태그
exif 의 lat,lon,model 등

find 보다 훨씬 유용하게 사용가능

https://github.com/jhspetersson/fselect/blob/0.6.5/src/field.rs#L89

"name" => Ok(Field::Name),
"path" => Ok(Field::Path),
"abspath" => Ok(Field::AbsPath),
"size" => Ok(Field::Size),
"fsize" | "hsize" => Ok(Field::FormattedSize),
"uid" => Ok(Field::Uid),
"gid" => Ok(Field::Gid),
"user" => Ok(Field::User),
"group" => Ok(Field::Group),
"created" => Ok(Field::Created),
"accessed" => Ok(Field::Accessed),
"modified" => Ok(Field::Modified),
"is_dir" => Ok(Field::IsDir),
"is_file" => Ok(Field::IsFile),
"is_symlink" => Ok(Field::IsSymlink),
"is_pipe" | "is_fifo" => Ok(Field::IsPipe),
"is_char" | "is_character" => Ok(Field::IsCharacterDevice),
"is_block" => Ok(Field::IsBlockDevice),
"is_socket" => Ok(Field::IsSocket),
"mode" => Ok(Field::Mode),
"user_read" => Ok(Field::UserRead),
"user_write" => Ok(Field::UserWrite),
"user_exec" => Ok(Field::UserExec),
"user_all" | "user_rwx" => Ok(Field::UserAll),
"group_read" => Ok(Field::GroupRead),
"group_write" => Ok(Field::GroupWrite),
"group_exec" => Ok(Field::GroupExec),
"group_all" | "group_rwx" => Ok(Field::GroupAll),
"other_read" => Ok(Field::OtherRead),
"other_write" => Ok(Field::OtherWrite),
"other_exec" => Ok(Field::OtherExec),
"other_all" | "other_rwx" => Ok(Field::OtherAll),
"suid" => Ok(Field::Suid),
"sgid" => Ok(Field::Sgid),
"is_hidden" => Ok(Field::IsHidden),
"has_xattrs" => Ok(Field::HasXattrs),
"is_shebang" => Ok(Field::IsShebang),
"width" => Ok(Field::Width),
"height" => Ok(Field::Height),
"mime" => Ok(Field::Mime),
"line_count" => Ok(Field::LineCount),
"duration" => Ok(Field::Duration),
"mp3_bitrate" | "bitrate" => Ok(Field::Bitrate),
"mp3_freq" | "freq" => Ok(Field::Freq),
"mp3_title" | "title" => Ok(Field::Title),
"mp3_artist" | "artist" => Ok(Field::Artist),
"mp3_album" | "album" => Ok(Field::Album),
"mp3_year" => Ok(Field::Year),
"mp3_genre" | "genre" => Ok(Field::Genre),
"exif_altitude" | "exif_alt" => Ok(Field::ExifGpsAltitude),
"exif_datetime" => Ok(Field::ExifDateTime),
"exif_latitude" | "exif_lat" => Ok(Field::ExifGpsLatitude),
"exif_longitude" | "exif_lon" | "exif_lng" => Ok(Field::ExifGpsLongitude),
"exif_make" => Ok(Field::ExifMake),
"exif_model" => Ok(Field::ExifModel),
"exif_software" => Ok(Field::ExifSoftware),
"exif_version" => Ok(Field::ExifVersion),
"is_binary" => Ok(Field::IsBinary),
"is_text" => Ok(Field::IsText),
"is_archive" => Ok(Field::IsArchive),
"is_audio" => Ok(Field::IsAudio),
"is_book" => Ok(Field::IsBook),
"is_doc" => Ok(Field::IsDoc),
"is_image" => Ok(Field::IsImage),
"is_source" => Ok(Field::IsSource),
"is_video" => Ok(Field::IsVideo),
"sha1" => Ok(Field::Sha1),
"sha2_256" | "sha256" => Ok(Field::Sha256),
"sha2_512" | "sha512" => Ok(Field::Sha512),
"sha3_512" | "sha3" => Ok(Field::Sha3),