
Now list both files again to verify the change: $ ls *fileĪs you can see, tempfile is replaced by emptyfile.įor more information on the mv(1) command, refer to the man Pages(1): To rename tempfile to emptyfile: $ mv tempfile emptyfile You can both move and rename files using the same command, mv (move). (Capital letters and numbers precede lowercaseįor detailed information on the cp(1) command, refer to the man Pages(1): User Commands. Therefore, the command ls *file should list both tempfile and copyfile (and any other file in thisĭirectory with a name that ends with file): $ ls *file Stand for any character or sequence of characters. You can use the wildcard character, asterisk (*), to Notice that both names end with the characters "file." To a file called copyfile: $ cp tempfile copyfile If you enter the lsĬommand with a specific file name, it lists only that file, if the file exists.įor more information on the ls(1) command, refer to the man Pages(1): When you enter the ls command by itself, it listsĪll the files in your current location. Now list the file with the ls command to verify that IfĪ file by the name you specify doesn't already exist, the touchĬommand creates an empty file (if the file already exists, touch updates the last file access time). Use the touch command to create an empty file. In this example, the user's home directory is /export/home/ username, where username is the name of the user owning the home directory. The directory displayed is your home directory: $ cd Then type the pwd (print workingĭirectory) command to display your current location within the filesystem. To make certain that you are indeed in your home directory, type the cd (change directory) command by itself.

Within portions of the system that other users expect to remain unchanged. You'll be less likely to create, copy, move, or (worst of all) delete files Perform the tasks shown in the following examples from your home directory,

This is a directory establishedįor you by your system administrator when your account was created. Will make the commands and their respective concepts easier to understandīefore you start experimenting with files, make sure that you are in 3.2 Using File CommandsĮach of the commands presented in this section includes an example of
LIST DIRECTORY CONTENTS THAT DISPLAYS ONLY FILE NAMES HOW TO
The contents of a file and how to determine the nature of a file. Listing, copying, moving, and deleting files. The following section explains the commands available for creating, Is simply a file that contains other files. Printer, and disk drive(s) are all treated as files. Provides the current date, is an executable file. For example, the dateĬommand that you saw in the previous chapter, which executes a program that Almost everything is treated as a file, including:įiles, such as letters or reports, computer source code, or anything elseĪre executable files that is, they are files you canĮxecute to run a particular program. The file is the basic unit in the SunOS operating Make use of the SunOS operating system it is essential for you to understand

The OpenWindows environment or are logged in from a remote terminal. To any SunOS command line, whether you are using a Shell or Command Tool in

With files and directories from the SunOS command line. This chapter introduces you to the concepts and procedures used to work Moved, and commands are selected from menus. This is different than using the OpenWindowsįile Manager, where files are displayed as icons that can be clicked on and You type in the file and directory names in conjunction with SunOS commands The SunOS command line is used to manipulate files and directories. Chapter 3 Working with Files and Directories
