There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

Editing (or running) file(s) regardless of current directory. [Cli tip]

tl;dr

Editing;


<span style="color:#323232;">$photoortexteditoryoulike $(find / -iname incompletefilenam*)
</span><span style="color:#323232;">
</span>

Running;


<span style="color:#323232;">exec $(find / -iname incompletepackagenam*)
</span><span style="color:#323232;">
</span>

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

CsXGF8uzUAOh6fqV ,
@CsXGF8uzUAOh6fqV@lemmy.world avatar

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.

andrew_s ,
@andrew_s@piefed.social avatar

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.

evanstucker ,

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

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines