从文本文件中剪切一堆单词

cut bunch of words from text file

我正在尝试从 800 行中获取最后一部分并使用 bash 将其保存到新文件中:

例子

framework/resources/Functional/tpcds/variants/json/q3_1.sql
metastore/scripts/upgrade/derby/hive-schema-1.3.0.derby.sql
coeus-db/coeus-db-sql/src/main/resources/co/kuali/coeus/data/migration/sql/mysql/rice_server/bootstrap/V400_002__KR_RICE_01_1.0.3.2-2.0.0_2010-04-15_B000.sql
sql/Updates/0.0.3/r1358_mangos.sql
coeus-db/coeus-db-sql/src/main/resources/co/kuali/coeus/data/migration/sql/mysql/kc/bootstrap/V521_047__KC_DML_01_KRACOEUS-7036_B000.sql
src/FrontEnd/db/1.x/1.1/src/02.functions-and-logic/office/office.get_office_name_by_id.sql

我希望输出像

q3_1.sql
hive-schema-1.3.0.derby.sql
V521_047__KC_DML_01_KRACOEUS-7036_B000.sql
V400_002__KR_RICE_01_1.0.3.2-2.0.0_2010-04-15_B000.sql
V521_047__KC_DML_01_KRACOEUS-7036_B000.sql
office.get_office_name_by_id.sql

谁能告诉我如何使用 cut/grep 命令实现它?

我建议改用以下 AWK 命令:awk 'BEGIN{FS = "/"} {print $NF}'