📝

Linux/Docker Command CheatSheet

2024/07/03に公開

A collection of commands used on Linux and Docker.
Updates as sometimes.

Linux

Create file

touch filename.txt

Create directory

mkdir directory_name

current directory path

pwd

Moving files

mv file1 directory

Copy files

cp dir/file1.txt dir2/file2.txt

Delete directory/file

rm -r directory/file

Count files in a directory

find /dir -type f | wc -l

Docker

Copying files from host to container

# Check the container ID
$ sudo docker ps

$ sudo docker cp my.cnf <container ID>:/etc/my.cnf

Copying files from container to host

$ sudo docker cp <container ID>:/etc/my.cnf my.cnf

Discussion