简体   繁体   English

OSX中的bash重定向不起作用

[英]bash redirect in OSX doesn't work

I try to redirect output from a command in a terminal window in Max OSX (10.9.4) and get an error message. 我尝试从Max OSX(10.9.4)的终端窗口中的命令重定向输出,并得到错误消息。 When I try this easy command: 当我尝试这个简单的命令时:

ls > file_list.txt

I get this error: 我收到此错误:

-bash: file_list.txt: Operation not supported

Anybody an idea? 有人有主意吗?

Thanks 谢谢

This is the error you get if you try to create a file somewhere like /dev , which is the mount point for a special filesystem that doesn't (ordinarily) allow you to create files: 如果尝试在/dev类的位置创建文件,则会遇到此错误,这是特殊文件系统(通常)不允许您创建文件的安装点:

$ cd /dev
$ ls > file_list.txt
bash: file_list.txt: Permission denied
# Oops, we get permission denied before we even try to create the file.
$ sudo -s
Password:
# ls > file_list.txt
bash: file_list.txt: Operation not supported

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM