Questions tagged [fd]
A user-friendly alternative to find command
16 questions
0 votes
0 answers
70 views
ps ax and -o fd
According to ps(1), ps doesn't support fd. even I didn't find fd in task_struct of kernel. How can I find fd of a program? َUPDATE: FD means File Descriptor. When I get query from services such as : ...
1 vote
1 answer
137 views
sort result of fd
I use fd to find file names containing only zeros. I want adopt this code to work with all files in folders, not with the only one file... This works not bad $ fdfind -tf -x bash -c '[ -s {} ] &&...
5 votes
1 answer
238 views
Removing /dev/fd from backup
I accidentally rsynced (with symlink following) my entire / to another disk. I was running rsync as a regular user. Realizing my mistake, I wanted to clean up the backup. It deleted all the files, ...
0 votes
1 answer
204 views
Fuzzy finding directories is slow
I have following bash script to find git repositories. echo "$(fd -I -i -H -E '.local' -E '.cargo' -E '.password-store' -t d ^.git$ ~ -x 'echo' '{//}' | sk)" fd pipes search results to sk (...
2 votes
1 answer
1k views
fd-find does not find anything
fd-find does not finding anything. When searching something in home directory it instantly exists without any error. ❯ mkdir root ❯ cd root ❯ touch test ❯ ls -l total 0 -rw-rw-r-- 1 s1n7ax s1n7ax 0 ...
1 vote
1 answer
598 views
How to display file and folder properties from search
I thought this would be easy and there are a lot of somewhat close threads on the internet, but nothing quite right. I want to use fd (simple find command) to display just file name and file size (...
2 votes
1 answer
801 views
How to exclude all hidden folders except content of .config with fdfind?
Using fd also known as fdfind, how would I go about not including any hidden directories and files except for all the content in the .config directory?
3 votes
1 answer
731 views
find (fd) execute with custom function and multiple parameters
I'm quite new to bash scripting so excuse the rough script. I'm writing a simple script that goes through all directories that has a .git directory in them, and checks if the worktree is clean or ...
0 votes
1 answer
534 views
How to search for directory containing file
I just discovered fzf (fuzzy finder) and now want to achieve the following using fd (https://github.com/sharkdp/fd): From the current directory find immediate parent directories of all files that ...
0 votes
0 answers
206 views
Does `fd-find` have an internal max-depth?
I have a bunch of files named like fn._mm* in a subdirectory: ... ./homedots/vim/plugged/YouCompleteMe/third_party/ycmd/third_party/rust-analyzer/share/doc/rust/html/core/core_arch/x86_64/avx512f/fn....
0 votes
2 answers
797 views
why i need to run pipe(2) so i can share data between processes?
This is a follow-up question, UNIX-focused i m trying to implement my own shell and i got stuck in the pipe feature after some research i found out that i need to run pipe(2) to share data between ...
1 vote
1 answer
3k views
fd --exclude all except dir1 dir2
fd searches files and directories, and can be called with except or prune as an option to limit the results. Is there a way to search only for specified directories? I want to use fd, in fzf, and have ...
1 vote
1 answer
321 views
Anchored excludes with find or fd
Let's say I want to find all files in a directory (recursively), but omit those e.g. in .git and node_modules subdirectories. I can do: $ fd -uut f -E .git -E node_modules But that will, for example, ...
0 votes
1 answer
208 views
Rename Subdirectories Recursively
I am trying to rename the following directory structure Tests Directory ├── Test1 Directory │ ├── 2 - 1. Data │ ├── 3 - 2. Data │ ├── 4 - 3. Data │ ├── 5 - 4. Data │ ├── 6 - 5. Data ├── ...
0 votes
1 answer
3k views
List all directories in home folder with fd
I'm trying to write a shell function to rapidly cd into any directory in my home folder, using the fd and fzf programs. This is what I have so far function fdcd() { cd "$(fd --type d --ignore-file ...