lsfunction for powershell with bash'slslike output.- you can use
-1,-c,-foptions. - with
-loption, simply returns powershell's defaultls(Get-ChildItem) result .
- you can use
-
v1.0.2
- C option color for symbolic link changed : cyan -> light cyan
- bug fix
- error when -1 option used fixed,
- bleeding C option color to type identifier fixed.
-
v1.0.1
- changed the item display order when showing multiple columns to prioritize vertical direction, similar to the behavior of ls in bash.
-
v1.0.0
- initial version
bash-like-ls
Options:
-1 list one file per line
-f,F append indicator (one of */@) to entries
-c,C color the output.
-l,L simply passes through to pwsh's default ls (Get-ChildItem).
this option will be preferentially applied.
--help display this help message
Notice:
For redirect or pipe, you must use with the pass through option (-L)
or -1 without -F, -C option.
When used with -L option, this function simply calls Get-ChildItem,
so returns an array of FileSystemInfo objects.
When used with -1 option, this function returns a string array of the
file names.
Version : 1.0.2
Author: knhcr
- Place the
bash-like-ls.ps1file anywhere you like. - Add below into the PowerShell's profile file (
$profile).- Don't miss the first
.and the white space.
- Don't miss the first
. "<ABSOLUTE_PATH_TO>\bash-like-ls.ps1"
Remove-Item Alias:ls -ErrorAction SilentlyContinue
Set-Alias -Name ls -Value Bash-Like-LS- Hint.
- The
$profilefile may be in the path below, I think. (You can know it by just typing$profilein your PowerShell)- [PS 5]
C:\Users\<USER_NAME>\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 - [PS 7]
C:\Users\<USER_NAME>\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
- [PS 5]
- The
- Delete
bash-like-ls.ps1file, and remove the line you write into your$profile.


