小编Aks*_*tel的帖子

使用“-exec rm -f {}\”时“查找:缺少`-exec'的参数”

我运行这个命令:

~/shell_temp$ find . -type f -name "IMAG1806.jpg" -exec rm -f {}\
Run Code Online (Sandbox Code Playgroud)

我得到以下输出:

> IMAG1806.jpg

Error:
find: missing argument to `-exec'
Run Code Online (Sandbox Code Playgroud)

从当前目录中查找任何文件并删除的确切命令是什么-exec

command-line find

12
推荐指数
2
解决办法
4万
查看次数

shell脚本中的for循环语法

我运行下面的脚本:

for (( i=1; i <= 5; i++ ))    
do
    echo "Random number $i: $RANDOM"
done
Run Code Online (Sandbox Code Playgroud)

我得到以下错误:

Syntax error: Bad for loop variable
Run Code Online (Sandbox Code Playgroud)

为什么这种语法不起作用?

scripts

6
推荐指数
3
解决办法
7万
查看次数

这个 egrep 命令有什么作用?

我运行这个命令

egrep "\" string_demo | wc -l
Run Code Online (Sandbox Code Playgroud)

我得到以下输出:

akshay@akshay-K53SC:~/shell$ egrep "\" string_demo | wc -l
> abc
> pqr
> xyz
> 
Run Code Online (Sandbox Code Playgroud)

">" 将继续,直到我按下Ctrl+ D。那么这是什么?

还有grep,egrep和之间的确切区别是什么fgrep

bash grep

1
推荐指数
1
解决办法
2498
查看次数

标签 统计

bash ×1

command-line ×1

find ×1

grep ×1

scripts ×1