Title: Aliases and native utils name collision · Issue #567 · PowerShell/PowerShell · GitHub
Open Graph Title: Aliases and native utils name collision · Issue #567 · PowerShell/PowerShell
X Title: Aliases and native utils name collision · Issue #567 · PowerShell/PowerShell
Description: We have 24 conflicting names between PS aliases and /bin, /usr/bin, etc folders # /bin cat cp echo kill ls mv ps pwd rm rmdir sleep # /usr/bin cd clear cpp diff fc man ri sort tee type write # /usr/sbin ac # /sbin mount We need to figure...
Open Graph Description: We have 24 conflicting names between PS aliases and /bin, /usr/bin, etc folders # /bin cat cp echo kill ls mv ps pwd rm rmdir sleep # /usr/bin cd clear cpp diff fc man ri sort tee type write # /usr...
X Description: We have 24 conflicting names between PS aliases and /bin, /usr/bin, etc folders # /bin cat cp echo kill ls mv ps pwd rm rmdir sleep # /usr/bin cd clear cpp diff fc man ri sort tee type write # /usr...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/567
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Aliases and native utils name collision","articleBody":"We have 24 conflicting names between PS aliases and `/bin`, `/usr/bin`, etc folders \n\n```\n# /bin\ncat \ncp \necho \nkill \nls \nmv \nps \npwd \nrm \nrmdir \nsleep\n# /usr/bin\ncd \nclear \ncpp \ndiff \nfc \nman \nri \nsort \ntee \ntype \nwrite \n# /usr/sbin\nac\n# /sbin\nmount\n```\n\nWe need to figure out what's out story about it.\n\nI think it make sense to play around with different options to see pros and cons on practice.\n#### ~~Try it~~ (the snippet is outdated, see the new snippet for 0.3.0 bellow)\n\nYou can add this snippet to your profile and easily switch from one mode to another\n- **Remove-PSAliases** will remove aliases, so you can use native utilities.\n- **Set-PSAliases** will restore aliases.\n\n``` powershell\n$global:__aliases = @(\n 'cat', \n 'cp', \n 'echo', \n 'kill', \n 'ls', \n 'mv', \n 'ps', \n 'pwd', \n 'rm', \n 'rmdir', \n 'sleep',\n 'cd', \n 'clear', \n 'cpp', \n 'diff', \n 'fc', \n 'man', \n 'ri', \n 'sort', \n 'tee', \n 'type', \n 'write', \n 'ac',\n 'mount'\n) \n\nfunction Set-PSAliases\n{\n $global:__aliases | % { \n Write-Host \"Adding $_\"\n Set-Alias $_ $global:__aliases_backup[$_] -Scope Global \n } \n}\n\nfunction Remove-PSAliases\n{\n if (-not $global:__aliases_backup) {\n $global:__aliases_backup = @{}\n $global:__aliases | % {\n $global:__aliases_backup[$_] = (Get-Command $_).ResolvedCommandName\n }\n }\n\n $global:__aliases | % { \n Write-Host \"Removing $_\"\n while (Test-Path alias:$_) {\n Remove-Item -Force alias:$_ \n }\n }\n}\n```\n","author":{"url":"https://github.com/vors","@type":"Person","name":"vors"},"datePublished":"2016-02-20T05:32:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":19},"url":"https://github.com/567/PowerShell/issues/567"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8c8a880e-3fe0-216e-0c31-82912c932f9b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8C64:28B2AB:2C9C78B:3B9AB0A:6A5DAA50 |
| html-safe-nonce | cc6725ebc684cbeb4f76b1ed98311bbe4f8f1e9207c178d1bf3098d417cd1472 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzY0OjI4QjJBQjoyQzlDNzhCOjNCOUFCMEE6NkE1REFBNTAiLCJ2aXNpdG9yX2lkIjoiMTM1OTExNTU1MDQ2ODE4ODc1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9a7d679e00c47b31a54d72192a29614701d921096e96bcc1ef4926b7111e4ac0 |
| hovercard-subject-tag | issue:135036038 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/567/issue_layout |
| twitter:image | https://opengraph.githubassets.com/32500de901d5cb5eed1364d42035318099ff5432e3c9bc0f04edd52009977353/PowerShell/PowerShell/issues/567 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/32500de901d5cb5eed1364d42035318099ff5432e3c9bc0f04edd52009977353/PowerShell/PowerShell/issues/567 |
| og:image:alt | We have 24 conflicting names between PS aliases and /bin, /usr/bin, etc folders # /bin cat cp echo kill ls mv ps pwd rm rmdir sleep # /usr/bin cd clear cpp diff fc man ri sort tee type write # /usr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vors |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width