Docker Commands to explore Volume and File System


 You can use the following command to open the file system and volume of docker

# Explore File System. 

docker exec -t -i <container-id/name> /bin/bash  
Replace container-id/name with container id or name  and run this command this will open you file system of docker for the container. to find out container id or detail use this cmd and copy the container id which you want to explore file system
docker container ls
#Explore volume
docker run -it --name admin -v <volume-name>:/var/lib/ ubuntu
You can use this command to explore the docker volume, to find out the available volume use this command . 
docker volume ls 
Replace <volume-name> with volume name which you want to explore this will use Ubuntu file system or cmd to perform operation on this system. There is other way to explore file using this command
docker run --rm -i -v=<volume-name>:/tmp/myvolume busybox find /tmp/myvolume
Some of basic cmd can be used with in explore file system/volume
ls <list>
ls
or ls to list down all the files and folder 
ls -l *
or to list down all the files with info like size of file etc. ls -l <filename> for single file 
cd <change directory>
cd <folder/dir name>
cd used to enter to a folder or direcory.
cd ..
cd space dot dot.  cd .. is used to return to previous dir/folder.
du -ma <filename> 
To check size of file in mb , -ka to check in kb .

These are some basic Ubuntu command you can use when you are in file/volume system. Comment down other cmd if you have.

Comments