Chapter 2. Working with Files and Directories

   

Chapter Syllabus

2.1 Basic Operations on Files

2.2 File Naming Rules

2.3 Working with Directories

2.4 Copying and Moving Files

2.5 Wildcards

2.6 File Types

2.7 Searching File Contents

2.8 Finding Files

2.9 Miscellaneous File Handling Commands

As a user of a UNIX system, dealing with files is a routine task. A considerable proportion of time is consumed working with files. To make the best use of your time, you always need to reduce time spent on file handling. This can be accomplished through efficient use of commands related to file and directory operations. HP-UX provides a simple and powerful command mechanism. Other uses of file handling commands are for grouping these commands and passing output of one command to another. Operations can be performed on single files or a group of files at the same time. When preparing for the HP-UX certification examination, knowing these basic file operations is important. There are some questions on the certification exam that are directly related to file handling. Other than that, many other questions have implicit application to the commands presented here.

Most of this chapter is devoted to the use and explanation of file handling commands. You will learn very basic operations on files. These operations include creating, listing, deleting, and displaying contents of a file. Then you will learn some rules that apply to file names, and you will see which file names are legal in HP-UX. After that, basic operations on directories will be presented, where you will find commands for creating, deleting, and changing directories. Copying and moving files are routine tasks , and commands for these are presented next. For simultaneous operations on multiple files, wildcards are used, and you will see the uses of each of them. Searching text files for a particular string and finding files with a particular name on a system will be the next topic. At the end of the chapter, you will learn more commands for file manipulation.


   
Top


HP Certified
HP Certified: HP-UX System Administration
ISBN: 0130183741
EAN: 2147483647
Year: 2000
Pages: 390
Authors: Rafeeq Rehman

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net