Common linux commands - Memo

Get the size of each file in a folder

ls -lh /path/to/your/directory

ls for list, -l for file-related parameters, permissions, modification time and name, -h for human readable

Get the size of a file

ls -lh /path/to/your/file

Go to the terminal of a Docker container

docker exec -it my_container_id bash

docker exec, the docker command to enter a running docker instance

-i stands for interactive

-t stands for ttv, which is a terminal, like a command line prompt.

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top