作用 echo $$ 是显示当前会话进程号 echo $? 是返回上一条命令是否正确 echo > 2.txt 或者 >2.txt 插入空 UID PID PPID C STIME TTY TIME CMD root 28345 3213 0 12:36 ? 00:00:00 sshd: oracle [priv] oracle 28348 28345 0 12:37 ? 00:00:00 sshd: oracle@pts/0 oracle 28349 28348 0 12:37 pts/0 00:00:00 -bash ora11 28414 1 0 12:48 ? 00:00:00 ora_w000_ora11 oracle 28467 28349 0 12:58 pts/0 00:00:00 ps -ef [oracle@XM_IUPS test_echo]$ echo $$ 28349 [oracle@XM_IUPS test_echo]$ ls -l total 0 [oracle@XM_IUPS test_echo]$ echo $? 0 [oracle@XM_IUPS test_echo]$ ls -l123 ls: invalid option -- 2 Try `ls --help' for more information. [oracle@XM_IUPS test_echo]$ echo $? 2 [oracle@XM_IUPS test_echo]$ >tt.txt [oracle@XM_IUPS test_echo]$ cat tt.txt