Table of Contents

unix Keyword 1

Identification of chosen keyword.

Definition

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

References

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

unix Keyword 1 Phase 2

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).

Demonstration

Demonstration of the indicated keyword.

If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:

/*
 * Sample code block
 */
#include <stdio.h>
 
int main()
{
    return(0);
}

Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:

lab46:~$ cd src
lab46:~/src$ gcc -o hello hello.c
lab46:~/src$ ./hello
Hello, World!
lab46:~/src$