-8
submitted 6 months ago by GustavoM@lemmy.world to c/linux@lemmy.ml

tl;dr

Editing;

$photoortexteditoryoulike $(find / -iname incompletefilenam*)

Running;

exec $(find / -iname incompletepackagenam*)

Interacting (copying, moving, etc);

$desiredinteraction $(find / -iname desiredfileorpackag*) /desired/output/directory

It may be a "not-so-attractive" tip for most of you, but I find it really useful when I want to edit a specific file (that is located alongside several ones, like a picture or a text file). Or when I've finished compiling something and I want to find the binary file asap. Saves me lots of time on really slow pcs (like a rpi zero).

top 3 comments
sorted by: hot top controversial new old
[-] evanstucker@lemmy.ml 13 points 6 months ago

Why not use bash-completion? The running example you gave is dangerous - you could end up running one or more of the wrong executables.

[-] andrew_s@piefed.social 3 points 6 months ago

I wouldn't do this personally, but if I did, I think I'd at least pipe the results to head -n 1 to only act on the first result.

[-] CsXGF8uzUAOh6fqV@lemmy.world 1 points 6 months ago

What about FZF? For example, I want to play a video file without digging through my files, I type fflpay and press ctrl-t which opens a fzf fuzzy finder. Type the incomplete name and select it. I would suggest this at least for the second example as running the wrong executable may get you in trouble. This is on the fish shell but I think other shells have similar possibilities. I also use this ctrl-t thing in combination with nvim or even cd.

this post was submitted on 17 Jun 2024
-8 points (30.0% liked)

Linux

48721 readers
2259 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS