I have following file in unix directory
/home/files/myfiles/good.txt
I need to extract the file path alone
Expected output : /home/files/myfiles
Note: I can not use cut operations as the file path is dynamic. I am getting the filename and filepath as single user input to the shell script
Try
$ dirname /home/files/myfiles/good.txt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With