gpt4 book ai didi

linux - 在 crontab 文件中重命名文件名

转载 作者:太空宇宙 更新时间:2023-11-04 10:11:05 25 4
gpt4 key购买 nike

我有以下文件是我的 crontab,

00 * * * * /home/@@@@/ulimit_nofile_status_20480.sh >> /export/####/$$$$$/ulimit_nofile_status.txt

00 * * * * /home/@@@@/ulimit_nproc_status_20480.sh >> /export/####/%%%%/ulimit_nproc_status.txt

我想将文件名(ulimit_nofile_status_20480.sh 和 ulimit_nproc_status_20480.sh)更改为(ulimit_nofile_status_40960.sh 和 ulimit_nproc_status_40960.sh)这些是文件名。

我想将 20480 重命名为 40960

已尝试以下命令但对我不起作用。

crontab -l | sed 's#/_20480\.#/40960.#' | crontab -

crontab -l | sed 's/\<_20480\>/40960/' | crontab -

最佳答案

我个人只会使用 crontab -e 进行编辑,但如果您想使用 sed 进行编辑,则似乎可以使用以下行:

crontab -l | sed 's/20480/40960/' | crontab -

关于linux - 在 crontab 文件中重命名文件名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49076160/

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