學習LINUX入門,/tmp檔案夾

來源:互聯網
上載者:User

標籤:tmp檔案夾   linux   清理   

       最近開始學習LINUX,關於/tmp檔案夾,

       查了些資料,/tmp檔案夾是存放linux臨時檔案的地方,在Linux系統中/tmp檔案夾裡面的檔案會被清空,至於多長時間被清空,如何清空的,可能就不清除了。

       在CentOS5.11中,可以利用/etc/cron.daily/tmpwatch 命令來清理/tmp檔案夾

       
[[email protected] ~]# cat /etc/cron.daily/tmpwatch
flags=-umc
/usr/sbin/tmpwatch "$flags" -x /tmp/.X11-unix -x /tmp/.XIM-unix \
        -x /tmp/.font-unix -x /tmp/.ICE-unix -x /tmp/.Test-unix \
        -X ‘/tmp/hsperfdata_*‘ 240 /tmp
/usr/sbin/tmpwatch "$flags" 720 /var/tmp
for d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do
    if [ -d "$d" ]; then
        /usr/sbin/tmpwatch "$flags" -f 720 "$d"
    fi
done

        這個指令碼第一行相當於一個標記(參數),第二行就是針對/tmp目錄裡面排除的目錄,第三行,這是對這個/tmp目錄的清理,下面的是針對其他目錄的清理。
     

本文出自 “KKMM” 部落格,請務必保留此出處http://lisiyun.blog.51cto.com/2779132/1671267

學習LINUX入門,/tmp檔案夾

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.