Cd command is broken
Everyone who knows `cd` kowns there's another command called `ls`. `ls` is always typed after `cd`. Like `cd project`, ls`.
Everyone wants to read child files as soon as he enters a directory, and `ls` is the command.
But why are `cd` and `ls` the same command. Enter a directory is an action, rather than 忒o actions. Suppose you want to open a site called <https://news.ycombinator.com> and you type in the url and hit Enter(like `cd hacker-news`). Then do you need to type in `open` to read?
Hope one day we may fix it.
(
10 comments
| 2 points
| on HN
)
But again, just use a bash alias :) What's the problem with that?
$ function newcd(){ cd $1; ls;}
$ alias cd=newcd
$ cd ..
$ cd Desktop
EDIT: I had accidentally put a "$1" in the ls command, now removed.
When I type `cd a\ dir`, it works, while `c a\ dir` fails. `$1` seems not to cover the whole parameter. Can you fix this?
The popular Unix mantra is "do one thing and do it well" - both these commands, while definitely connected, are each "one thing" and they both perform them very well.
Just an example. People may say something offer three features, one plus one and plus one, just like Unix does. But if we are going to explain 99, it is faster to say 100 minus 1 rather than 90 plus 9.
`cd $1 && ls` is a larger command. It's also an easier one.