9 managing directories, Creating a directory (mkdir), Chapter 9: managing directories – HP NonStop G-Series User Manual

Page 113

Advertising
background image

9 Managing Directories

This chapter describes how to manage OSS directories. After completing this chapter, you will be
able to:

Create directories

Change directories

Display, copy, and rename directories

Remove directories

A good way to learn about managing directories is to try the examples in this chapter. Be sure to
do the examples in the order given.

Before you begin to work through the examples, your home directory in the OSS environment
should be in the state in which you left it after completing the examples in the previous chapter,

Chapter 8 (page 93)

, and should contain the following:

The files file1, file2, file3

The files record1, and record6 (if you created the record1 through record6 files before
using the examples for the rm command)

The /reports subdirectory that contains the files file1, file2, file3, and notes

The empty /project subdirectory

If your home directory does not contain the files record1 and record6, create them now. (They
can be empty files.)

If you are using files with different names, make the appropriate substitutions as you work through
the examples. To produce a listing of the files in your current directory, enter the ls command.

Creating a Directory (mkdir)

Directories allow you to organize individual files into useful groups. For example, you could put
all the sections of a report in a directory named /reports, or the data and files you use in cost
estimating in a directory named /estimate. A directory can contain files, other directories, or
both.

Your home directory was created for you when your computer account was established. However,
you will probably need additional directories to organize the files you create and edit while working
with the system.

You can create new directories with the mkdir (make directory) command.

The form of the mkdir command is as follows:

mkdir dirname

The dirname entry is the name you wish to assign to the new directory. When executed, mkdir
creates a directory with the name specified as dirname. The new directory is created as a
subdirectory of your working directory.

In the following example, make sure you are in your home directory by entering the cd command;
then, create a new directory named /project2:

$ cd

$ mkdir project2

Next create a subdirectory named /status in the /reports directory by entering a relative
pathname:

$ mkdir reports/status

Creating a Directory (mkdir)

113

Advertising
This manual is related to the following products: