LINUXSEC

fd — Alternatif Perintah Find di Linux

fd — Alternatif Perintah Find di Linux. Bagi kalian pengguna GNU/Linux tentu familiar dengan perintah find. Nah disini saya akan share salahsatu alternatif dari perintah find yakni fd. Perintah fd sendiri fungsinya sama seperti find, yakni untuk mencari string ataupun file berdasarkan inputan dari pengguna.

Fitur

  • Convenient syntax: fd PATTERN instead of find -iname ‘*PATTERN*’.
  • Colorized terminal output (similar to ls).
  • It’s fast (see benchmarks below).
  • Smart case: the search is case-insensitive by default. It switches to case-sensitive if the pattern contains an uppercase character*.
  • Ignores hidden directories and files, by default.
  • Ignores patterns from your .gitignore, by default.
  • Regular expressions.
  • Unicode-awareness.
  • The command name is 50% shorter* than find :-).
  • Parallel command execution with a syntax similar to GNU Parallel.

Instalasi

Untuk Ubuntu dan Debian, kalian bisa download paket deb nya dari GitHub.

wget https://github.com/sharkdp/fd/releases/download/v7.3.0/fd-musl_7.3.0_amd64.deb  
sudo dpkg -i fd-musl_7.3.0_amd64.deb

Untuk distro lain ada paketnya di repository.
Fedora

dnf install fd-find

Arch Linux

pacman -S fd

Gentoo

emerge -av fd

OpenSUSE

zypper in fd

Void Linux

xbps-install -S fd

Menggunakan Perintah fd
Untuk mengecek seluruh perintah yang dapat digunakan, cek

fd -h

Output

yuyudhn@YuzurihaInori:~$ fd -h
fd 7.3.0

USAGE:
    fd [FLAGS/OPTIONS] [<pattern>] [<path>...]

FLAGS:
    -H, --hidden            Search hidden files and directories
    -I, --no-ignore         Do not respect .(git|fd)ignore files
        --no-ignore-vcs     Do not respect .gitignore files
    -s, --case-sensitive    Case-sensitive search (default: smart case)
    -i, --ignore-case       Case-insensitive search (default: smart case)
    -F, --fixed-strings     Treat the pattern as a literal string
    -a, --absolute-path     Show absolute instead of relative paths
    -L, --follow            Follow symbolic links
    -p, --full-path         Search full path (default: file-/dirname only)
    -0, --print0            Separate results by the null character
    -h, --help              Prints help information
    -V, --version           Prints version information

OPTIONS:
    -d, --max-depth <depth>            Set maximum search depth (default: none)
    -t, --type <filetype>...           Filter by type: file (f), directory (d), symlink (l),
                                       executable (x), empty (e)
    -e, --extension <ext>...           Filter by file extension
    -x, --exec <cmd>                   Execute a command for each search result
    -X, --exec-batch <cmd>             Execute a command with all search results at once
    -E, --exclude <pattern>...         Exclude entries that match the given glob pattern
    -c, --color <when>                 When to use colors: never, *auto*, always
    -S, --size <size>...               Limit results based on the size of files.
        --changed-within <date dur="">    Filter by file modification time (newer than)
        --changed-before <date dur="">    Filter by file modification time (older than)

ARGS:
    <pattern>    the search pattern, a regular expression (optional)
    <path>...    the root directory for the filesystem search (optional)

Note: `fd -h` prints a short and concise overview while `fd --help` gives all details.
</path></pattern></date></date></size></when></pattern></cmd></cmd></ext></filetype></depth></path></pattern>

Kesimpulan

fd adalah alteratif dari p**erintah find di Linux** yang dapat kalian gunakan dengan beberapa kelebihan yang tidak ada di find.

Sekian tutorial kali ini, semoga bermanfaat. Jika ada yang ingin ditambahkan silahkan komentar.

Komentar

    Tinggalkan Komentar

    Silahkan tinggalkan komentar jika ada masukan, pertanyaan, kritik ataupun dukungan. Namun pastikan untuk berkomentar secara sopan.