4 ms·
>_ This part will likely confuse people who are not familiar with shell and will create a bunch of thousands "_" files worldwide. Quick explanation: >_ ech
by wruza 6y ago
>_
This part will likely confuse people who are not familiar with shell and will create a bunch of thousands "_" files worldwide.
Quick explanation:
>_ echo hello
or equivalently:
echo hello >_
when executed in a shell creates a file named "_" with contents of "hello". Author seems to use ">_" as a terminal icon, but many will copy it as part of a command.
That is, if I'm not missing anything clever here.
Upd: copy button doesn't copy the >_ part, so the "icon" theory seems to be correct.
- 0xf8 6y agoalso it’s called a shell prompt for what it’s worth.
- kps 6y agoA ‘trick’ for fancy prompts containing information is to give them the form, : all the stuff; As long as ‘all the stuff’ is parseable as shell words (which you can ensure by quoting with printf '%q' if there's doubt), then you can copy and paste entire lines. The trivial copyable prompt would be :;
- chrisweekly 6y agoThank you for this!! TIL. Immediately adopting. Now wishing everyone else knew this too.
- kps 6y agoI read about this long ago, possibly in the Blit era, possibly in ;login: (other order, other reasons). It's old lore, but not widely known, so I try to mention in when the subject of prompts comes up.
- Arnavion 6y agoNote that this isn't guaranteed to be a no-op for arbitrary "all the stuff". Specifically it won't work for commands involving pipes, or commands involving command substitution / process substitution. That is: : bar "$(foo)" : bar <(foo) : < <(foo) bar : bar | foo will all still execute `foo`
- kps 6y agoThat's why I mentioned quoting.
- loudmax 6y agoAgreed, including the ">_" prompt in the command line isn't really helpful. The copy icon works, it's extra unnecessary cognitive overhead. Also, ">_" is an unusual prompt, I don't know what distro ships with that by default.
- LukeShu 6y ago">" is the prompt on MS-DOS, and "_" is the cursor. Somehow this has resulted in ">" or ">_" being the terminal "icon" even in unixy parts of the world; looking at the generic "utilities-terminal" icon: the default theme for Gnome 3 ("Adwaita") uses ">_" in the icon, the default theme for KDE ("Breeze") uses ">", and the runner-up ("Oxygen", which also comes bundled with KDE), also uses ">_".
- scarmig 6y agoAlso, the SSH app on Chromebooks.
- marcosdumay 6y agoThat's unfortunate, because on Linux the shells tend to use ">" for a continuation prompt, where you can not enter complete commands.
- tasuki 6y agoYes, I wonder what benefit there is to include `>_` as the prompt. The obvious drawback is confusing some poor souls. Also it's ugly, who would want to use `>_` as their prompt?
- roosgit 6y agoIt could have at least a less prominent color. And it could be added with a `::before` pseudo-element so you can't select it (just for decoration). Might be also annoying for screen readers without `aria-hidden`.
- bluedino 6y agoAm I some sort of weirdo because I don't recall seeing >_ used before as a prompt?
- prionassembly 6y ago_ is the blinking cursor. Prompt is just >
- bluedino 6y agoBut it doesn't blink.... > is kind of and odd prompt as well.
- tomcooks 6y agothe author should hide that "> _" by including it as a CSS :before or :after content, which by definition is not selectable.
- skinnyasianboi 6y agoAuthor of linuxcommandlibrary.com here. I did a quick fix and replaced ">_" with "$". I will dig into CSS :before during the next update. Thanks for the idea.
- skinnyasianboi 6y agoAuthor of linuxcommandlibrary.com here. You are 100% right. That was quite dump. I think I got the idea from the SSH icon I used in the basics page. Replaced ">_" with "$". Looks much better and I also updated some of the design and content on the site. Update is live.