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
案文如下:
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:
...
我的docker文件看起来像这样
FROM grpc/python
CMD ["/bin/ls /"]
它抛出了一个错误:
container_linux.go:265: starting container process caused "exec: \"/bin/ls /\": stat /bin/ls /: no such file or directory"
docker: Error response from daemon: oci runtime error: container_linux.go:265: starting con
man dpkg在没有给出filename-search-pattern的定义的情况下这么说。
-S, --search filename-search-pattern...
Search for a filename from installed packages.
例如,下面的输出令人困惑。为什么通过移除前导"/",查询字符串不必以结果字符串结尾。
谁能给出filename-search-pattern的定义,这样我才能确切地知道如何使用dpkg -S进行搜索?
$ dpkg -S /bin/ls
coreut
我需要刚在最新版本中添加到sqlite3中的生成列特性。我只需将相关的sqlite3.dll替换为一个新下载的二进制文件,就可以使它在windows上的python应用程序中工作。我现在正在将我的应用程序移植到一个raspberry pi (debian)上,但是作为一个linux新手,我很难找到sqlite3可执行文件。考虑到所有的权限和所有者的东西,这让我头晕目眩;我想知道,这能在linux上完成吗?如果是的话,怎么做?
只是对命令"ls *“的输出感到困惑。我在Ubuntu11.10和RedhatEnterprise6.3中测试了下面的场景,得到了相同的结果。
Shell日志
$ uname -a
Linux 2.6.32-279.19.1.el6.x86_64 #1 SMP Sat Nov 24 14:35:28 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
$ echo $0
-bash
$ cd test
$ ls
$ ls * *<== at first, no file/directory under current
我已经从下载了gcc-4.1.2,并使用两个命令构建
./configure
make
现在我可以看到g++二进制文件了。但并不存在gcc二进制。
$ ls /opt/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/g++
/opt/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/g++
$ ls /opt/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/gcc
ls: cannot access /opt/gcc-4.1.2/host-x86_64-unknown-lin
出于测试目的,我创建了以下目录。
user@linux:~$ mkdir dir0{1..3}
user@linux:~$ ls -l
total 12K
drwxr-xr-x 2 user user 4.0K Mei 31 10:45 dir01
drwxr-xr-x 2 user user 4.0K Mei 31 10:45 dir02
drwxr-xr-x 2 user user 4.0K Mei 31 10:45 dir03
user@linux:~$
然后,我用find -exec删除了它
user@linux:~$ find -type d -exec rmdir {}
我在Linux中使用bash脚本迁移数据库输出文件,我想知道如何在bash脚本中执行Linux命令时处理错误。
例如,通常情况下,当我想循环遍历目录中的文件时,我会这样写它
# list files and grep results for .sql extension
for FILE in `ls | grep ".sql"`
do
echo "found file: $FILE"
done
它工作得很好,因为grep如果有.sql扩展名或不返回任何内容,就会返回文件名。
我想知道如何使用返回结果或错误的Linux命令,例如
ls ./*.sql
,