diff --git a/tools/nfdc/command-arguments.hpp b/tools/nfdc/command-arguments.hpp
index b3175d5..1bec816 100644
--- a/tools/nfdc/command-arguments.hpp
+++ b/tools/nfdc/command-arguments.hpp
@@ -53,6 +53,19 @@
     auto i = find(key);
     return i == end() ? defaultValue : boost::any_cast<T>(i->second);
   }
+
+  /** \return the argument value, or nullopt if the argument is omitted on command line
+   */
+  template<typename T>
+  ndn::optional<T>
+  getOptional(const std::string& key) const
+  {
+    auto i = find(key);
+    if (i == end()) {
+      return ndn::nullopt;
+    }
+    return boost::any_cast<T>(i->second);
+  }
 };
 
 } // namespace nfdc
diff --git a/tools/nfdc/face-module.cpp b/tools/nfdc/face-module.cpp
index 3608ac2..216ded6 100644
--- a/tools/nfdc/face-module.cpp
+++ b/tools/nfdc/face-module.cpp
@@ -34,6 +34,14 @@
 void
 FaceModule::registerCommands(CommandParser& parser)
 {
+  CommandDefinition defFaceList("face", "list");
+  defFaceList
+    .setTitle("print face list")
+    .addArg("remote", ArgValueType::FACE_URI, Required::NO, Positional::YES)
+    .addArg("local", ArgValueType::FACE_URI, Required::NO, Positional::NO)
+    .addArg("scheme", ArgValueType::STRING, Required::NO, Positional::NO, "scheme");
+  parser.addCommand(defFaceList, &FaceModule::list);
+
   CommandDefinition defFaceShow("face", "show");
   defFaceShow
     .setTitle("show face information")
@@ -55,6 +63,46 @@
 }
 
 void
+FaceModule::list(ExecuteContext& ctx)
+{
+  auto remoteUri = ctx.args.getOptional<FaceUri>("remote");
+  auto localUri = ctx.args.getOptional<FaceUri>("local");
+  auto uriScheme = ctx.args.getOptional<std::string>("scheme");
+
+  FaceQueryFilter filter;
+  if (remoteUri) {
+    filter.setRemoteUri(remoteUri->toString());
+  }
+  if (localUri) {
+    filter.setLocalUri(localUri->toString());
+  }
+  if (uriScheme) {
+    filter.setUriScheme(*uriScheme);
+  }
+
+  FindFace findFace(ctx);
+  FindFace::Code res = findFace.execute(filter, true);
+
+  ctx.exitCode = static_cast<int>(res);
+  switch (res) {
+    case FindFace::Code::OK:
+      for (const FaceStatus& item : findFace.getResults()) {
+        formatItemText(ctx.out, item, false);
+        ctx.out << '\n';
+      }
+      break;
+    case FindFace::Code::ERROR:
+    case FindFace::Code::NOT_FOUND:
+    case FindFace::Code::CANONIZE_ERROR:
+      ctx.err << findFace.getErrorReason() << '\n';
+      break;
+    default:
+      BOOST_ASSERT_MSG(false, "unexpected FindFace result");
+      break;
+  }
+}
+
+void
 FaceModule::show(ExecuteContext& ctx)
 {
   uint64_t faceId = ctx.args.get<uint64_t>("id");
diff --git a/tools/nfdc/face-module.hpp b/tools/nfdc/face-module.hpp
index 3f70d48..6c190a1 100644
--- a/tools/nfdc/face-module.hpp
+++ b/tools/nfdc/face-module.hpp
@@ -41,11 +41,16 @@
 class FaceModule : public Module, noncopyable
 {
 public:
-  /** \brief register 'face show', 'face create', 'face destroy' commands
+  /** \brief register 'face list', 'face show', 'face create', 'face destroy' commands
    */
   static void
   registerCommands(CommandParser& parser);
 
+  /** \brief the 'face list' command
+   */
+  static void
+  list(ExecuteContext& ctx);
+
   /** \brief the 'face show' command
    */
   static void
diff --git a/tools/nfdc/find-face.cpp b/tools/nfdc/find-face.cpp
index c03e6dc..520ea92 100644
--- a/tools/nfdc/find-face.cpp
+++ b/tools/nfdc/find-face.cpp
@@ -70,7 +70,14 @@
     m_filter.setRemoteUri(remoteUri->toString());
   }
 
-  ///\todo #3864 canonize localUri
+  if (m_filter.hasLocalUri()) {
+    auto localUri = this->canonize("local", FaceUri(m_filter.getLocalUri()));
+    if (!localUri) {
+      m_res = Code::CANONIZE_ERROR;
+      return m_res;
+    }
+    m_filter.setLocalUri(localUri->toString());
+  }
 
   this->query();
   if (m_res == Code::OK) {
@@ -109,17 +116,23 @@
 void
 FindFace::query()
 {
-  m_ctx.controller.fetch<ndn::nfd::FaceQueryDataset>(
-    m_filter,
-    [this] (const std::vector<ndn::nfd::FaceStatus>& result) {
-      m_res = Code::OK;
-      m_results = result;
-    },
-    [this] (uint32_t code, const std::string& reason) {
-      m_res = Code::ERROR;
-      m_errorReason = "Error " + std::to_string(code) + " when querying face: " + reason;
-    },
-    m_ctx.makeCommandOptions());
+  auto datasetCb = [this] (const std::vector<ndn::nfd::FaceStatus>& result) {
+    m_res = Code::OK;
+    m_results = result;
+  };
+  auto failureCb = [this] (uint32_t code, const std::string& reason) {
+    m_res = Code::ERROR;
+    m_errorReason = "Error " + std::to_string(code) + " when querying face: " + reason;
+  };
+
+  if (m_filter.empty()) {
+    m_ctx.controller.fetch<ndn::nfd::FaceDataset>(
+      datasetCb, failureCb, m_ctx.makeCommandOptions());
+  }
+  else {
+    m_ctx.controller.fetch<ndn::nfd::FaceQueryDataset>(
+      m_filter, datasetCb, failureCb, m_ctx.makeCommandOptions());
+  }
   m_ctx.face.processEvents();
 }
 
diff --git a/tools/nfdc/status.cpp b/tools/nfdc/status.cpp
index e7de814..6165565 100644
--- a/tools/nfdc/status.cpp
+++ b/tools/nfdc/status.cpp
@@ -131,11 +131,6 @@
   parser.addCommand(defStatusShow, bind(&reportStatusSingleSection, _1, &StatusReportOptions::wantForwarderGeneral));
   parser.addAlias("status", "show", "list");
 
-  CommandDefinition defFaceList("face", "list");
-  defFaceList
-    .setTitle("print face list");
-  parser.addCommand(defFaceList, bind(&reportStatusSingleSection, _1, &StatusReportOptions::wantFaces));
-
   CommandDefinition defChannelList("channel", "list");
   defChannelList
     .setTitle("print channel list");
diff --git a/tools/nfdc/status.hpp b/tools/nfdc/status.hpp
index 6cc799e..57dac50 100644
--- a/tools/nfdc/status.hpp
+++ b/tools/nfdc/status.hpp
@@ -54,7 +54,6 @@
  *  Providing the following commands:
  *  \li status report
  *  \li status show
- *  \li face list
  *  \li channel list
  *  \li strategy list
  *  \li fib list
