Home >Operation and Maintenance >Docker >How to view files inside docker container

How to view files inside docker container

尚
Original
2020-04-02 10:42:1130087browse

How to view files inside docker container

You can use the docker exec ls command to view the files in the docker container.

docker exec: Execute the command in the running container

Syntax

docker exec [OPTIONS] CONTAINER COMMAND [ARG...]

ls command is used to display the contents of the specified working directory (list the current working directory files and subdirectories included).

Syntax

ls [-alrtAFR] [name...]

Example:

View the files in the /tmp directory (7a is the abbreviation of the container)

docker exec 7a ls /tmp

How to view files inside docker container

For more related tutorials, please pay attention to the docker tutorial column on the PHP Chinese website.

The above is the detailed content of How to view files inside docker container. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn