Shell基础
shell脚本的工作要求。
histroy命令
HISTTIMEFORMAT在默认情况下是不存在的。
alias--命令别名生效,放在~/.bashrc或/etc/profile.d/下面。
[root@liang-00 liang]# cd /etc/profile.d/ [root@liang-00 profile.d]# ls 256term.csh bash_completion.sh colorgrep.sh colorls.sh lang.csh less.csh sh.local vim.sh which2.sh 256term.sh colorgrep.csh colorls.csh csh.local lang.sh less.sh vim.csh which2.csh
# .bashrc # User specific aliases and functions alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc #他会执行/etc/bashrc fi ~ ~ ~
shell特殊符号
1> 正确输出重定向,2> 错误输出重定向。
&> 正确与错误一起重定向。
/etc/profile
/etc/bashrc
~/.bashrc
~/.bash_profile
文件的区别,作用。