Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Using Your HP Workstation > Chapter 5 Working with Files

Manipulating Files and Directories

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

The major identifying features of a file or directory are:

  • Its name and location in the file hierarchy.

  • Its owner and permissions (properties).

  • Whether or not it is linked to another file. A linked file is a representation of another file. Linked files provide a way for you to have one file that appears to exist in two or more directories. (See “Creating a Symbolic Link”.)

Creating a New File or Directory

  1. Choose New ...

    • From the File menu to create a new file.

    • Or, from the Directory menu to create a new directory.

    A dialog box prompts you for the name of the new file or directory.

  2. Enter the new name.

  3. Choose OK.

There are other ways to create objects:

  • Copy an existing object, then rename it.

  • Create a new file within an application. For example, if you use Text Editor to write a new text file, when you save it for the first time, a new file is created.

Moving a File or Directory

Mouse. 

  1. Be sure the destination directory is visible (either as an icon or as an open File Manager view).

  2. Drop the icon into its new directory.

NOTE:
  • If you move a directory, the entire directory and its contents are moved.

  • If you attempt to move a file or subdirectory from a directory where you do not have permission to make changes, File Manager may create a copy of the object, and display a "File Manipulation Error" indicating that you cannot delete the original file.

For HP VUE Lite. Since File Manager is not available in HP VUE Lite, you must use the mv command to move and rename files. Open a terminal window (see “Starting and Stopping a Terminal Window”), then execute the mv command like this:

   mv oldfile newfile

Or, to move one or more files into an existing directory:

   mv files directory

The following example moves star.xwd into the /home/jodi/Graphics directory:

   mv star.xwd /home/jodi/Graphics Enter 

File and directory names may include a path, if needed. See “The Hierarchical File System”.

Copying a File

Mouse. 

  1. Be sure the destination directory is visible (either as an icon or as an open File Manager view).

  2. Press and hold CTRL while dragging the file's icon, then drop the icon into the directory where you want the copy.

Keyboard. 

  1. Select the file's icon.

  2. Choose "Copy" from the File menu. A dialog displays, prompting you for the name of the new copy.

  3. Enter a name for the new copy of the file and choose OK.

NOTE: You cannot use the Copy command to copy directories. However, the HP-UX command cp -r copies a directory and its contents. See the HP VUE Lite procedure below for more information.

For HP VUE Lite. Since File Manager is not available in HP VUE Lite, you must use the cp command (copy), to copy files and directories. Open a terminal window (see “Starting and Stopping a Terminal Window”), then execute the cp command like this:

   cp oldfile newfile

Or, to copy a directory and its entire contents:

   cp -r directory newdirectory

The following example copies mydir and any subdirectories to a new directory called mydir2.

   cp -r mydir mydir2 Enter

File and directory names may include a path, if needed. See “The Hierarchical File System”.

Creating a Symbolic Link

A symbolic link is a type of file that contains only a path name (a "pointer") to the place where the actual data is stored. Using this procedure avoids duplication of large files, and saves space.

Mouse. Press and hold Shift while dragging the object's icon. When you drop the icon into a new directory, a symbolic link is created in that directory that points to the original object.

Keyboard. 

  1. Choose "Terminal" from the Directory menu in File Manager. This opens a terminal window with the same current working directory.

  2. Use the ln command to create the symbolic link:

       ln -s filename linkname
    

    Where filename is a complete path to the existing file, if it is not in the current directory, and linkname is the name of the symbolic link, which may also be a complete path.

    For example, to create a symbolic link from /home/leslie/myfile to the existing file /home/leslie/work/newfile, use this command:

       ln -s /home/leslie/work/newfile /home/leslie/myfile Enter
    

    Users can now access /home/leslie/work/newfile by accessing /home/leslie/myfile.

  3. Close the terminal window by choosing "Close" from the window menu or by executing the exit command.

For HP VUE Lite. Since File Manager is not available in HP VUE Lite, you must use the keyboard method above.

Changing the Owner of a File or Directory

There may be times when you need to change the owner of a file or directory. For example, you may be moved from one project to another before the first project is complete, and may need to give your replacement on the first project ownership of the directories and files associated with the project.

  1. Select the object's icon.

  2. Choose "Properties" from the File menu or from the object's pop-up menu. File Manager displays the File Properties dialog.

  3. Make the desired changes:

    • To change the file's owner, type the new owner's name into the "Owner Name" field.

    • To change the file's group, type the new group name into the "Group Name" field.

    See “File Ownership and Security” for more information.

  4. Choose OK.

NOTE:
  • If you give ownership of the file to another user, you will not be able to change the permissions again unless that user returns ownership to you.

  • If you do not have permission to change the properties, some of the controls in the File Properties dialog are inactive.

Changing Access Permissions

You can change the access permissions to directories and files you own. You might need to do this if your manager assigns other people to work with you and they need access to your files.

  1. Select the object's icon.

  2. Choose "Properties" from the File menu. File Manager displays the File Properties dialog.

  3. In the Permissions box, select the permissions for the file or directory's owner, group, and other:

    • Select "Read" for the users that should be allowed to read the file or directory.

    • Select "Write" for the users that should be allowed to alter the file or directory.

    • Select "Execute" for the users that should be allowed to execute the file or access files in the directory.

    See “File Ownership and Security” for more information.

  4. Choose OK.

The object's owner is identified in the Owner Name field. The object's group is identified in the Group Name field.

Read, write, and execute permissions are selected in the Permissions box. The permissions selected in the Group row indicate the access privileges for any user belonging to the named group. The permissions selected for the Other row apply to all other users.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© © 1983-1995 Hewlett-Packard Development Company, L.P.