發表文章

目前顯示的是有「linux」標籤的文章

Linux 排程crontab 排程工作

 查看 現有排程 crontab -l 查看指定 user排程 sudo crontab -u d -l MIN HOUR DOM MON DOW CMD # ┌───────────── 分鐘 (0 - 59) # │ ┌─────────── 小時 (0 - 23) # │ │ ┌───────── 日 (1 - 31) # │ │ │ ┌─────── 月 (1 - 12) # │ │ │ │ ┌───── 星期幾 (0 - 7,0 是週日,6 是週六,7 也是週日) # │ │ │ │ │ # * * * * * /path/to/command # 每天早上 8 點 30 分執行 30 08 * * * /home/d/script.sh --your --parameter # 每週日下午 6 點 30 分執行 30 18 * * 0 /home/d/script.sh --your --parameter # 每週日下午 6 點 30 分執行 30 18 * * Sun /home/d/script.sh --your --parameter # 每年 6 月 10 日早上 8 點 30 分執行 30 08 10 06 * /home/d/script.sh --your --parameter # 每月 1 日、15 日、29 日晚上 9 點 30 分各執行一次 30 21 1,15,29 * * /home/d/script.sh --your --parameter # 每隔 10 分鐘執行一次 */10 * * * * /home/d/script.sh --your --parameter # 從早上 9 點到下午 6 點,凡遇到整點就執行 00 09-18 * * * /home/d/script.sh --your --parameter 修改現有排程 crontab -e

linux 掛載網路磁碟機

確認是否有連線網路磁碟機 df -k 確認是否有正確掛載資訊 vi /etc/fstab 確認是否有正確掛載資訊 /dev/mapper/centos-swap swap                     swap     defaults         0 0 如沒有,請補上資訊如以下 範例∶ //IP/資料夾/GitLab /media/資料夾/ cifs username=帳號,password=密碼,gid=1000,uid=1000 0 0 確認正確掛載資訊後,重新mount所有磁碟機 mount -a

[linux]查看哪個資料夾使用量最高

  使用 du -h -x --max-depth=1   查看哪個資料夾使用量最高 du -h -x --max-depth=1 刪除檔案 rm filename rm abc.txt

[Windows][Linux] 查詢連線數量(connections & sessions)

Linux: 看全部: netstat -aunt | wc -l 只看 TCP: netstat -ant | wc -l 只看 UDP: netstat -aut | wa -l Windows: 只看TCP: netstat -an | find "TCP" /c 只看UDP: netstat -an | find "UDP" /c

清除暫存的 DNS Cache

圖片
執行→ cmd ipconfig /flushdns 顯示清除成功,如下畫面 在Windows環境下,清除cache的指令如下: ipconfig /flushdns 在Mac OSX環境下,清除cache的指令如下: dscacheutil -flushcache 在Linux環境下,清除cache的指令如下: /etc/init.d/nscd restart

centos postfix 開放 http 寄信

要讓網站可以寄信 除了安裝postfix 及基本設定之外 還有一個重要的關鍵 首先,先利用以下指令查詢: getsebool -a | grep http 或 getsebool -a | grep httpd_can_sendmail 看看httpd_can_sendmail 這個值的設定值 預設為off httpd_can_sendmail --> off

CentOS Zip Unzip 壓縮 解壓縮 檔案或資料夾

壓縮資料夾 zip -r data.zip datafloder 壓縮單一檔案 zip  data.zip fileName.txt 解壓縮檔案 unzip data.zip

ubuntu 圖形模式 文字模式 切換

ubuntu 在一般圖形化模式切換至文字模式... Ctrl+Alt+F1 在一般文字切換至圖形化模式 ... Alt+F7

查看Linux版本

有以下命令可以查看: # lsb_release -a LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch Distributor ID: CentOS Description: CentOS release 5.4 (Final) Release: 5.4 Codename: Final 這個命令適用於所有的linux,包括Redhat、SuSE、Debian等發行版本。 root@MyMail ~ # uname Linux root@MyMail ~ # uname -r 2.6.18-164.el5 以下二種方法適用於RedHat,CentOS root@MyMail ~ # cat /etc/redhat-release CentOS release 5.4 (Final) 登錄到linux執行rpm -q redhat-release #rpm -q redhat-release 或CentOS root@MyMail ~ # rpm -q centos-release centos-release-5-4.el5.centos.1

[linux][centos] 防火牆設定 增加允許port

防火牆關閉 /etc/init.d/iptables stop 防火牆狀態查詢 /etc/init.d/iptables status