In this recipe, you will learn how to view the gear directory listing without performing SSH into the server using rhc.
To step through this recipe, you will need rhc installed on your machine. Also, we will use the OpenShift application created in the Creating an OpenShift application using the rhc command-line client recipe.
To run the ls
command without performing SSH into the application server, you should run the following command:
$ rhc app-ssh --app myapp --command ls
The rhc ssh
command is a short hand for rhc app-ssh
. Both these commands allow you to SSH into an application gear.
The rhc app-ssh
command internally uses the SSH command-line client to connect with the application gear. With the SSH command-line client, you can specify the command:
$ ssh [email protected] command
The rhc command-line client provides a --command
option that allows you to specify a command you want to run...