【发布时间】:2021-08-29 22:34:33
【问题描述】:
我在这个问题上需要帮助。 我的文件夹中有一些文件,我想列出它,但我只想列出主要的课程名称。
-r--r----- 1 saeid azubi 0 Jun 10 14:34 'Gymnastik - Bauch-Beine-Po 01.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:34 'Gymnastik - Bauch-Beine-Po 02.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:34 'Gymnastik - Bauch-Beine-Po 03.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:34 'Gymnastik - Bauch-Beine-Po 04.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:35 'Gymnastik - Bauch-Beine-Po 05.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:35 'Gymnastik - Bauch-Beine-Po 06.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:35 'Gymnastik - Bauch-Beine-Po 07.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:35 'Gymnastik - Bauch-Beine-Po 08.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:35 'Gymnastik - Bauch-Beine-Po 09.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:35 'Gymnastik - Bauch-Beine-Po 10.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:35 'Gymnastik - Bauch-Beine-Po 11.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:35 'Gymnastik - Entspannung.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:35 'Gymnastik - Muskeln wie Stahl 01.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:35 'Gymnastik - Muskeln wie Stahl 02.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:35 'Gymnastik - Muskeln wie Stahl 03.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:35 'Gymnastik - Muskeln wie Stahl 04.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:35 'Gymnastik - Muskeln wie Stahl 05.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:35 'Gymnastik - Muskeln wie Stahl 06.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:35 'Gymnastik - Muskeln wie Stahl 07.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:34 'Gymnastik - RückenFit 01.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:34 'Gymnastik - RückenFit 02.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:34 'Gymnastik - RückenFit 03.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:34 'Gymnastik - RückenFit 04.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:34 'Gymnastik - RückenFit 05.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:34 'Gymnastik - Stretching 01.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:34 'Gymnastik - Stretching 02.mp4'
-r--r----- 1 saeid azubi 0 Jun 10 14:34 'Gymnastik - Stretching 03.mp4'
这里
输出应该是这样的:
鲍赫-贝内-波
转折
穆斯克尔恩·斯塔尔
RückenFit
拉伸
我试过这段代码,但它不是我想要的:
ls -l | awk -F'[ .\$]' '{print $11 }' | uniq
感谢您提前提供帮助
【问题讨论】:
-
为什么是图片。获取里面的文字并粘贴有那么难吗?
-
解析
ls输出很笨重。 -
当你无法准确描述预期的输出时,你就无法对其进行编程。
-
你是对的@Roadowl,对不起,我是新来的,我一直承受着压力。很清楚我现在在寻找什么!谢谢
-
嗨@SaeidHerawi,欢迎来到该网站!如果您粘贴在图像中显示的文本,我相信您的问题将得到解决 - 然后我们可以将文本复制到我们的系统并处理命令以从中获取您需要的名称。如果我们没有得到文本,我们就很难做到这一点(很少有人会花时间在图像中手动输入示例来处理它,而且很少有人会如此自信地提供他们只认为 可以工作,但尚未在他们的系统上进行测试)。