Sed 删除最后/之前的所有文本和:之后的所有文本,并从列表中删除:

Sed 删除最后/之前的所有文本和:之后的所有文本,并从列表中删除:,sed,rsync,Sed,Rsync,这是我需要在一个文件中修改的一行的示例,其中所有行的模式都相同,如下所示: name//name/20000_random_test.txt: No space left on device 及 但这些都没有对文件造成任何影响 一定数量的文件没有传输到某个文件夹,因为该文件夹空间不足。我复制并粘贴了一个文件中的列表 我需要删除文件名前后的字符。这样,我将有一个列表,然后使用另一个命令,如: sed 's|.*\\\(.*\)|\1|' didnotmakeit.txt > filesto

这是我需要在一个文件中修改的一行的示例,其中所有行的模式都相同,如下所示:

name//name/20000_random_test.txt: No space left on device

但这些都没有对文件造成任何影响

一定数量的文件没有传输到某个文件夹,因为该文件夹空间不足。我复制并粘贴了一个文件中的列表

我需要删除文件名前后的字符。这样,我将有一个列表,然后使用另一个命令,如:

sed 's|.*\\\(.*\)|\1|' didnotmakeit.txt > filestoupload.txt

请帮我删除这些不必要的字符。谢谢大家!

以下方法应该有效:

grep NAME_REGEXP /path/to/filenames.list | rsync -a --files-from - . remote.example.com:
塞德的*/\([^:].*\):.*!\1!' 没有生成它
工作得很好!非常感谢。
sed 's|.*\\\(.*\)|\1|' didnotmakeit.txt > filestoupload.txt
grep NAME_REGEXP /path/to/filenames.list | rsync -a --files-from - . remote.example.com:
sed 's!.*/\([^:].*\):.*!\1!' didnotmakeit.txt