ubuntu manual

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值