小编Lun*_*ist的帖子

一天开始的日期时间是否有保留字?

man date不会向我显示任何保留字,但它们有“现在”或“今天”等。

我想知道是否有任何明确的方法来打印当天的开始(00:00:00)。

date -u -d "$(date +'%F')"在任何情况下都足够吗?看起来有点傻。

date

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

'find -exec mv' 尝试移动它之前移动的同一个文件

我的错误命令:

find . -type f -name '*2019*' -exec mv {} ./backup_2019 \;
Run Code Online (Sandbox Code Playgroud)

结果 :

mv: ‘./backup_2019/2019-A.txt’ and ‘backup_2019/2019-A.txt’ are the same file
mv: ‘./backup_2019/2019-B.txt’ and ‘backup_2019/2019-B.txt’ are the same file
mv: ‘./backup_2019/2019-C.txt’ and ‘backup_2019/2019-C.txt’ are the same file
Run Code Online (Sandbox Code Playgroud)

我认为它找到了它之前移动的文件。我可以在不使用 maxdepth 的情况下解决这个问题吗?有没有办法只排除目标目录?

backup find mv

5
推荐指数
2
解决办法
376
查看次数

当我在提示中输入“ unset * ”时究竟会发生什么?

假设我以 root 身份连接到 Linux 系统。

当我输入时到底发生了什么unset *

shell bash variable

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

RHEL:/etc/issue.net 中的“\S Kernel \r on an \m”是什么意思?

如果我cat /etc/issue.net,它里面有这个:

\S
Kernel \r on an \m
Run Code Online (Sandbox Code Playgroud)

当我使用它作为 ssh 横幅时,它不会展开,只是按写入方式打印它。
这是什么?

ssh rhel banner

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

在 Bash 中函数后的数字有什么作用?

我遇到过这样的代码:

function cursorBack() {
   echo -en "\033[$1D"
}
...
tput civis 
...
cursorBack 1
Run Code Online (Sandbox Code Playgroud)

号码有什么作用?

bash shell-script

-2
推荐指数
1
解决办法
67
查看次数

标签 统计

bash ×2

backup ×1

banner ×1

date ×1

find ×1

mv ×1

rhel ×1

shell ×1

shell-script ×1

ssh ×1

variable ×1