![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| Guest | ls -h what would be the "ls -h" equivalent in powershell? (Get-ChildItem -HumanReadable) |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: ls -h Storm Rider" <Storm Rider@xxxxxx> wrote in message news:434E3364-4FCD-4CB9-B28A-9FBB054C7037@xxxxxx Quote: > what would be the "ls -h" equivalent in powershell? (Get-ChildItem > -HumanReadable) this type of output or describe a bit more about "HumanReadable"? -- Keith |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: ls -h -h use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the number of digits to four or fewer using base 2 for sizes. "Keith Hill [MVP]" wrote: Quote: > Storm Rider" <Storm Rider@xxxxxx> wrote in message > news:434E3364-4FCD-4CB9-B28A-9FBB054C7037@xxxxxx Quote: > > what would be the "ls -h" equivalent in powershell? (Get-ChildItem > > -HumanReadable) > Been a long time since using unix style ls. Can you provide a sample of > this type of output or describe a bit more about "HumanReadable"? > > -- > Keith > |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: ls -h "Storm Rider" <StormRider@xxxxxx> wrote in message news:79F15DDD-F614-418C-8728-5F814AD9D046@xxxxxx Quote: > -h use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and > Petabyte in order to reduce the number of digits to four or fewer using base > 2 for sizes. gci | format-table ` @{l='Mode';w=5;e={$_.Mode}}, @{l='LastWriteTime';w=22;a="right";e={$_.LastWriteTime}}, @{l='Length';w=12;a='right';e={$_.Length | format-byte}}, Name Note that this does use the Format-Byte cmdlet from the PowerShell Community Extensions. However if you download and use that, you can set this on a global basis: 233# $PscxFileSizeInUnitsPreference = $true 234# gci Directory: Microsoft.PowerShell.Core\FileSystem: :\DownloadsMode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 7/10/2007 11:56 AM 1.16 GB 6.0.6000.0.0.WindowsSDK_Vista_rtm.DVD.Rel.img -a--- 7/31/2007 10:35 PM 1.144 GB 6.0.6001.16621.148.WindowsSDK_LonghornServer_ -- Keith http://www.codeplex.com/powershellcx |
My System Specs![]() |
| | #5 (permalink) |
| Guest | Re: ls -h Thanks Keith, didn't realize that was already part of PSCX. Sean "Keith Hill [MVP]" wrote: Quote: > "Storm Rider" <StormRider@xxxxxx> wrote in message > news:79F15DDD-F614-418C-8728-5F814AD9D046@xxxxxx Quote: > > -h use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and > > Petabyte in order to reduce the number of digits to four or fewer using Quote: > > 2 for sizes. > OK it isn't pretty but it works: > > gci | format-table ` > @{l='Mode';w=5;e={$_.Mode}}, > @{l='LastWriteTime';w=22;a="right";e={$_.LastWriteTime}}, > @{l='Length';w=12;a='right';e={$_.Length | format-byte}}, > Name > > Note that this does use the Format-Byte cmdlet from the PowerShell > Community Extensions. However if you download and use that, you can set > this on a global basis: > > 233# $PscxFileSizeInUnitsPreference = $true > 234# gci > > > Directory: Microsoft.PowerShell.Core\FileSystem: :\Downloads> > > Mode LastWriteTime Length Name > ---- ------------- ------ ---- > -a--- 7/10/2007 11:56 AM 1.16 GB > 6.0.6000.0.0.WindowsSDK_Vista_rtm.DVD.Rel.img > -a--- 7/31/2007 10:35 PM 1.144 GB > 6.0.6001.16621.148.WindowsSDK_LonghornServer_ > > -- > Keith > http://www.codeplex.com/powershellcx > |
My System Specs![]() |