diff --git a/reframe/frontend/filters.py b/reframe/frontend/filters.py
index 20441a18..9edf3ced 100644
--- a/reframe/frontend/filters.py
+++ b/reframe/frontend/filters.py
@@ -26,6 +26,9 @@ def _have_name(patt):
         if '@' in patt:
             # Do an exact match on the unique name
             return patt.replace('@', '_') == case.check.unique_name
+        elif patt.startswith('/'):
+            # Do an exact match on the hashcode
+            return patt[1:] == case.check.hashcode
         else:
             return regex.match(display_name)
 

diff --git a/unittests/test_cli.py b/unittests/test_cli.py
index 6a6ca2da..031ad27d 100644
--- a/unittests/test_cli.py
+++ b/unittests/test_cli.py
@@ -574,7 +574,7 @@ def test_list_tags(run_reframe):
     assert returncode == 0
 
 
-def test_filtering_multiple_criteria(run_reframe):
+def test_filtering_multiple_criteria_name(run_reframe):
     returncode, stdout, stderr = run_reframe(
         checkpath=['unittests/resources/checks'],
         action='list',
@@ -586,6 +586,30 @@ def test_filtering_multiple_criteria(run_reframe):
     assert returncode == 0
 
 
+def test_filtering_multiple_criteria_hash(run_reframe):
+    returncode, stdout, stderr = run_reframe(
+        checkpath=['unittests/resources/checks'],
+        action='list',
+        more_options=['-t', 'foo', '-n', '/2b3e4546']
+    )
+    assert 'Traceback' not in stdout
+    assert 'Traceback' not in stderr
+    assert 'Found 1 check(s)' in stdout
+    assert returncode == 0
+
+
+def test_filtering_exclude_hash(run_reframe):
+    returncode, stdout, stderr = run_reframe(
+        checkpath=['unittests/resources/checks'],
+        action='list',
+        more_options=['-x', '/2b3e4546']
+    )
+    assert 'Traceback' not in stdout
+    assert 'Traceback' not in stderr
+    assert 'Found 8 check(s)' in stdout
+    assert returncode == 0
+
+
 def test_show_config_all(run_reframe):
     # Just make sure that this option does not make the frontend crash
     returncode, stdout, stderr = run_reframe(

`-n` and `-x` are not combined correctly
Combining the `-n` and trying to exclude a test using the `-x` it has no effect. How to reproduce:

```
./bin/reframe -C config/machines.py -c tutorials/cscs-webinar-2022/tests/stream9.py -n stream_scale_test -x /5ccda674 -l
```

```
- stream_scale_test %threading=4 %stream_binaries.elem_type=float /5ccda674
    ^stream_build %elem_type=float ~tresa:default+gnu /bed1cb01
- stream_scale_test %threading=2 %stream_binaries.elem_type=float /a02e1a74
    ^stream_build %elem_type=float ~tresa:default+gnu /bed1cb01
- stream_scale_test %threading=1 %stream_binaries.elem_type=float /a54fb2dd
    ^stream_build %elem_type=float ~tresa:default+gnu /bed1cb01
- stream_scale_test %threading=4 %stream_binaries.elem_type=double /986c1e0b
    ^stream_build %elem_type=double ~tresa:default+gnu /3d9fd09f
- stream_scale_test %threading=2 %stream_binaries.elem_type=double /d976421a
    ^stream_build %elem_type=double ~tresa:default+gnu /3d9fd09f
- stream_scale_test %threading=1 %stream_binaries.elem_type=double /b7f1a81d
    ^stream_build %elem_type=double ~tresa:default+gnu /3d9fd09f
```

Although the `stream_scale_test` is selected, but the test with `threading=4` (5ccda674) is still selected.
unittests/test_cli.py::test_filtering_exclude_hash
unittests/test_cli.py::test_check_success unittests/test_cli.py::test_check_restore_session_failed unittests/test_cli.py::test_check_restore_session_succeeded_test unittests/test_cli.py::test_check_restore_session_check_search_path unittests/test_cli.py::test_check_success_force_local unittests/test_cli.py::test_report_file_with_sessionid unittests/test_cli.py::test_report_ends_with_newline unittests/test_cli.py::test_check_failure unittests/test_cli.py::test_check_setup_failure unittests/test_cli.py::test_check_kbd_interrupt unittests/test_cli.py::test_check_sanity_failure unittests/test_cli.py::test_dont_restage unittests/test_cli.py::test_checkpath_symlink unittests/test_cli.py::test_performance_check_failure unittests/test_cli.py::test_perflogdir_from_env unittests/test_cli.py::test_performance_report unittests/test_cli.py::test_skip_system_check_option unittests/test_cli.py::test_skip_prgenv_check_option unittests/test_cli.py::test_sanity_of_checks unittests/test_cli.py::test_unknown_system unittests/test_cli.py::test_sanity_of_optconfig unittests/test_cli.py::test_checkpath_recursion unittests/test_cli.py::test_same_output_stage_dir unittests/test_cli.py::test_execution_modes unittests/test_cli.py::test_timestamp_option unittests/test_cli.py::test_timestamp_option_default unittests/test_cli.py::test_list_empty_prgenvs_check_and_options unittests/test_cli.py::test_list_check_with_empty_prgenvs unittests/test_cli.py::test_list_empty_prgenvs_in_check_and_options unittests/test_cli.py::test_list_with_details unittests/test_cli.py::test_list_concretized unittests/test_cli.py::test_list_tags unittests/test_cli.py::test_filtering_multiple_criteria_name unittests/test_cli.py::test_filtering_multiple_criteria_hash unittests/test_cli.py::test_show_config_all unittests/test_cli.py::test_show_config_param unittests/test_cli.py::test_show_config_unknown_param unittests/test_cli.py::test_show_config_null_param unittests/test_cli.py::test_verbosity unittests/test_cli.py::test_verbosity_with_check unittests/test_cli.py::test_quiesce_with_check unittests/test_cli.py::test_failure_stats unittests/test_cli.py::test_maxfail_option unittests/test_cli.py::test_maxfail_invalid_option unittests/test_cli.py::test_maxfail_negative unittests/test_cli.py::test_repeat_option unittests/test_cli.py::test_repeat_invalid_option unittests/test_cli.py::test_repeat_negative unittests/test_cli.py::test_exec_order[name] unittests/test_cli.py::test_exec_order[rname] unittests/test_cli.py::test_exec_order[uid] unittests/test_cli.py::test_exec_order[ruid] unittests/test_cli.py::test_exec_order[random] unittests/test_cli.py::test_detect_host_topology unittests/test_cli.py::test_detect_host_topology_file unittests/test_cli.py::test_external_vars unittests/test_cli.py::test_external_vars_invalid_expr unittests/test_cli.py::test_fixture_registry_env_sys unittests/test_cli.py::test_fixture_resolution unittests/test_cli.py::test_dynamic_tests unittests/test_cli.py::test_dynamic_tests_filtering