(1)重定向 ls -l > /user/ljl/top.txt
ls -l >> /user/ljl/top.txt(追加)
(2)
echo ” 显示出里面的内容
echo this is pwd
显示this is /user
(3)Shell脚本编程 两个简单添加用户的例子
#!/bin/bash
#
#
useradd $1
echo $1 | passwd --stdin $1 &>/dev/null
echo "Add User $1 success"
写 #!/bin/bash
#
id 1 &>dev/null && echo "User1 exit.” && exit 2
id 1 &>dev/null || useradd1
id 1 &>dev/null && echo "1” | passwd –stdin 1 &>/dev/null && echo "Add User1 success.”
(4)
chmod u=rwx,g=rwx,o=rwx test2.sh
修改权限的写法