Forrest logo
back to the Get-ChildItem tool

sort-object:tldr:6b1ef

sort-object: Sort the current directory by file length.
$ Get-ChildItem | Sort-Object -Property Length
try on your machine

This command is run in PowerShell and performs the following tasks:

  1. Get-ChildItem: This command retrieves a list of files and folders in the current directory. It is equivalent to the dir or ls command in other command-line interfaces.

  2. |: The pipe symbol (|) is used to pass the output of the previous command (Get-ChildItem) as input to the next command (Sort-Object).

  3. Sort-Object -Property Length: This command sorts the items from Get-ChildItem based on their Length property. The -Property parameter specifies the property to sort by. Here, Length refers to the size of the files in bytes. The files will be sorted in ascending order of their sizes.

In summary, this command retrieves a list of files and folders in the current directory and then sorts them based on their sizes in ascending order.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the Get-ChildItem tool