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).

1 point

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.

permalink
report
reply
3 points

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.

permalink
report
reply
13 points

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

permalink
report
reply

Linux

!linux@lemmy.ml

Create post

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

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

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

Community stats

  • 7.7K

    Monthly active users

  • 6.5K

    Posts

  • 179K

    Comments