> For the complete documentation index, see [llms.txt](https://x7331.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://x7331.gitbook.io/notes/windows-shells/powershell/files-and-dirs.md).

# Files & Dirs

## Basics

<table><thead><tr><th width="198" align="right">Command</th><th width="149">Alias</th><th>Description</th></tr></thead><tbody><tr><td align="right"><code>Get-Item</code></td><td>gi</td><td>Retrieve, i.e., list, an object.</td></tr><tr><td align="right"><code>Get-ChildItem</code></td><td>ls / dir / gci</td><td>Lists out the content of a folder or registry hive.</td></tr><tr><td align="right"><code>New-Item</code></td><td>md / mkdir / ni</td><td>Create new objects. ( can be files, folders, symlinks, registry entries, and more)</td></tr><tr><td align="right"><code>Set-Item</code></td><td>si</td><td>Modify the property values of an object.</td></tr><tr><td align="right"><code>Copy-Item</code></td><td>copy / cp / ci</td><td>Make a duplicate of the item.</td></tr><tr><td align="right"><code>Rename-Item</code></td><td>ren / rni</td><td>Changes the object name.</td></tr><tr><td align="right"><code>Remove-Item</code></td><td>rm / del / rmdir</td><td>Deletes the object.</td></tr><tr><td align="right"><code>Get-Content</code></td><td>cat / type</td><td>Displays the content within a file or object.</td></tr><tr><td align="right"><code>Add-Content</code></td><td>ac</td><td>Append content to a file.</td></tr><tr><td align="right"><code>Set-Content</code></td><td>sc</td><td>overwrite any content in a file with new data.</td></tr><tr><td align="right"><code>Clear-Content</code></td><td>clc</td><td>Clear the content of the files without deleting the file itself.</td></tr><tr><td align="right"><code>Compare-Object</code></td><td>diff / compare</td><td>Compare two or more objects against each other. This includes the object itself and the content within.</td></tr></tbody></table>
