linux命令的导入,[导入]Linux基本命令
1.touch - change file timestamps
touch myfile 創(chuàng)建一新文件
2.文件類型及權(quán)限 硬鏈接數(shù) 屬主 屬主所在組 更新時(shí)間 文件名
-rwxr-xr-x 1 wangfq wsdev 4096 03-10 15:26 target
3.chmod - change file access permissions
chmod u+x,o-r myfile(符號(hào)模式)
文件屬主 同組用戶 其他用戶(絕對(duì)模式)
r w x????????? r w x????????? r w x
4 + 2 + 1?? 4 + 2 + 1 4 + 2 + 1
chmod 744 myfile 賦予文件屬主讀、寫和執(zhí)行的權(quán)限,所有其他用戶讀的權(quán)限
4.子文件受其父目錄權(quán)限制約。
5.suid意味著如果某個(gè)用戶對(duì)屬于自己的s h e l l腳本設(shè)置了這種權(quán)限,那么其他用戶在執(zhí)行這一腳本時(shí)也會(huì)具有其屬主的相應(yīng)權(quán)限。guid執(zhí)行相應(yīng)腳本的用戶將具有該文件所屬用戶組中用戶的權(quán)限。
chmod u+s s
6.chown - change file owner and group
chown wangk myfile
chgrp - change group ownership
chgrp wsdev myfile
7,id - print user identity
uid= gid=
9.umask 代表沒有什么權(quán)限。目錄默認(rèn)全,文件默認(rèn)沒有執(zhí)行權(quán)限。
umask值 目錄 文件
0 2 2?????? 7 5 5?? 6 4 4
0 2 7??????? 7 5 0 6 4 0
umask 022
10. ln - make links between files
ln -s /tmp /var/tmp
11. crontab -e 編輯任務(wù)計(jì)劃 -l 瀏覽任務(wù)計(jì)劃
分 時(shí) 日 月 周??? [用戶] command
0?? 4??? *??? * * ?? root??? updatedb #每天早上4:00以root用戶身份執(zhí)行datedb命令
*/5 *?? *??? *??? *????? root?? ?? updatedb?? ???? #每五分制執(zhí)行一次
其中用戶root可以忽略不填,如:
1-59 * * * * echo "hello">>/root/hello.txt #每分鐘寫個(gè)hello到/root/hello.txt這個(gè)文件中
注意檢查一下crontab是否啟動(dòng),/etc/init.d/crond start
兩個(gè)大于號(hào)組成的“>>”,它和剛才“>”的區(qū)別在于一個(gè)大于符號(hào)的管道是用來(lái)創(chuàng)建一個(gè)新的文件filenames.txt,如 果已經(jīng)有了同名的文件就復(fù)蓋掉以前的內(nèi)容;而兩個(gè)大于符號(hào)的管道是用來(lái)在已經(jīng)存在的文件后面追加新的內(nèi)容,如果沒有這個(gè)文件就創(chuàng)建它。
總結(jié)
以上是生活随笔為你收集整理的linux命令的导入,[导入]Linux基本命令的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: linux抓源地址,【Linux】apt
- 下一篇: 【干货】Linux 运维故障排查思路,有