view the rest of the comments
Linux
Welcome to c/linux!
Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!
Rules:
-
Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.
-
Be respectful: Treat fellow community members with respect and courtesy.
-
Quality over quantity: Share informative and thought-provoking content.
-
No spam or self-promotion: Avoid excessive self-promotion or spamming.
-
No NSFW adult content
-
Follow general lemmy guidelines.
Man pages are displayed in
less
(which acts as the so-called "pager" here), so you can search them interactively like you search inless
. And you do that by pressing/
, then typing your search term and pressingEnter
. Then you can jump between results withn
andShift+n
. This is also how search works invim
, by the way.Perhaps another tip in this regard, to search in your command history with Bash (for re-running a command you've previously used), you can press
Ctrl+R
, then start typing your search term. PressingEnter
will run the displayed command. To skip older search results, pressCtrl+R
again. If you want to edit a command before running it, pressโ
orCtrl+F
instead ofEnter
.This UI is a bit fiddly in Bash, but worth figuring out.
As for Fish, it's great for new users, because:
Ctrl+R
UI, displaying all the search results interactively and not behaving weirdly in certain situations.โ
orCtrl+F
, or only use the next word from it viaAlt+F
. You can skip to older matches withโ
, which is then a proper search likeCtrl+R
in Bash, so not just prefix-matching. And yeah, overall just really useful, because it'll both make it quicker to run frequently-used commands, and sometimes suggest a complex command which I didn't even remember that I once ran.But:
Scripting is not a problem, because you can throw a shebang into the first line to use Bash syntax (
#!/bin/sh
or#!/bin/bash
). You should add a shebang to your scripts anyways.And running more complex commands isn't too big of a deal either, because you can run
bash
in your terminal to launch Bash, then paste the command into there to run it, and then quit back to Fish withexit
orCtrl+D
. Typically you'll know to runbash
, because Fish's syntax highlighting turns red after you've pasted a complex command.