You are on page 1of 3

The Unix and Posix file systems:

The Unix and Posix file systems are stored in a tree file Hierarchical system. The root
of a file system is the root directory, denoted by “/” characters.

Each intermediate node in a File system tree is a directory file. The last nodes of a File
system tree are either empty directory files or other type of files.

The absolute path name of a file consist of the names of all directories, specified in the
decending order of the directory hirechary, starting from ”/”.

Eg:/usr/xyz/a.out.

A relative path name may consist of the “.” And “..” chars.

These are the references to the current and parent directories, respectively.

IN UNIX NAME-MAX PATH-MAX->IN POSIX-1 POSIX-NAME-MAX POSIX-


PATH-MAX

A file name and path name may not exeed name-max & path-max

The application programs that are posted to psix-1 and unix systems should manipulate
files with names in following char ser only.

AtoZ atoz 0to9

The path name of a file is called a hardline.

A file may be refernced by motethan one pathname if a user creates one or more
handlinks to the file using the unix in command.

Eg:/usr/prog/new/n1 for the file /usr/foo/path1 after ln command, the file can be
referenced by either path name.

Ln /usr/foo/path1 /usr/prog/new/r1

Note: -s option is specified in the above command,the /usr/prog/n1 will be a symbolic


link instead of a hard link.

File USE
/etc Stores System administrative files and programs

/etc/passd Stores user Information

/etc/group Stores all group information

/bin Stores all programs likecat,rm,cp etc..

/div Stores all characters and block device files

/usr/include Stores standard header files

/usr/lib Stores standard libraries

/tmp Stores temporary files created by programs

The unix and posix file attributes:

Both unix and posix ./ maintain a set of common attributes for each file in a file
sustem. The attributes and the data they specify are:

Attribute Value meaning

File type Type of file

Acess permission The file access permission for owner, group and others

Hard link count No of hard links of a file

UID The file owner UID

GID The file group id

File size The file size m bytes

Last access time

Last modify time

Inode number

File system id
The attributes are assigned by the kernal to a file system when it is created. Some
of the attributes will stay unchanged for the entire file of the file, where as others may
change as the file is being used, the attributes that are constant for any file are:

·0 File type

·1 File inode number

·2 File system id

·3 Major and minor device number

The other attributes are changed by the following unix command.

UNIX Command System case Attributes changed

Chmod Chmod Changes access permission, last change


time.
Chown Chown
Changes UID, last change time.
Chgrp Chown
Changes GID, last change time.
Touch Utime
Changes last access time, midification time.
Ln Link
Increases hard link count.
Rm unlink
Decreases hard link count. If the hardlink
count is zero, the file will be removed from
Vi,emae file system .

changes file size, last access time, last


modification time.

You might also like