> For the complete documentation index, see [llms.txt](https://devops-collective-inc.gitbook.io/a-unix-person-s-guide-to-powershell/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devops-collective-inc.gitbook.io/a-unix-person-s-guide-to-powershell/commands-detail-b.md).

# Command Detail - B

## basename

A rough PowerShell equivalent for the unix *basename* is:

```
dir <whatever> | select name
```

This depends on the file actually existing, whereas *basename* doesn't care.

A more precise (but perhaps less concise) alternative\[1] is:

```
```

**Notes** \[1] I found `[System.IO.Path]::GetFileName` after reading [Power Tips of the Day - Useful Path Manipulations Shortcuts](http://powershell.com/cs/blogs/tips/archive/2014/09/08/useful-path-manipulation-shortcuts.aspx), which has some other useful commands
