Techknow Study

UNIX : File Management

9:35:00 AM Ashish Rana 0 Comments Category :

All data in UNIX is organized into files.

All files are organized into directories.
These directories are organized into a tree-like structure called the filesystem.
When you work with UNIX, one way or another you spend most of your time working with files.

In UNIX there are three basic types of files:

  • Ordinary Files: An ordinary file is a file on the system that contains data, text, or program instructions. In this tutorial, you look at working with ordinary files.

  • Directories: Directories store both special and ordinary files. For users familiar with Windows or Mac OS, UNIX directories are equivalent to folders.

  • Special Files: Some special files provide access to hardware such as hard drives, CD-ROM drives, modems, and Ethernet adapters. Other special files are similar to aliases or shortcuts and enable you to access a single file using different names.

To list the files and directories stored in the current directory. Use the following command :

If you use ls with the option -l, then the output format will be :

Here is the information about all the listed columns:
  1. First Column: represents file type and permission given on the file. Below is the description of all type of files.
  2. Second Column: represents the number of memory blocks taken by the file or directory.
  3. Third Column: represents owner of the file. This is the Unix user who created this file.
  4. Fourth Column: represents group of the owner. Every Unix user would have an associated group.
  5. Fifth Column: represents file size in bytes.
  6. Sixth Column: represents date and time when this file was created or modified last time.
  7. Seventh Column: represents file or directory name.