0. Create
## create
mkdir -m 777 myfolder
touch myfile.txt
chmod 777 myfile.txt
1. Delete folder
1. Delete an empty folder
rmdir foldername
2. Delete a folder with files inside (most common)
rm -r foldername
3. Force delete (dangerous – no confirmation!)
rm -rf foldername
Check before deleting
ls -l /path/to/folder
2. Copy a file
1. Copy a file
cp sourcefile destination
cp /home/abc/test.txt /opt/workspace/
2. Copy multiple files
cp file1 file2 file3 /path/to/dest/
3. Copy a folder (recursive)
cp -r sourcefolder destination
4. Force overwrite (no prompt)
cp -rf source destination
3. 查看開通防火墻

授权
sudo mkdir -p /opt/openerp
sudo chown -R $USER:$USER /opt/openerp
sudo chmod -R 777 /opt/openerp
#Make executable 文件可以執行
sudo chmod +x /usr/local/bin/update_dev
sudo chmod +x /opt/workspace/worker_openerp/script_synch_git_dev
3. Kill Stops all Nginx processes immediately.
sudo lsof -i :80
sudo pkill nginx
4. Nginx 配置 Https
#Install Nginx
sudo apt update
sudo apt install nginx
#Start Nginx
sudo systemctl start nginx
#Enable Nginx at boot (auto start after restart)
sudo systemctl enable nginx
#Check Nginx status
sudo systemctl status nginx
#Restart Nginx (after config changes)
sudo systemctl restart nginx
sudo systemctl reload nginx
#Check if Nginx is listening on port 80
sudo ss -tlnp | grep 80
## 寫一個測試Test
echo "test" > /var/www/html/test.txt
通過域名訪問測試 wwww.mydomin.com/test.txt
5. PuTTY auto-save login
Copy public key content into authorized keys.



244

被折叠的 条评论
为什么被折叠?



