今天是30天程式语言研究的第二十五天,由于最近写unix语言的东西用到很多,所以做了很多笔记,就想说也分享给大家。
笔记:
cp:
i=重複时问是否覆盖 p=连权限和修改时间都複製 r=複製目录
a=dr
cp name1 name2 複製name1名为name2
cat:
cat name 显示档案内容
cat -b name 列出行号, 空行不标行号
cat -n name 列出行号, 空行有标行号
cat > test.txt << eof 当输入到关键字eof中断 可以直接修改test.txt档
cat > test.txt (一般) 打甚么传甚么进test.txt直到ctrl d
more:
more name 显示档案内容
more -p name 清空页面再显示内容
clear:
clear 清空页面
cd:
cd 切回主目录
cd home/user/dir/..
cd - 回到前一个所在目录并显示位置
cd .. 回到上一层目录
chmod:
更改档案权限
chmod *** file 更改file的权限
*** ->u(user)g(group)o(other)
r=4, w=2, x=1
rwx=4+2+1=7 r-x=4+1=5 rw-=4+2=6
ex.chmod 777 user 把user的所有权限开启
chmod a=rwx user 开启user的使用者所有权限
chmod u=w user 把user使用者所有权转成-w-