Commands / Files

Get-ChildItem

List files in a folder

beginner Files Aliases gcilsdir

Get-ChildItem
 Get-ChildItem -Path .\docs
Works on
WindowsLinuxmacOS
PowerShell
5.1 and later
Reference
Microsoft Learn: Get-ChildItem

What you'll see

    Directory: C:\Path\To\docs

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----          10/1/2026  9:12 AM                images
-a---          10/3/2026  4:40 PM           2048 notes.txt
-a---          10/5/2026 11:02 AM          18233 report.docx

Lists files and folders. Point -Path at a folder. Skip -Path and it uses the current directory.

Common parameters

Try this

Get-ChildItem -Path .\docs -Recurse -File -Filter *.md

Coming from another shell

ShellWhat you might type
bash / zshls -la
cmd.exedir

ls -la does not work: -Force is what shows hidden files.

More in From bash and From cmd.

Related commands