The File System

This week, we learned a little more about the UNIX file system. The file system is similar to that of any other major operating system. There are some exceptions however. For instance, instead of having multiple drives (ie. C:\, D:\), everything is located under the root directory (/) as seen below. All other devices (disk drive, etc.) are located under /dev.

Unix File System

One very important command to keep in mind is chmod or change mode. This command allows you to change the permissions of files and directories. I decided to do a little more exploring of the command. While searching, I came across a list of common chmod combinations (below) here.

Command

Purpose

chmod 400 file To protect a file against accidental overwriting.
chmod 500 directory To protect yourself from accidentally removing, renaming or moving files from this directory.
chmod 600 file A private file only changeable by the user who entered this command.
chmod 644 file A publicly readable file that can only be changed by the issuing user.
chmod 660 file Users belonging to your group can change this files, others don’t have any access to it at all.
chmod 700 file Protects a file against any access from other users, while the issuing user still has full access.
chmod 755 directory For files that should be readable and executable by others, but only changeable by the issuing user.
chmod 775 file Standard file sharing mode for a group.
chmod 777 file Everybody can do everything to this file.
chmod +x file Enables only the file execution.
, , , ,

One Comment

  • sloafe says:

    In a linux filesystem there are no c: and d: drives per say. However the listings in /dev/sd* are the representations of your physical drives and partitions. These are not directories. You do not access your primary drive by navigating to /dev/sda1. Instead, these devices are mounted at different points in the system. Your / partition is the main file system. If you have a separate /home partition, it is mounted on a directory in the root partition called “home”. All of your partition mount points are described in you /etc/fstab file. You can add additional entries so that, say, you windows partition is automatically mounted on /mnt/windows.

    sloafe

Leave a Reply

You must be logged in to post a comment.