linux shell 如何把 ls 列出来的文件名中不想要的部分排除?

把下面列出来的不包含 unit 的文件名列出来
chromium/src/out/Release$ ls *test*
automated_ui_tests dbus_unittests libphonenumber_unittests printing_unittests test_page.css
automated_ui_tests.log ffmpeg_regression_tests libppapi_tests.so reliability_tests testserver.log
automated_ui_tests_log.txt ffmpeg_tests linux_dumper_unittest_helper remoting_unittests test_shell
base_unittests ffmpeg_unittests media_unittests run_testserver test_shell.pak
breakpad_unittests generate_test_dump net_perftests safe_browsing_tests test_shell_tests
browser_tests gfx_unittests net_unittests seek_tester ui_tests
cacheinvalidation_unittests googleurl_unittests performance_browser_tests sql_unittests ui_unittests
chromedriver_unittests gpu_tests performance_ui_tests sync_integration_tests unit_tests
content_browsertests gpu_unittests perf_tests sync_performance_tests unit_tests.log
content_unittests interactive_ui_tests plugin_tests sync_unit_tests webkit_unit_tests
courgette_unittests ipc_tests ppapi_nacl_tests_newlib_x64.nexe test_case.html
crypto_unittests jingle_unittests ppapi_perftests test_case.html.mock-http-headers
curvecp_unittests libnpapi_test_plugin.so ppapi_unittests test_case.nmf

第1个回答  推荐于2017-12-16
ls | grep -v "unit"
-v选项表示列出不包含匹配文本的所有行本回答被提问者采纳
第2个回答  2019-09-25
ls -I 文件名 注意 是大写的i 不是L
相似回答