EDUCBA

EDUCBA

MENUMENU
  • Explore
    • Lifetime Membership
    • All in One Bundles
    • Fresh Entries
    • Finance
    • Data Science
    • Programming and Dev
    • Excel
    • Marketing
    • HR
    • PDP
    • VFX and Design
    • Project Management
    • Exam Prep
    • All Courses
  • Blog
  • Enterprise
  • Free Courses
  • Log in
  • Sign up
Home Software Development Software Development Tutorials Unix Tutorial Unix File System

Unix File System

Aanchal Singh
Article byAanchal Singh
Priya Pedamkar
Reviewed byPriya Pedamkar

Updated May 31, 2023

Unix File System

Introduction to Unix File System

Unix File System can be defined as a framework that organizes and stores a huge volume of data that can be handled with ease. It involves elements like file which is a collection of related data that can be viewed logically, appears as a stream of bytes, with attributes containing information in relation to the concerned file. The file system consists of two main components, i.e, files and directories. The entire system follows a hierarchy in which directories act as special files thcontainingultiple files, with the highest-level directory in the enerarchical structure being termed as root whmbolically denoted by ‘/’. There can be many subdirectories under this directory.

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

The Unix Filesystem usually has the below directories present in the file system.

  • bin: It is a short form for binary files. This directory stores the commonly used executable commands.
  • mnt: This contains information regarding the mounted devices.
  • root: This is the root user’s home directory.
  • tmp: This is a storage for temporary files. Since they are temporary, the filesystem periodically removes them.
  • usr: It contains a set of executable commands
  • home: It has a collection of directories and files.
  • proc: It contains files that are related to system processes.

What is Unix?

Unix is an operating system that has been applied to the family of multitasking, multiuser computer operating system. It was derived from the AT&T UNIX operating system and was developed in the 1970s at the Bell Labs research center. It was first programmed in assembly language and again reprogrammed in C. It’s stable and provides a graphical user interface which helps in providing an easy to use environment. Unix provides users with different program development tools, electronic communication facilities, and many development tools. With these, it also provides multiple UNIX shells where one interprets your commands, and those are passed to the operating system. It also has a kernel that mediates between the shell and the hardware. Kernels are relatively small and efficient. Unix also offers a dedicated file system that enables the execution of various functions. Let us have a look at the file system.

Types of Unix File Systems

The Unix File System consists of different types of files. Let us have a look at these.

1. Ordinary Files

These files store information of the users, which can be text or images. It is usually located under a directory and contains no other files.

2. Directories

Directories help in organizing the files which are present. The directories can contain ordinary, special, or other directories. All these directories are the descendants of the root directory.

3. Special Files

The special files represent physical devices like a printer, tape driver, or terminal. Unix considers any device to be a file. The terminal is considered a file and functions as a standard input file, used for reading input. This terminal is also the standard output file, the command’s output.

4. Pipes

To link commands, Unix provides pipes. The pipe is a temporary file. It also retains data from one command until another command reads it. The output of one command serves as the input to the next command.

File Descriptor and Inode

There is clear segregation between the file’s contents and the information present in the file. All files consist of a sequence of characters except for the device and special files. The required information in the filesystem to handle the files is included in an inode data structure. The inode identifies a file and requires certain attributes to manage kernel and filesystem functions. The attributes are file type, device id, user id of file owner, access rights and file mode, etc.

Additional File Attributes in Unix File System

A file can have some additional attributes, as below.

  • Permission modes: It tells the permissions assigned to a file for the owner.
  • Owner: This is the owner of the file.
  • Group: This specifies the groups associated with that file.
  • File Name: It is the name associated with the file.
  • Modification date: it was the date when the file was last modified.
  • Size: The size of a file in bytes is specified.
  • Number of links: The files which relate to a particular file.

File and Directory Commands in Unix File System

Unix provides many commands that assist in working with files. Here are a few of these commands listed below.

1. ls: It lists all files in a particular directory.

It has a few variations below.

  • ls dir: Shows the contents present in a directory.
  • ls a: It shows all files, including the hidden files.
  • ls -al: It gives a detailed listing of all file contents.

2. Less: It displays less number of lines rather than the complete file.

3. Head: It displays the file’s first few lines or n lines.

4. Tail: Displays the file’s last few lines or n lines.

5. Cat: It displays the contents of the entire file without the pagination of the file.

6. cp: It copies the contents of one file to another. It overwrites the contents of the file if not mentioned otherwise.

7. mv: It moves the specified files to the specified destination.

8. rm: Removes or deletes the specified files.

Conclusion

Unix is an operating system that handles files in an organized way. With all the commands and functions, managing files is very easy. It also has permissions that limit access to the files. Only authorized people can access the files and perform different operations. It also has different kinds of files segregated, which makes it easier to use. Therefore, Unix’s file system earns its reputation as one of the most user-friendly file systems.

Recommended Article

We hope that this EDUCBA information on the “Unix File System” was beneficial to you. You can view EDUCBA’s recommended articles for more information.

  1. Unix Architecture
  2. Uses of Unix
  3. Functions in Unix
  4. Unix Operators
ADVERTISEMENT
All in One Excel VBA Bundle
500+ Hours of HD Videos
15 Learning Paths
120+ Courses
Verifiable Certificate of Completion
Lifetime Access
ADVERTISEMENT
Financial Analyst Masters Training Program
2000+ Hours of HD Videos
43 Learning Paths
550+ Courses
Verifiable Certificate of Completion
Lifetime Access
ADVERTISEMENT
All in One Data Science Bundle
2000+ Hour of HD Videos
80 Learning Paths
400+ Courses
Verifiable Certificate of Completion
Lifetime Access
ADVERTISEMENT
All in One Software Development Bundle
5000+ Hours of HD Videos
149 Learning Paths
1050+ Courses
Verifiable Certificate of Completion
Lifetime Access
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2023 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more

🚀 Extended Cyber Monday Price Drop! All in One Universal Bundle (3700+ Courses) @ 🎁 90% OFF - Ends in ENROLL NOW