Solaris how many files in a directory




















Documents — These items include text files, such as letters or reports, computer source code, or any other document that you write and want to save. Commands — Most commands are executable file. That is, they are files you can execute to run a particular program. For example, the date command in the previous chapter, which executes a program that provides the current date, is an executable file.

Devices — Your terminal, printer, and disk drive s are all treated as files. Directories — A directory is simply a file that contains other files. The following section explains the commands for creating, listing, copying, moving, and deleting files. This section also includes information on how to list the contents of a file and how to determine the nature of a file. Each of the command descriptions in this section includes an example of how to use the command.

Try the examples as you read the text. Before you experiment with files, make sure that you are in your home directory. Your system administrator established this directory for you at your account creation. To avoid changes to parts of your system that other users expect to remain unchanged, perform the following tasks in your home directory.

To make certain that you are in your home directory, type the cd change directory command. This command moves you to your home default directory. Then type the pwd print working directory command to display your current location within the file system.

The directory displayed is your home directory:. Use the touch command to create an empty file. If a file by the name you specify does not exist, the touch command creates an empty file. Now list the file with the ls command to verify that you've created it:. When you type the ls command by itself, it lists all the files in your current location.

If you type the ls command with a specific file name, it lists only that file, if the file exists. For more information on listing files, see the man page ls 1. Use the cp command to copy tempfile to a file called copyfile :. Now list both files. Notice that copyfile is listed first. Files are listed in alphabetical order. Capital letters and numbers precede lowercase letters. For detailed information on copying files, see the man page cp 1.

You can move and rename files by using the same command, mv move. In this example, use the mv command to rename tempfile to emptyfile :. For more information on moving and renaming files, see the man page mv 1.

Use the rm remove command to delete copyfile , and verify the result with the ls command:. You cannot recover files that you have removed with rm. For more information on the rm 1 command, refer to the man Pages 1 : User Commands.

Use the more command to display the contents of a file. Type more and follow it with the name of the file to be displayed.

The contents of the file scroll down the screen. If the file is longer than one screen, this message appears:. You can also use the cat command to display the contents of a file, but it displays the file contents rapidly without pausing. The cat concatenate command is more often used to join two or more files into one large file, as in this example:. For further information on the more 1 or cat 1 commands, refer to the man Pages 1 : User Commands.

Some files, such as binary files and executable files, are not printable and cannot be displayed on the screen. Use the file command to show the file type. This section describes the directory hierarchy that the Solaris operating environment uses to manage and organize files. Files are grouped into directories, and directories are organized in a hierarchy.

In the following example, Figure 3—1 , each directory in the file system contains many subdirectories. When you initiate commands, you specify directories and files by including the names of the directories that contain the files or directories you want to work with. The names of directories and the files beneath them, combined with slash separators, constitute a path name.

All subdirectory names and file names within a directory must be unique. However, names within different directories can be the same. Path names for files work exactly like path names for directories. The path name of a file describes that file's place within the file-system hierarchy.

The pwd command print working directory displays where you are in the file system hierarchy. Your output might be different from the example, as your directory structure is different. Your working directory is your current location within the file-system hierarchy. Every user has a home directory. When you first open a terminal or a window, your initial location is your home directory. It is possible that updates have been made to the original version after this document was translated and published.

Veritas does not guarantee the accuracy regarding the completeness of the translation. You may also refer to the English Version of this knowledge base article for up-to-date information. Support Knowledge base The maximum number of subdirectories allowed by Solaris The maximum number of subdirectories allowed by Solaris. Article: We'll send a magic link to your inbox. Email Address. All Sign in options. Enter a Email Address.

Choose your interests Get the latest news, expert insights and market research, sent straight to your inbox. Newsletter Topics Select minimum 1 topic. Operating Systems. Tags: Solaris. Anonymous March 1, 0 Comments. Hi experts, Plz clear my doubts What command to list only the directories? Anonymous Posted March 1, 0 Comments. Managing Services Tasks.

Using the Fault Manager. Managing System Information Tasks. Managing System Processes Tasks. Monitoring System Performance Tasks. Managing Software Packages Tasks. Managing Disk Use Tasks. How to Display the Size of Files. How to Find Large Files. Finding and Removing Old or Inactive Files. How to Clear Out Temporary Directories.



0コメント

  • 1000 / 1000