My awesome first forum thread!

My awesome first forum thread!

par Erik Spence,
Nombre de réponses : 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!

En réponse à Erik Spence

Re: My awesome first forum thread!

par 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!
En réponse à Leanna Lui

Re: My awesome first forum thread!

par 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.
En réponse à Erik Spence

Re: My awesome first forum thread!

par 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?)
En réponse à Kyla Lee

Re: My awesome first forum thread!

par 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. clin d’œil
En réponse à Erik Spence

Re: My awesome first forum thread!

par 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
En réponse à Judy Xia

Re: My awesome first forum thread!

par 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.
En réponse à Erik Spence

Re: My awesome first forum thread!

par 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!
En réponse à Judy Xia

Re: My awesome first forum thread!

par 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.
En réponse à Erik Spence

Re: My awesome first forum thread!

par 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!
En réponse à Judy Xia

Re: My awesome first forum thread!

par 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.
En réponse à Erik Spence

Re: My awesome first forum thread!

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