A few basic linux questions


#1

I noticed the use of different editors in the courses, ie, vim, gedit, nano. Are there advantages of one over another? Personally I prefer gedit as it is more intuitive to use.

Also, I noticed the use of different methods to edit bashrc, eg …

sudo echo “export courseRoot=/home/$USER/cousreRoot” >> ~/.bashrc

or edit directly:

export PATH="(paste path here)":$PATH

export apm=(paste path here without quotes)

Why with quotes or without? It seems like the “sudo echo” method is the easiest, so why not always use that?

Just trying to gain a little insight into using linux. Again thanks for the great content and feedback !


#2

Good questions @jax200

It’s basically whatever your personal preference is.

I like gedit when I have a GUI, as the pure command line based text editors aren’t as convenient.

It is still good to know vi and nano for use on the raspberry pi, so not a bad idea to get some practice using them on your desktop GUI.

I prefer vi over nano, but I’ve experienced some problems in keyboard interpretation on the raspberry pi that make some standard vi versions unusable (unless you fix the keyboard interpreter on the raspberry pi). In those cases, out of the box nano has worked for me.

Basically I’d say be aware of your options but stick to one when given the choice- just my 2 cents.

As for editing the bashrc file, really whatever method you prefer works. I mixed up the method in the course just to show there is more than 1 way to skin the cat.

The bashrc editing method with quotes is for when you are wanting to add some text to the end of the file. sudo echo says print some text to the command line. That text is the text between the double quotes. Then you can route the text to the end of the .bashrc file instead of the command line with the >> characters.


#3

Many thanks Caleb.

Jack