I am taking a linux class this semester and one of the questions on a lab is:
Use the set command to find out all directories in your path.
Normally, I would just use $PATH
to find out the directories in my path. But, obviously the question is asking us to use set. I have never used set before and went to do man set
to find out a little bit about the command, but, to my surprise my shell (bash) didn't have an entry for set. However, I see that there is a set man page here http://linuxcommand.org/lc3_man_pages/seth.html So that is my first question: Why isn't there an entry when I use the command man set
?
I posted on a discussion board that if i just type set
it spits out a bunch of function stuff that looks like info from rails
which I have installed on my machine. No idea whats going on there.. My professor explained that set is a "built in" function which is why it might not have documentation in the man pages.
After looking at the set documentation online a little bit, I still have no idea how I can get it to spit out my $PATH
and after doing a little research I haven't found anything that really explains set
well in the context that I need to use it
To be clear I am not simply seeking an answer here, a general explanation pointing me in the right direction would be very helpful.
TL;DR
Why can I find a man entry online for
set
but when I use the commandman set
no documentation is available in my terminal.What might be a general way to use
set
to find the directories in myPATH
Thanks!
edit: The full question:
- Use the set command to find out all of the directories in your “PATH.” You will get a lot of data and you will need to pipe to another command to filter out just what you want. Please note that PATH is capitalized. Paste or type those directories below. You will get a bunch of data so see if you can dig through it to get the answer.