本文鏈接:
echo pwd>>pwd.sh
ls -l pwd.sh
查看文件或目錄的兩種方式
umask
umask -S
查看新建是否與默認(rèn)權(quán)限相符
umask
touch test1
mkdir test2
ls -l
修改pwd.sh文件權(quán)限為r-xr–r--
chmod 544 /root/pwd.sh
執(zhí)行pwd.sh
./pwd.sh
添加用戶stu,修改密碼為123
useradd stu
passwd stu
修改問(wèn)價(jià)test1的屬主為stulinux常用命令,test屬的組為stu
chmod stu test1
chgrp stu test2
ls -l
增加test1的屬主具有可執(zhí)行權(quán)限
chmod u+x test1
ls -l
查看文件的類型
file /study/bashrc
查詢ifconfig 和cd命令的完整文件名
which ifconfig
which cd
找出與passwd有關(guān)的“說(shuō)明文件”文件名
whereis -m passwd
找出系統(tǒng)中所有與passwd相關(guān)的文件名
locate passwd
列出系統(tǒng)3天前24小時(shí)內(nèi)修改過(guò)的文件
find / -mtime 3
使用find查找當(dāng)前目錄下比man.config新的文件linux常用命令,并存儲(chǔ)到man.config.new文件。
find/root/27083914 -newer man.config>man.config.new
列出/etc下比/etc/man.config新的文件
find /etc -newer /etc/passwd
查找系統(tǒng)中所有屬于root的文件和不屬于任何人的文件
find / -user root
find / -nouser
使用find查找/下面所有名稱為man.config的文件
find / -name man.config
使用locate查找所有名稱為man.config的文件
locate man.config
locate 更加詳細(xì)與man.config相關(guān)聯(lián)的也都列出來(lái)
找出/etc下文件類型為f的文件
find /etc -type f
找出系統(tǒng)大于1M的文件
上一個(gè)教程:Linux幾個(gè)重要命令
下一個(gè)教程:Linux joe 命令用法詳解