[root@aminglinux-02 ~]# ls /root/.bash_history
/root/.bash_history
[root@aminglinux-02 ~]# history -c
[root@aminglinux-02 ~]# history
2 history
[root@aminglinux-02 ~]# echo $HISTSIZE
1000
[root@aminglinux-02 ~]# vim /etc/profile
HOSTNAME=`/usr/bin/hostname 2>/dev/null`
HISTSIZE=5000
[root@aminglinux-02 ~]# source /etc/profile
[root@aminglinux-02 ~]# echo $HISTSIZE
5000
改完需要source才能生效
[root@aminglinux-02 ~]# vim /etc/profile
HISTSIZE=5000
HISTTIMEFORMAT="%Y/%m/%d %H:%M:%S"
[root@aminglinux-02 ~]# source /etc/profile
[root@aminglinux-02 ~]# alias restartnet=‘systemctl restart network.service‘
[root@aminglinux-02 ~]# alias
alias cp=‘cp -i‘
alias egrep=‘egrep --color=auto‘
alias fgrep=‘fgrep --color=auto‘
alias grep=‘grep --color=auto‘
alias l.=‘ls -d .* --color=auto‘
alias ll=‘ls -l --color=auto‘
alias ls=‘ls --color=auto‘
alias mv=‘mv -i‘
alias restartnet=‘systemctl restart network.service‘
alias rm=‘rm -i‘
alias which=‘alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde‘
[root@aminglinux-02 ~]# ls /etc/profile.d/
256term.csh colorgrep.csh colorls.sh less.csh vim.sh
256term.sh colorgrep.sh lang.csh less.sh which2.csh
bash_completion.sh colorls.csh lang.sh vim.csh which2.sh
[root@aminglinux-02 ~]# ls *.txt
1.txt 2.txt 3.txt a.txt bb.txt
[root@aminglinux-02 ~]# ls *txt
1.txt 2.txt 3.txt a.txt bb.txt
[root@aminglinux-02 ~]# ls *txt*
1.txt 2.txt 3.txt a.txt bb.txt
[root@aminglinux-02 ~]# ls ?.txt
1.txt 2.txt 3.txt a.txt
[root@aminglinux-02 ~]# ls
1.txt 2.txt 3.txt anaconda-ks.cfg a.txt bb.txt
[root@aminglinux-02 ~]# ls ?txt
ls: 无法访问?txt: 没有那个文件或目录
[root@aminglinux-02 ~]# ls [123].txt
1.txt 2.txt 3.txt
[root@aminglinux-02 ~]# ls [0-3].txt
1.txt 2.txt 3.txt
[root@aminglinux-02 ~]# ls [12].txt
1.txt 2.txt
[root@aminglinux-02 ~]# ls [0-9a-zA-Z].txt
1.txt 2.txt 3.txt a.txt
[root@aminglinux-02 ~]# ls {1,2,3,a}.txt
1.txt 2.txt 3.txt a.txt
[root@aminglinux-02 ~]# echo 1212241 > a.txt
[root@aminglinux-02 ~]# ls [12].txt aaa.txt &> a.txt
[root@aminglinux-02 ~]# cat a.txt
ls: 无法访问aaa.txt: 没有那个文件或目录
1.txt
2.txt
[root@aminglinux-02 ~]# ls [12].txt aaa.txt &>> a.txt
[root@aminglinux-02 ~]# cat a.txt
ls: 无法访问aaa.txt: 没有那个文件或目录
1.txt
2.txt
ls: 无法访问aaa.txt: 没有那个文件或目录
1.txt
2.txt
[root@aminglinux-02 ~]# ls [12].txt aaa.txt >1.txt 2> a.txt
[root@aminglinux-02 ~]# cat 1.txt
1.txt
2.txt
[root@aminglinux-02 ~]# cat a.txt
ls: 无法访问aaa.txt: 没有那个文件或目录
[root@aminglinux-02 ~]# wc -l <1.txt ---打印1.txt的行数,左边必须是命令
2
[root@aminglinux-02 ~]# 2.txt < 1.txt
-bash: 2.txt: 未找到命令
原文:http://blog.51cto.com/akui2521/2105549