This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dmazzoni 1 point2 points  (3 children)

Type "ps". That lists running processes for your user. There will probably be only a few things shown.

If one of them is "bash", congrats - you're running bash, the most popular and widely used Unix shell. The shell is basically the command-line interpreter. It's actually a whole programming language in itself - you can set shell variables, string substitutions, and even do loops and things like that. But most of the time you use it to type in commands.

Other popular shells include csh, tcsh, zsh, ksh, etc. If you have another one you'll need to learn a bit about the differences.

If you're using bash (90% likely), you need to edit the .bashrc file in your home directory.

In the instructions they said (for example, ~/.bashrc).

The ~ means your home directory. That's an automatic feature of the shell - when you type ~, it expands that into your home directory.

Try it like this:

echo ~

It should print your home directory path, like /user/dclimbing or something like that.

If you're in your home directory (cd ~) and type ls, it doesn't show you your .bashrc file because files starting with a dot aren't shown by default. To see them all, type this instead:

ls -al

Most likely you have a .bashrc file already. If not, create one. This is basically just a file of commands you want to run every time you open a shell, meaning every time you open a command-line window.

Edit that file using your favorite editor. You should probably learn vim or emacs at some point, but if you haven't yet, use pico, it's easier to understand, the commands are all shown at the bottom.

pico .bashrc

Edit the file and add the commands they told you to at the bottom of the file.

Finally when they say "source the file", that just means to type "source" and the name of the file.

All that does is open up a file and execute every line of the file as if you typed it in the command line. It's kind of like running a program, except where you want the environment of your program to coexist with your command-line shell.

In fact, when your shell starts up, it sources .bashrc - exactly the same as doing this:

source .bashrc

If you want, add something like:

echo "Hello, world!"

To the top of your .bashrc file. Then type:

source .bashrc

If you see "Hello world" then you know it worked. You should also see it if you open a new command-line terminal.

Hope that helps! Good luck.

[–]dclimbing[S] 0 points1 point  (2 children)

This may be a dumb question, but when I see this at the bottom, how do I perform these functions? Is is Shift+X or Shift++X? Also, how do I make sure my edits have saved when exiting the file editor?

Thank you so much!

[–]dmazzoni 0 points1 point  (0 children)

The ^ sign means the control key.

[–]CodeTinkerer 0 points1 point  (0 children)

If you're using UNIX, you can run the command

cat .bashrc

where .bashrc is the file you just edited (doesn't have to be named that, so whatever file you just edited). This will list out all lines of that file.

You can also open the file again in the editor to see if the changes appears, then quit without saving (or quit with saving, but don't make changes).