dsh(1)
π dsh(1) β the Dancer Tools reference, but make it a group chat π
okay bestie, sit down, hydrate, because we're about to talk about dsh(1). yes, the 1 means it's a user command, and yes, that's the whole manual page name, iykyk. π¦
β¨ NAME β¨
dsh β Distributed shell, or dancer's shell. two names, both iconic, no notes. π
β¨ SYNOPSIS β¨
dsh [-m machinename | -a | -g groupname] [-r remoteshellname] [-c | -w |
-i | -F forklimit ] -- commandline
look at her. she's got options and she's not afraid to use them. π
β¨ DESCRIPTION β¨
so like. dsh executes command remotely on several different machines at the same time. literally the whole point. it's a utility to effectively do this little bourne shell vibe:
for a in $(seq 1 10); do rsh $a command; done
...except you don't have to write that loop yourself, because you're a main character and main characters delegate. π
β¨ OPTIONS β¨
here's the whole lineup, no skips, no skimming, we respect every flag in this house. π«Ά
--verbose,-vβ gives you verbose output of the execution process. she's chatty. we love that for her.--quiet,-qβ makes output quieter. shhh. π€«--machine,-m[machinename[,machinename]] β adds *machinename to the list of machines that the command is executed on. the syntax of machinename allowsusername@machinename, where the remote shell is invoked with the option to make it ofusername. and from version0.21.4, you can specify it in the formatusername@machinename,username@machinename,username@machinenameso that multiple hosts can be specified with comma-delimited values. comma-delimited!! multi-host!! we ate. π₯--all,-aβ adds all machines found in/etc/dsh/machines.listto the list of machines that the specified command is executed on. all of them. the whole squad. π―--groupgroupname,-ggroupname β adds all machines found in/etc/dsh/group/groupnameto the list of machines that the specified command is executed on.- if groupname is on the form
@netgroupthen the machines in the given netgroup are used to specify the list of machines to execute on. netgroup girls, rise. π§
- if groupname is on the form
--filemachinefile,-fmachinefile β adds all machines found in the specified file to the list of machines that the specified command is executed on.- the file should list one machine specification per line (with the same syntax as the machinename argument). lines starting with
"#"are ignored. thank u for the comments, king. π - from version
0.21.4, specifying the same machine several times using any of the machine specification options will result in multiple invocations merged into one. so you can't double-dip, the machine gets counted once, periodt.
- the file should list one machine specification per line (with the same syntax as the machinename argument). lines starting with
--remoteshellshellname,-rshellname β executes remote shell shellname as the remote shell. usually any of"rsh","remsh"or"ssh"are available.--remoteshelloptrshoption,-orshoption β adds one option rshoption to the list of options passed on to the remote shell. one at a time, bestie, stack 'em up.--help,-hβ outputs the help message and exits. classic.--wait-shell,-wβ executes on each machine and waits for the execution to finish before moving on to the next machine. patient. polite. a gentlewoman. π--concurrent-shell,-cβ executes shell concurrently. everyone at once, chaos mode, love that.--show-machine-names,-Mβ prepends machine names on the standard output. useful to be used in conjunction with the--concurrent-shelloption so that the output is slightly more parsable. slightly. we take what we can get. β--hide-machine-names,-Hβ do NOT prepend machine names on the standard output. the opposite girl.--duplicate-input,-iβ duplicates the input to thedshprocess to individual processes that are remotely invoked. needs to have--concurrent-shellset. β οΈ- due to limitations in the current implementation, it is only useful for running shell. terminate the shell session with
ctrl-D.
- due to limitations in the current implementation, it is only useful for running shell. terminate the shell session with
--bufsize,-b[buffer-size in bytes] β sets the buffer size used in replicating input for the--duplicate-inputoption.--version,-Vβ outputs version information and exits.--num-topology,-Nβ changes the current topology from1.1is the default behavior of spawning the shell from one node to every node. changing the number to a value greater than2would result indshbeing spawned on other machines as well. πΈοΈ--forklimit,-Ffork limit β similar to-cwith a limit on the number of simultaneous connections.dshwill wait before creating a new connection if the limit is reached. useful when the number of nodes to be accessed is going somewhere above200, and using the-Noption is not possible. π (200 nodes?? bestie what are you doing)
β¨ EXIT STATUS β¨
- the first non-zero exit code of child processes is returned, or zero if none returned a non-zero exit code.
1if an error is found in command-line specifications.2if a signal is received from child processes.
so if something goes sideways, you'll know exactly which flavor of sideways. πΈ
β¨ EXAMPLES β¨
these are the vibes, copy them, they're free:
dsh -a w
shows the list of users logged in on all workstations.
dsh -r ssh -a -- w
shows the list of users logged in on all workstations, and uses the ssh command to connect. (it should be of note that when using ssh, ssh-agent is handy.) π
dsh -r ssh -m node1 -m node2 -c -- 'echo $HOSTNAME $(cat/proc/loadavg )'
shows the load average of machines node1 and node2.
β¨ FILES β¨
/etc/dsh/machines.list|$(HOME)/.dsh/machines.listβ list of machine names to be used for when the-acommand-line option is specified./etc/dsh/group/groupname|$(HOME)/.dsh/group/groupnameβ list of machine names to be used for when the-ggroupname command-line option is specified./etc/dsh/dsh.conf|$(HOME)/.dsh/dsh.confβ configuration file containing the day-to-day default. the daily driver. π
β¨ BUGS β¨
- there should be a
dcpfor copying files to remote systems. (manifesting this for us fr fr π) - configuration files should really be able to do something more than they do now. we're all waiting. π
β¨ AUTHOR β¨
Junichi Uekawa (dancer@debian.org)
upstream page is available at http://www.netfort.gr.jp/~dancer/software/dsh.html β go say hi to the upstream, she's iconic. π
β¨ SEE ALSO β¨
rsh(1), ssh(1), remsh(1), dsh.conf(5), cssh(1), dish(1), pssh(1), taktuk(1)
the whole friend group. go read them, they're all valid. π¦
okay that's the whole page, you now know dsh better than most people know themselves. this came to you from the Debian-Beowulf/Dancer era, dated 2007 Aug 15, which honestly is giving vintage-but-still-slaying. go forth and distribute that shell, bestie. πβ¨π
π¦ where this page comes from
- debian bookworm: dsh 0.25.10-1.5
- debian trixie: dsh 0.25.10-2 Β· GPL-2.0-or-later
- ubuntu jammy: dsh 0.25.10-1.4
- ubuntu noble: dsh 0.25.10-1.6build1 Β· GPL-2.0-or-later
- ubuntu questing: dsh 0.25.10-2
- ubuntu resolute: dsh 0.25.10-2build1 Β· GPL-2.0-or-later
- ubuntu stonking: dsh 0.25.10-2build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms