-1

I have this question from an assignment, but the school's resources are inaccessible at the moment, so I need some help. Google is not very helpful for this.

I have only just installed ubuntu, so this is probably basic to some, but not me im afraid. Does anyone know how to 'Check the directory that your shell is currently in'? My assumptions are that terminal is considered my shell, and that I should look for the program file. I have looked around the usr subdirectories using ls. I can't find terminal listed there. If there is a better way to interpret the question I would like to hear about it. :)

Louiee
  • 11

1 Answers1

1

'Check the directory that your shell is currently in'...to interpret the question

I would interpret it simply as pwd i.e. print working directory. You know cd? and man?

This "working", or "current" dir is often displayed in the prompt, together with hostname and/or username. But that's not "checking" ;).


If you want to know where a shell "lives" as a program, you can:

ls /bin/*sh* or find /usr -name bash

Of course, "bash" is only the name of one shell. "sh" might be there as a link.

]# find /usr -name bash
/usr/lib/bash
/usr/include/bash
/usr/share/doc/bash
/usr/bin/bash

You see: "currently" my bash's documentation is in /usr/share/doc/bash. The shell itself, the executable "bash" is in /usr/bin.


to find any program:

]# type bash
bash is /usr/bin/bash

]# ls -l /bin
lrwxrwxrwx 1 root root 7 May 23 14:18 /bin -> usr/bin

(so this also could be a question - bash is in /usr/bin, but also /bin)