How do I print out just the hashsum and file name with sha256sum command? I want Hashsum and just the filename instead of the full path.
Command:
sha256sum /mydir/someOtherDir/file.txt
Output:
123Hashsum /mydir/someOtherDir/file.txt
Desired Output:
123Hashsum file.txt
cd /mydir/someOtherDir/; sha256sum file.txtinstead ofsha256sum /mydir/someOtherDir/file.txtsha256sum's output. However, you may want to explain why you want to do this. If you want to use an aliased version of the command for better readability that's fine. But if you want to parse your expected output it wouldn't make sense to post-process the original output just so that you parse it a second time after that. Also: Do you need support for multiple files in different directories, for instancesha256sum /dir1/file1 /dir2/dir3/file2?