News for hackers. Stuff that matters.
Re:Why can't I write code inside my browser? by michaelt on Friday January 15, 2021 @09:34AM (#25791363)
I love the command line and use it all the time.

But let's be honest, the design is pretty esoteric.

You want to find a file containing a particular string? For some reason the tool is called 'grep'. The name is followed by '-r' then the search term, then the directory to start the search in.

And it won't be long before you start encountering tools with such intuitive names as 'sed' and 'awk' and 'crontab'

The tool for finding a file by name is better - that's called 'find' - except compared to grep the arguments are swapped: The directory to search is now the first parameter, not the last.

Oh, to find the *.desktop files on your system you did a find on / ? Yes, the messages like "find: ‘/proc/19917/fd’: Permission denied" are normal, you should ignore them. It's easy, simply add 2>/dev/null to the command.

Before you know it, the command line infects your brain and you start saying things like "sudo and nohup are perfectly good names"

Re:Why can't I write code inside my browser? by kellyjprice on Friday January 15, 2021 @01:05PM (#25793921)
Oh oh. I read the HN article about why it's called `grep`.

g - global re - regex p - print

https://en.wikipedia.org/wiki/Grep#:~:text=Its%20name%20come....

Re:Why can't I write code inside my browser? by ywei3410 on Friday January 15, 2021 @11:08AM (#25792414)
To be honest the criteria for a beginner and someone who's used a tool for a while are different.

You bet that `ls`/`cd` is a great name for me - it takes 2 characters and I don't have anything similar conflicting on the PATH.

For a beginner? Not so much - `change-directory` and `list-directory` would probably be better. It's the same with regular expressions `^[A-Z0-9]{0, 3}$` is perfectly readable once you're reasonably familiar with the syntax.

It's also true in other fields such as mathematics or music - the notation is quite good once you're proficient in it.