0

I have a directory having 100 .txt files. I need windows command ( Unix equivalent : head cmd) to list, say only 10 files in my console

0

1 Answer 1

1

Use Powershell

To get the list of files use the below:

Get-ChildItem | Sort-Object LastWriteTime -Descending | Select-Object -first 2

Also to get any specific data use the Select

Example:

Get-ChildItem |Select-Object Name | Sort-Object LastWriteTime -Descending | Select-Object -first 2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .