GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
CS(1) FreeBSD General Commands Manual CS(1)

cs
concurrent ssh client

cs [-emqrstuVv1] [-c file] [-cmd] [-cname] [-d file] [-dd] [-du path] [-f script.sh] [-h hosts_file] [-hba] [-i identity_file] [-io] [-ip] [-l login_name] [-lip] [-mx] [-nc] [-nmap] [-ns] [-o output_file] [-P port] [-p path] [-ping] [-soa] [-to timeout] [-top] [-tr] [-tri] [-uname] [-vm] [command] [[user@]host] ...

cs is a program for concurrently executing local or remote commands on multiple hosts. It is using OpenSSH for running remote commands. Its main purpose is to help automate and manage large network of hosts.

The options are as follows:

file
Copy file to the remote machine.
Run an arbitrary local command concurrently on multiple hosts.
Run a local DNS query of type CNAME.
file
Download file from the remote machine. It will be saved in a directory named after the remote host only when you download from multiple servers.
Prints basic hardware information for a specific host (sudo(8) and dmidecode(8) required).
path
Prints the list of largest files in a specific directory (sudo(8) required, units in M).
Prints hosts with errors only.
script.sh
Run a local shell script on the remote host.
hosts_file
Read hostnames from the given hosts_file. Lines in the hosts_file can include commented lines beginning with a ‘#’ and only one host per line is allowed.
Lists installed HBAs and their WWPNs (Linux only).
identity_file
Selects a file from which the identity (private key) for public key authentication is read. The default is ~/.ssh/id_rsa.
Run remote iostat(1) on a specific host.
Lists network interfaces.
login_name
Specifies the user to log in as on the remote machine. This also may be specified on a per-host basis on the command line.
Scans storage interconnects for new luns (Linux only).
Lists mounted filesystems on a speficic host.
Run a local DNS query of type MX.
Tests a specific port with nc(1). Default is 22/tcp.
Scans host with nmap(1).
Run a local DNS query of type NS.
output_file
Saves standard output and standard error to a file.
port
Port to connect to on the remote host.
path
Specifies remote or local path for files in a remote copy or download mode.
Sends ICMP ECHO_REQUEST to network hosts.
Quiet mode. Supresses verbose standard output from remote machines. This mode reports success or failure only.
Recursively copy entire directories. It follows symbolic links encountered in the tree traversal.
Sort output.
Run a local DNS query of type SOA.
Force pseudo-tty allocation.
timeout
Specifies the timeout (in seconds) used when connecting to the SSH server. The default value is 4 seconds.
Run remote top(1) in batch mode on a specific host.
Run local traceroute(8).
Run local traceroute(8) using ICMP (local sudo(8) required).
Prints remote system information including OS version.
Run remote uptime(1) on a specific host.
Displays the version number and exit.
Verbose mode. Causes cs to print debugging messages from ssh(1) about its progress. This is helpful in debugging connection, authentication, and configuration problems. Multiple -v options increase the verbosity. The maximum is 3.
Run remote vmstat(8) on a specific host.
One line mode, useful for sorting output later.

The default method for authentication is a public key authentication which serves its purpose when dealing with multiple hosts. You can read more about public key authentication in ssh(1).

The cs utility exits 0 on success, and >0 if an error occurs.

Run a series of commands on hosts foo and bar:

$ cs 'uptime; uname -a' foo bar

Run a command on multiple hosts specified in a hosts_file:

$ cs -h hosts_file uptime

Run a local shell script on multiple hosts:

$ cs -f script.sh foo{1..100}

Run a local shell script with sudo(8) on multiple hosts:

$ cs -t -f script.sh foo{1..100}

Copy file to multiple hosts using a specific remote path:

$ cs -c file -h hosts_file -p /foo/bar

Download file from host:~ foo to a current working directory:

$ cs -d file foo

Download recursively files from /foo/bar from multiple hosts to a specific local path /tmp with subdirectories named after remote hosts:

$ cs -r -d '/foo/bar/*' -h hosts_file -p /tmp

Run a command on multiple hosts and sort the output:

$ cs -1 -h hosts_file 'free -m | grep Swap' | sort -rnk4 | head

Run local ping(1) on multiple hosts:

$ cs -ping foo{1..100}

Show name and size of all files matching the glob pattern:

$ cs -du '/var/log/mes*' foo{1..100}

scp(1), ssh(1), ssh_config(5), sudo(8)

Andy Kosela ⟨akosela@andykosela.com⟩
July 19, 2017 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.