arctic
arctic

Reputation: 819

How do I see files and directories in an EC2 instance?

I am connected to my ec2 instance and I am trying to see all of the files/directories on the instance. I am using ls but nothing is showing up.

How do I see files and directories in an EC2 instance?

Upvotes: 11

Views: 29332

Answers (1)

Marcin
Marcin

Reputation: 238299

To show all files in your home folder, use ls -la.

To copy files form local workstation to instance, your scp command is missing a destination folder. The following should overcome the issue (note :. at the end):

scp -i "[pem]" -r /[directory] ec2-user@ec2-[ip].amazonaws.com:.

Also since you have /[directory] this will look for the [directory] in the root of your filesystem, not your current working directory. For that, you can use (note .):

scp -i "[pem]" -r ./[directory] ec2-user@ec2-[ip].amazonaws.com:.

Upvotes: 12

Related Questions