BKJIA exclusive Article] At present, more and more Linux servers are emerging in the enterprise network, and how to conveniently and efficiently manage a large number of Linux servers is a matter of great concern to system administrators. A large number of open-source management tools are available to implement such a management tool. Now we will introduce dsh, a tool that effectively manages a large number of Linux systems through command lines.
Dsh is designed to run Shell commands on a remote system. It simplifies operations on a large number of computers. The dsh command syntax is as follows:
Dsh [-m machinename |-a |-g groupname] [-f machinefile] [-M] [-q] [-- wait-shell] -- commandline
Common options:
-M: When the output of remote command execution is displayed, add the host name to the front.
-A: If you often operate on the same group of computers, you can create a group of global sets. The $ HOME/. dsh/machines. list file defines a global set. The IP address of each computer in the file. After-a is specified, dsh executes the specified command on all computers listed in machines. list.
-Q: Specifies the quiet mode output.
-M machinename: Specifies the computer on which the specified command is to be executed.
-G groupname: Specifies the computer group for which the specified command is to be executed. The host name group is in $ HOME /. the dsh/group/directory is defined. Each computer group has one file, and the file name is the IP address of each computer in the file.
-F machinefile: Specifies the computer list file.
-Wait-shell: by default, dsh runs commands on the computer in parallel. If you want to run commands sequentially, specify -- wait-shell.