User Tools

Site Tools


opus:fall2012:dsherbur:unixpart1

Keyword 1 Phase 1

Identification of chosen keyword: Current working directory

Definition

Definition (in your own words) of the chosen keyword:

THE WORD(S) OF THE DAY IS(ARE): CURRENT WORKING DIRECTORY. *Note: If you haven't read Unix for the Beginning Mage yet, some of the terminology might seem odd.

COMMENCE

The current working directory refers to the absolute path of where you are “standing”. To find out where, exactly, you are standing, type “pwd” into the terminal. You should get an output; if you don't, I'm sorry. This output will change as you change your position in the file system. The prompt will also change as you move around. To illustrate a few concepts, I have made a directory in my home directory called “cwd” (current working directory) and a few directories therein.

lab46:~$ mkdir cwd
lab46:~$ cd cwd
lab46:~/cwd$ mkdir file
lab46:~/cwd$ cd file
lab46:~/cwd/file$ mkdir music
lab46:~/cwd/file$ cd music
lab46:~/cwd/file/music$ pwd
/home/dsherbur/cwd/file/music

In the prompt, lab46 refers to the system's name (as far as this entry is concerned). Then there is a colon (:), and, if you are standing in or past your home, there is a tilde (~). The prompt can help you identify your current working directory without having to type pwd. The tilde refers to the path of your home directory, which is usually /home/username. Everything after the tilde and between the dollar sign is your current directory. If you are not in the home directory, or you are in a directory contained within the home directory, the prompt will not have a tilde in it.

lab46:~$ cd /
lab46:/$ pwd
/

I changed directories from my home directory to the root directory. The prompt no longer uses a tilde because root is not part of home, but rather home is a part of root.

References

List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).

  • Reference 1: Play

Keyword 1 Phase 2

Remote Host

Definition

A remote host is a computer typically refereed to as a server in a private or a public network. The computer or server will be located in a distant location. This server or computer can retrieve and store data and users can even access data off of them. A good example would be the servers located here at the business center when we log on and access files from home.

References

Demonstration

Demonstration of REMOTE HOST:

Our remote host is lab46. There is one centralized computer or server from which, via terminals, data is/are accessed. To demonstrate this, we will be examining the PS1 line. This line is a variable (notice the caps) that determines what the prompt looks like.

lab46:~$ echo $PS1
\h:\w\$

The “\h” (whack h) prints the hostname in the prompt. Furthermore, when I ssh into lab46 from my home computer, I use the following incantation:

dustin@balagog:~$ ssh dsherbur@lab46.corning-cc.edu

Lab46, or more specifically, lab46.corning-cc.edu is our remote host.

See: http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html

opus/fall2012/dsherbur/unixpart1.txt · Last modified: 2012/10/31 13:21 by dsherbur