gpt4 book ai didi

linux - 这个奇怪的结构 "{}\;"是什么意思?

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:54:43 24 4
gpt4 key购买 nike

为什么我们在 linux 终端中使用这种奇怪的构造 {}\; 来执行命令?例如,

find . -type f -name *.jpeg -exec rm {} \;

最佳答案

来自man page of find (强调我的):

find . -type f -exec file '{}' \;

Runs `file' on every file in or below the current directory. Notice that the braces are enclosed in single quote marks to protect them from interpretation as shell script punctuation. The semicolon is similarly protected by the use of a backslash, though single quotes could have been used in that case also.

关于linux - 这个奇怪的结构 "{}\;"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56035859/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com