My awesome first forum thread!

My awesome first forum thread!

by Erik Spence -
Number of replies: 11

The forum is a great place to post your questions, or answer other students' questions if you know the answer.

If at all possible, please avoid posting your code in the forum, for it might be copied by other students.  Please post questions in written if at all possible.

Ask questions!

In reply to Erik Spence

Re: My awesome first forum thread!

by Leanna Lui -
Hi Dr. Spence! Thanks for setting up the forum.

I have a few questions (sorry if I missed them in the lecture).
1. What's the purpose of adding ~/ --> context: what is the difference between mkdir ~/2ndir vs. mkdir 2ndir?
2. What does temp do? E.g., cd temp
3. Can you provide an example of a directory set up where we could use 'cd ../otherdir'? E.g., Slide 19 Lecture 1: If we were in "brelier" and put in the command 'cd ../otherdir', would we fall into "ejspence" directory?

Thank you!
In reply to Leanna Lui

Re: My awesome first forum thread!

by Erik Spence -
Hey there Leanna,

1. Recall what the "~" symbol represents: it represent your home directory. So if I do "mkdir ~/2nddir" I will make a directory called 2nddir in my home directory. If I do "mkdir 2nddir" I will make a directory called 2nddir wherever I happen to be on the filesystem at the time.

2. I created a directory called temp, in the firstdir directory, a few lines before that one ("mkdir firstdir/temp"). temp is just a directory.

3. Not quite. You would need to do "cd ../ejspence". The command on the slide would only work if there was a directory called "otherdir". Does that make sense?

Good questions. Let me know if you have others.
In reply to Erik Spence

Re: My awesome first forum thread!

by Kyla Lee -
Hi Dr Spence,

I'm trying to download git and I'm wondering which one I should download (I have a mac).

The options the site you linked for Mac are: homebrew, xcode, and binary installer (the other two is building from source and a GUI, which I'm assuming is not appropriate here?)
In reply to Kyla Lee

Re: My awesome first forum thread!

by Erik Spence -
Hey there Kyla,

I'm not sure. I would probably pick the binary installer. Let me know how it goes.

Don't be afraid to start a new forum thread, if you have a new question. wink
In reply to Erik Spence

Re: My awesome first forum thread!

by Judy Xia -
Hi Dr. Spence,
Just a curious question, I am using Terminal on Mac, and I am hoping to get it to bold/color directories in the output. Currently, they are all black and plain texts. I searched on the internet and the popular way "~/.bash_profile" and then do alias to "ls -G" outputs "permission denied" on my screen. Is there another way I can enable colorized texts? Thanks a lot!
-Judy
In reply to Judy Xia

Re: My awesome first forum thread!

by Erik Spence -
What command are you using, exactly? And where are you doing it? You shouldn't be getting a permission denied error to make this modification.
In reply to Erik Spence

Re: My awesome first forum thread!

by Judy Xia -
Hi Dr. Spence,
I actually tried a few. When I tried:
$ vi ~/.bashrc
OR: $ vi ~/.bash_profile
I couldn't able to add the alias sign or exit the page (ex. alias ls='ls -G')
Source: https://www.cyberciti.biz/faq/apple-mac-osx-terminal-color-ls-output-option/

I also tried:
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
They worked and highlighted my directories each time I typed them in, but once I terminate the Terminal program and open it again, the program reverts itself back and I get plain text again.

Thanks!
In reply to Judy Xia

Re: My awesome first forum thread!

by Erik Spence -
Well, yes. Using the 'vi' command will invoke the 'vi' editor, which is an advanced editor which I personally can't stand. Why don't you edit the ~/.bashrc file instead, and use whatever text editor you're using for your assignment? Put your export commands into that file.
In reply to Erik Spence

Re: My awesome first forum thread!

by Judy Xia -
Hi Dr. Spence,

Thanks for the tip! Do you mean putting "~/.bashrc" in the editor and source it? (I am using atom). I tried directly typing it out in my home directory but it says no such file. It's alright if it gets too complex over text, I will make sure to drop in one of the office hour sessions. Thanks for your help!
In reply to Judy Xia

Re: My awesome first forum thread!

by Erik Spence -
Remember what Atom is: it's just a text editor. Nothing more. You don't 'source' files within Atom, you only edit them. Within Atom, create a new file called ~/.bashrc, put the commands into it, and save it. Restart your terminal and the commands will be automatically invoked.
In reply to Erik Spence

Re: My awesome first forum thread!

by Judy Xia -
Thanks so much Dr. Spence! sorry for my late reply but it worked beautifully. thanks!