Add nameFilter in tcp and tcpm

Bug: If the given source file includes path("/"), the command will
fail.
Debug: Eliminate this awkward by adding a function named "nameFilter"
to get the file name only.