單條命令 ---->效率低----->適合少量工作
Shell Script--->效率高----->適合復(fù)雜 并且重復(fù)性工作
觀摩:
[root@oldboy ~]#cat user.sh
for i in {1..100}
do
useradd test$i
echo"Creat test$i Is OK!"
done
命令 [選項(xiàng)] [參數(shù)]
ls -a /tmp/
打針 重點(diǎn)|輕點(diǎn) 往哪打
命令: 主體
選項(xiàng):用來調(diào)節(jié)命令的輸出效果
-a 用這種方式來表示
--all 用這種方式來表示
使用選擇短格式-,在選項(xiàng)特別多的時(shí)候可以使用
-a -l -al
參數(shù):文件或路徑
PS:選項(xiàng)和參數(shù)可以出現(xiàn)位置調(diào)換的情況。
ls 列出當(dāng)前目錄下的內(nèi)容
[root@oldboy ~]#ls bash_logout
ls: cannot access bash_logout:No such file or directory
沒有找到這個(gè)文件或目錄
這個(gè)文件不存在,或者這個(gè)文件名稱寫錯(cuò)了
[root@oldboy ~]#useraddttt
-bash:useraddttt command not found 命令未找到