# 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://devops-collective-inc.gitbook.io/a-unix-person-s-guide-to-powershell/commands-detail-b.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
