我有一个文件ma.txt,它包含的输出ls -l;当我运行tr命令 ( tr "nik-pc" "root") 时,我得到以下输出:
nik-pc@nik:~$ cat ma.txt
total 52
drwxr-xr-x 2 nik-pc nik-pc 4096 Mar 11 11:33 Desktop
lrwxrwxrwx 1 nik-pc nik-pc 2 Mar 8 22:54 di -> hd
drwxr-xr-x 3 nik-pc nik-pc 4096 Mar 13 13:28 Documents
drwxr-xr-x 7 nik-pc nik-pc 4096 Mar 14 18:21 Downloads
drwxr-xr-x 2 nik-pc nik-pc 4096 Mar 11 09:39 dwhelper
-rw-r--r-- 1 nik-pc nik-pc 2134 Mar 13 17:40 hd
-rw-r--r-- 1 nik-pc nik-pc 3 …Run Code Online (Sandbox Code Playgroud) 当我运行which命令时,它什么也没显示。
我运行了所有这些,但没有一个给出输出。
$ which /tool/
$ which RED*.pdf
$ which anime
$ which -a anime
$ info which
$ which -a
$ which -a Downloads
$ which Downloads
$ which doc
$ which media
$ which /media
$ which
$ su -
# which
# which doc
# logout
$ which --help
Illegal option --
Usage: fusrfbinfwhich [-a] args
$ which info
/usr/bin/info
$ which help
$ which cd
$ info which
$ which -a info
/usr/bin/info
$ …Run Code Online (Sandbox Code Playgroud) 我有代码来打印给定数字的简单乘法表。当我用 sh 运行它时,它给了我完美的输出,但是当我使用 bash 时,它给出了略有不同的输出。你能解释一下这是为什么吗?
这是输出 sh
sh cd.sh
enter the no to print table
12
12 * 1 =12
12 * 2 =24
12 * 3 =36
12 * 4 =48
12 * 5 =60
12 * 6 =72
12 * 7 =84
12 * 8 =96
12 * 9 =108
12 * 10 =120
COntinue.. or not [0/1]
1
exiting the script
Run Code Online (Sandbox Code Playgroud)
和 bash
bash cd.sh
enter the no to print table
12
\t12 * 1 =12
\t12 …Run Code Online (Sandbox Code Playgroud) 我在使用 find 和 grep 命令时遇到问题。我想使用 grep 命令从该文件中找到*.doc匹配模式的Danish文件。我正在使用 -exec 来组合它们,但它给出了一个错误,我不知道那是什么。它说-exec缺少论据。
