1D1C - dirname

strip last component from file name

dirname - strip last component from file name

a. dirname /home/syedjafer/sample.txt

dirname simple usage

b. dirname -z /home/syedjafer/sample.txt

-z, --zero -> end each output line with NULL, not newline

dirname -z

Credits: