[root@xuexi ~]# ps aux | grep ssh root 1211 0.0 0.1 82544 3600 ? Ss Jul26 0:00 /usr/sbin/sshd -D root 25236 0.0 0.2 145552 5524 ? Ss 05:28 0:00 sshd: root@pts/0 root 25720 0.1 0.2 145416 5524 ? Ss 06:15 0:00 sshd: root@pts/1 root 25770 0.0 0.0 112648 948 pts/1 S+ 06:15 0:00 grep --color=auto ssh
[root@xuexi ~]# ps aux | grep ss[h] root 1211 0.0 0.1 82544 3600 ? Ss Jul26 0:00 /usr/sbin/sshd -D root 25236 0.0 0.2 145552 5524 ? Ss 05:28 0:00 sshd: root@pts/0 root 25720 0.0 0.2 145416 5524 ? Ss 06:15 0:00 sshd: root@pts/1
[root@xuexi ~]# > ab.sh [root@xuexi ~]# : > ab.sh # 或"true >ab.sh",其实它们都等价于">ab.sh" [root@xuexi ~]# echo '' > ab.sh [root@xuexi ~]# truncate -s 0 ab.sh # truncate命令用于收缩和扩展文件大小 [root@xuexi ~]# dd if=/dev/null of=ab.sh
[root@xuexi tmp]# set -C [root@xuexi tmp]# cat flip >ttt.txt -bash: ttt.txt: cannot overwrite existing file [root@xuexi tmp]# cat flip >| ttt.txt [root@xuexi tmp]# set +C
[root@xuexi tmp]# cat <<eof>log.txt # 覆盖的方式输入到log.txt > this is stdin character > eof
[root@xuexi tmp]# cat >log1.txt <<eof > this is stdin character first! > eof
[root@xuexi ~]# cat <<abcx > 123 > 345 > abcx 123 345
[root@xuexi tmp]# cat >>log1.txt <<eof > this is stdin character first! > eof
[root@xuexi tmp]# cat <<eof>>log1.txt > this is stdin character first! > eof
[root@xuexi tmp]# cat <<eof | tee ttt.txt > x y > z 1 > eof x y z 1
echo password_value | passwd --stdin user
以上就是Shell管道重定向基础教程的详细内容,更多请关注Gxl网其它相关文章!
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did84577