[ILUGC] Re: 1D1C - dirname

  • From: Baskar Selvaraj <baskar@xxxxxxxxxxxx>
  • To: ilugc <ilugc@xxxxxxxxxxxxx>
  • Date: Mon, 20 Jun 2022 09:05:20 +0530

On Mon, Jun 20, 2022 at 6:18 AM Dhanasekar <tkdhanasekar@xxxxxxxxx> wrote:


dirname - strip last component from file name
$ dirname /home/ilugc/myscript.sh
/home/ilugc

$ dirname -z /home/klug/autoscript.sh
/home/klug

basename is just opposite to this, which displays only the last
component of the file/directory name.

$basename /home/ilugc/myscript.sh
myscript.sh
---
Mailing List Guidelines: https://ilugc.in/mailing-list-guidelines
Web: http://ilugc.in/
Internet Relay Chat: #ilugc on libera.chat

Other related posts: