小编use*_*898的帖子

如何授予读写权限但不删除文件

我想让用户能够在其他用户目录中创建写入和读取文件,但不能选择在创建后删除文件(粘滞位在这里不起作用......)例如:

我有manager 目录的用户repository
我有用户worker1需要写入文件/manager/repository但无法删除文件
我有用户worker2需要写入文件/manager/repository 但无法删除文件
我有用户worker3需要写入文件/manager/repository 但不能删除文件

worker 1-2-3只有在创建后无法删除这些文件manager,并root可以删除这些文件worker 1-2-3创建。

我试过几个chownchmod技巧与应用粘着位没有成功。

permissions files

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

日期:尝试以特定格式设置 Linux 日期的日期无效

我尝试以特定格式设置 Linux 日期和时间,但它一直给我错误\n示例:

\n\n
date "+%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01"\nor \ndate +"%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01"\n
Run Code Online (Sandbox Code Playgroud)\n\n

继续给我这个错误:

\n\n
date: invalid date \xe2\x80\x9819-01-2017 00:05:01\xe2\x80\x99\n
Run Code Online (Sandbox Code Playgroud)\n

linux date time

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

sed regex 无法捕获包含该模式的整个段落

我有这个 XML 文件(示例)

<This is a line of text with a year=2020 month=12 in it
This line of text does not have a year or month in it
This year=2021 is the current year the current month=1
This is the year=2021 the month=2/>


<This is a line of text with a year=33020 month=12 in it
This line of text does not have a year or month in it
This year=33020 is the current year the current month=1
This is the …
Run Code Online (Sandbox Code Playgroud)

xml sed text-processing regular-expression

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