IN[~]>>>ls -l
total 56732
-rw-rw-r-- 1 minix 1236 Apr 29 09:19
3g_total.sh
-rwxr-xr-x 1 minix 50963038 Mar 26 08:36
ap.log*
-rw-r--r-- 1 minix 7031684 Nov 27 11:51
VNC-Server-5.0.6-Linux-x86.deb
-rwxrwxr-x 1 minix 543 Jan 1 23:36
aa.sh*
drwxr-xr-x 4 minix 4096 Feb 28 20:34
aaa/
-rw-rw-r-- 1 minix 685 Dec 18 14:36
check_status.sh
-rw-rw-r-- 1 minix 246 Apr 25 16:31
db.rb
-rwxr-xr-x 1 minix 636 Oct 21 2013
execltocvs.rb*
-rw-rw-r-- 1 minix 731 Apr 23 10:00
gr.rb
-rw-rw-r-- 1 minix 61 Apr 30 10:12
ip.txt
drwxr-xr-x 3 minix 4096 Mar 5 22:23
kibana/
-rwxrwxr-x 1 minix 1150 May 4 14:51
log.rb*
drwxrwxr-x 16 nagios 4096 Mar 15 2013
nagios/
drwxrwxr-x 4 minix 4096 Mar 5 20:35
nagios_dir/
drwxrwxr-x 3 minix 4096 Aug 7 2013
operation/
-rw-rw-r-- 1 minix 0 Apr 30 10:12
ping.log
-rw-rw-r-- 1 minix 124 Apr 30 10:13
ping.rb
-rw-rw-r-- 1 minix 175 Sep 2 2013
red.rb
drwxr-xr-x 3 minix 4096 Sep 13 2013
setup123/
drwxrwxr-x 2 minix 4096 Sep 3 2013
sock/
-rw-rw-r-- 1 minix 1061 Aug 15 2013
t.sh
-rw-rw-r-- 1 minix 182 Apr 21 18:29
te.rb
-rw-rw-r-- 1 minix 259 Jul 18 2013
test.rb
-rw-rw-r-- 1 minix 319 Apr 17 10:09
ton.py
drwxrwxr-x 7 minix 4096 Apr 17 09:48 tornado-3.2.0/
使用echo将输入的内容写入文件
IN[~]>>>echo `\ls` > aa.txt
IN[~]>>>cat aa.txt
3g_total.sh ap.log aaa aa.sh aa.txt check_status.sh db.rb execltocvs.rb gr.rb ip.txt kibana log.rb nagios nagios_dir operation ping.log ping.rb red.rb setup123 sock te.rb test.rb ton.py tornado-3.2.0 t.sh VNC-Server-5.0.6-Linux-x86.deb
IN[~]>>>
下面完整输出命令的标准输出(这才是我要的效果)
IN[~]>>>cat << EOF > aa.txt
`\ls`
EOF
IN[~]>>>cat aa.txt
3g_total.sh
ap.log
aaa
aa.sh
aa.txt
check_status.sh
db.rb
execltocvs.rb
gr.rb
ip.txt
kibana
log.rb
nagios
nagios_dir
operation
ping.log
ping.rb
red.rb
setup123
sock
te.rb
test.rb
ton.py
tornado-3.2.0
t.sh
VNC-Server-5.0.6-Linux-x86.deb
IN[~]>>>