[英]What does ls and -lh/usr mean in NodeJs?
在NodeJs中使用子进程模块时, ls
和-lh/usr
代表什么?
If you're referring to the example for spawn()
: 如果您引用的是
spawn()
的示例 :
var spawn = require('child_process').spawn,
ls = spawn('ls', ['-lh', '/usr']);
// ...
ls
is, from left to right: ls
是从左到右:
ChildProcess
instance created and returned by spawn()
. spawn()
创建并返回的ChildProcess
实例。 The snippet is equivalent to executing the following command in a shell/terminal, where spaces separate the command and arguments: 该代码段等效于在shell /终端中执行以下命令,其中空格将命令和参数分隔开:
ls -lh /usr
Which will try to list the contents of the /usr
directory, specifying -lh
as 2 combined options to output in " long listing format " ( -l
) with " human readable sizes " ( -h
). 它将尝试列出
/usr
目录的内容,将-lh
指定为2个组合选项,以具有“ 人类可读大小 ”( -h
)的“ 长列表格式 ”( -l
)输出。
It assumes the system running the code has a compatible ls
command or executable. 假定运行代码的系统具有兼容的
ls
命令或可执行文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.