wsl -h显示以下内容: --exec, -e <CommandLine> Execute the specified command without using the default Linux shell.
-- Pass the remaining command line as is. “不使用默认的Linux shell”是什么意思(即,如果不使用默认的shell,它还将使用什么?)。 此外,作为示例,我现在有三种可能的方法来从我的PowerShell提示符运行Linux ls (即,这将不是ls的Get-ChildItem别名,而是通过WS
关于ls -F在man ls for -F中确实提到:
-F, --classify
append indicator (one of */=>@|) to entries
我读到以下内容:
是-F所显示的符号是什么意思吗?
14.如何使ls明确指出输出中的文件类型
清单如下:
@ indicates a symbolic link
* indicates an executable
= indicates a socket file
| indicates a named pipe
> indicates a door
/ indicates a directory
我知道我们可以在java程序中运行linux终端命令,就像下面的代码显示主目录的"ls“命令一样。
String[] cmd1 = {
"/bin/sh",
"-c",
"cd ../.. && ls"};
Process child1 = Runtime.getRuntime().exec(cmd1);
child1.waitFor();
final BufferedReader is = new BufferedReader(new I
以下是什么意思?
find myDirectory -name myFile -exec ls \-ln {} \;
我看过,但并不完全理解
-exec command True if the executed command returns a zero value as exit status. The end of command must be punctuated by an escaped semicolon. A command argument {} is replaced by the current path name.
这部分-exec ls \-ln {} \;我
我终于让自己看了一些linux代码。我现在看的是"ls.c“。
在底部的函数"usage()“中,我发现了很多这样的语句:
fputs (_("\
List information about the FILEs (the current directory by default).\n\
Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n\
\n\
"), stdout);
_("")是什么意思?它是像L"string
以下是函数声明:
int execlp(const char *file, const char *arg, ...);
以下是论点的描述:
file: The executable that has to be executed by the new process. This executable is searched for in the path specified by the environmental variable PATH.
*arg,...: list of arguments terminated by a NULL argument.
那么,为什么我们这样调用
案文如下:
We will now present the Linux ls command
... here description of ls
We will now present the Linux cd command
... here description of cd
... more description
Done
下面的sed替换正则表达式应用于文本。
sed 's/.*Linux \(.*\) .*/\1:/' ex2.txt
,它提供以下输出
ls:
... here description of ls
cd:
...
在linux中,我有一个名为file_list.txt,的文件列表,其中该列表中的路径还包括一个env变量(在本例中,该文件列表中列出的文件是$HOME/myfile).。
> cat file_list.txt
$HOME/myfile
> ls `cat file_list.txt`
ls: $HOME/myfile: No such file or directory
> ls $HOME/myfile
/home/user/myfile
为什么会这样呢?如何在文件列表中列出的文件上运行操作(如ls、less、vim等)?