Command line in Linux

Hướng dẫn phân quyền Tập tin và Thư mục trên Linux dễ hiểu nhất (chmod, chown)

https://www.bkns.vn/huong-dan-tao-them-user-truy-cap-ssh-va-disable-user-root.html

Phân quyền trong Linux: Bài 1- Quản lý User, group và phân quyền trên linux

Check OS

cat /etc/*-release

Xem bạn là user nào trong linux

whoami

Xem group bạn đang thuộc về

groups <username>

Liệt kê User trên Linux

cat /etc/passwd

Liệt kê các Group trên Linux

cat /etc/group

Install zip on Ubuntu and Debian

sudo apt install zip

Install zip on CentOS and Fedora

sudo yum install zip

Install unzip

sudo apt-get install unzip

sudo yum install unzip

After installing the unzip utility, if you want to extract to a particular destination folder, you can use:

unzip file.zip -d destination_folder

If the source and destination directories are the same, you can simply do

unzip file.zip

Zip folder

zip -r archivename.zip directory_name

Getting the Size of a Directory

https://huongdan.azdigi.com/huong-dan-kiem-tra-dung-luong-file-thu-muc-chiem-dung-trong-linux/

sudo du -sh /var

Check size file & folder hàng loạt

du -h <path>

du -h folder_name/

 

Chuyển file giữa hai server bằng câu lệnh SSH

https://kiencang.net/chuyen-file-hai-server/

scp -r tên_user@ip_chứa_file_nguồn_của_bạn:/thư_mục_web_site/file_nguồn.zip /thư_mục_chứa_file_đích/
scp -r root@206.189.37.81:/home/speed.family/chimcatwp.zip /home/unzip.ducanhplus.com/