Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Mostly, yes, except that ls -1 does not turn off colours, and maybe there are a few more differences.


Color output is not on by default in 'ls'.

Your 'ls' must be an alias for the real ls with some options. For example, mine is:

    $ type ls
    ls is aliased to `ls --color=auto'
A quick way to run the original 'ls' (not the aliased version), just prefix it with backslash:

    $ \ls ...
Or:

    $ command ls ...


I can't imagine why anyone would want to spawn another process instead of just RTFM, if you are on linux:

    ls --color=never -1


Because, in many - if not most - situations, spawning another process is insanely lightweight compared to the cognitive/physical load of your alternative (which includes remembering the switch and its value ("never" is hardly intuitive), remembering whether or not you're using a system that supports it (surprise, surprise, OSX doesn't), and typing all those extra characters).

Admittedly, I never actually do this because I don't ever care to not see colour (what would be the motive?), but I can understand why the OP does what they do.


You are Randal L. Schwartz and I claim my five pounds.

[http://partmaps.org/era/unix/award.html]




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: