I'm reading this stackoverflow answer on running yo
and npm
without sudo
by saving their results in ~/.node
.
It uses echo prefix = ~/.node >> ~/.npmrc
, and I'd like to know what each symbol means and how they work together in this case.
I'm reading this stackoverflow answer on running yo
and npm
without sudo
by saving their results in ~/.node
.
It uses echo prefix = ~/.node >> ~/.npmrc
, and I'd like to know what each symbol means and how they work together in this case.
This simply prints a string to standard output. The shell will expand
~
to the value of$HOME
, so the string printed might be something like"prefix = /home/randwa1k"
(without the quotation marks, of course).This redirects the output of the
echo
command to the file~/.npmrc
, which expands to the same thing as$HOME/.npmrc
. Using>>
rather than>
means that the output is appended to the end of the file.So the command as a whole appends one line of text to a file called
.npmrc
in your home directory.The effects of that change to the
.npmrc
file are going to depend on whatever programs read that file.