RSH(1)

๐Ÿ“ฆ
version 0.17 ยท 3 versions
, in epel 10, epel 9, fedora 43, fedora 44

๐Ÿ’ป RSH(1) โ€” bestie's guide to the remote shell ๐Ÿ’ป

okay so this is the rsh manual page, straight out of the General Commands Manual section 1, and i'm gonna walk you through it like we're texting at 2am ๐Ÿซถ


โœจ NAME โœจ

rsh โ€” remote shell. that's it, that's the vibe. it runs a shell on another machine. main character energy fr ๐Ÿ’…


โœจ SYNOPSIS โœจ

rsh [-Kdnx] [-l username] host [command]

yes bestie, all those flags are real, and yes, -K and -x are just sitting there in the synopsis like they own the place (spoiler: the description doesn't spell them out, so we don't either โ€” we report, we don't invent ๐ŸŒธ).


โœจ DESCRIPTION โœจ

So like, rsh executes command on host. that's the whole thing. iconic.

Here's the plumbing, and ngl it's kinda elegant: rsh copies its standard input to the remote command, and the standard output of the remote command gets copied back to its standard output, and the standard error of the remote command gets copied back to its standard error. it's giving relay race ๐Ÿƒโ€โ™€๏ธ

Interrupt, quit and terminate signals are propagated to the remote command. and rsh normally terminates when the remote command does โ€” like, it's loyal, it doesn't outlive its friend ๐Ÿ’€

The options are as follows:

  • -d โ€” turns on socket debugging (using setsockopt(2)) on the TCP sockets used for communication with the remote host. deep lore for the network girlies ๐Ÿ”
  • -l โ€” by default, the remote username is the same as the local username. the -l option allows the remote name to be specified. so like, you can be someone else over there. mysterious ๐Ÿ’…
  • -n โ€” redirects input from the special device /dev/null (see the โ€œBUGSโ€ section of this manual page โ€” yes we're going there, brace yourself ๐Ÿ˜ญ).

If no command is specified, you will be logged in on the remote host using rlogin(1). surprise! it's a whole different program. crossover episode ๐ŸŒˆ


๐Ÿฆ‹ the metacharacter situation ๐Ÿฆ‹

this is the part everyone gets wrong, so pay attention bestie:

Shell metacharacters which are not quoted are interpreted on local machine, while quoted metacharacters are interpreted on the remote machine. iykyk, the quotes are doing SO much work here ๐Ÿ‘‘

For example, the command

rsh otherhost cat remotefile >> localfile

appends the remote file remotefile to the local file localfile โ€” because that >> is unquoted, so your machine eats it. while

rsh otherhost cat remotefile ">>" other_remotefile

appends remotefile to other_remotefile โ€” because the quoted ">>" got shipped off to the remote side, so the remote shell reads it. literally the same three characters, completely different outcome. the quotes are the whole plot twist ๐ŸŽ€


โœจ FILES โœจ

  • /etc/hosts

that's the list. one file. she's minimalist ๐Ÿ“


โœจ SEE ALSO โœจ

(yes, that's the whole list, including the trailing comma energy. we keep it real.)


โœจ HISTORY โœจ

The rsh command appeared in 4.2BSD. vintage! antique! a literal elder of the Unix world ๐Ÿ‘‘


โœจ BUGS โœจ

okay bestie, sit down, this section is a mood ๐Ÿ˜ญ

  • If you are using csh(1) and put a rsh in the background without redirecting its input away from the terminal, it will block even if no reads are posted by the remote command. If no input is desired you should redirect the input of rsh to /dev/null using the -n option. (this is why -n exists. it's not a cute extra, it's a survival tool ๐Ÿ’€)
  • You cannot run an interactive command (like rogue(6) or vi(1)) using rsh โ€” use rlogin(1) instead. so no gaming or editing over here. wrong tool, bestie, wrong tool ๐Ÿ™ˆ
  • Stop signals stop the local rsh process only; this is arguably wrong, but currently hard to fix for reasons too complicated to explain here. (the manpage literally says "reasons too complicated to explain here" and honestly? relatable. we've all been there ๐Ÿ˜ญ)
๐Ÿ’€ real talk: this is an old tool with real rough edges โ€” the bugs above aren't decorative, they're warnings. take them seriously, bestie.

and that's the page!! this one's from Linux NetKit (0.17), dated August 15, 1999 โ€” so if you see a timestamp that old, no you didn't, that's just how long these vibes have been immaculate ๐Ÿฆ‹โœจ mwah ๐Ÿ’‹

๐Ÿ“ฆ where this page comes from