Essay: Creating UNIX File System
Essay: Creating UNIX File System
1. Set up a directory/file system for a new accountant to house the following items:
* The program files for the accounting system
* Data files for accounts receivable, accounts payable and general ledger
* Business reports
* Spreadsheet files
* Word processed files
Create a text or word processed written document that explains the design.
Also, provide a diagram of the directory/file system for visual understanding.
The Linux operating system follows FileSystem Hierarchy Standard (FHS), the standard for all UNIX and Linux based operating system. It defines specific files and subdirectories which are used for system and user purposes. The user directory has the path of /home/user (where user is the user name). All applications or files belonging to a particular user are stored in this folder. All additional files directories are stored in /home/user path. All directories in the folder are created by using d.
For setting up a user and its directory we use the useradd command
useradd -d /home/accountant -g group1 accountant
This sets up a new user ‘accountant’, sets his home directory to /home/accountant, his group to group1 and password to ‘accountant’. Now we can make new directories in the user home directory for different usage
mkdir prgfiles ( For program files)
mkdir dbfiles ( Database files)
mkdir breports ( For Business Report files)
mkdir ssheets ( For spreadsheets)
mkdir wpfiles ( For Word Processing Files) (Smith).
Figure 1. Directory Structure for the user ‘accountant’.
2. Set up file security so that only the accountant and the company owners can access the file system previously created. Create a written document with step-by-step instructions for the employee that describes how to create additional subdirectories they may need and how to configure the appropriate security. Include in your document the general steps for removing an unused directory.
The setup the security of the file system, the company owners need to be added to the same group as the user ‘accountant’ using the command usermod. Suppose company owners are already part of the group ‘owner’ and access the system using user name ‘cowner’
usermod -G owner,group1 cowner
This would add the owner to the same group as ‘accountant’ which would allow them to access files from his folders as well.
The user may create any subdirectory by using the mkdir command. For this following procedure should be followed.
– Change the directory to where you want the subdirectory to be created using the cd command. For example, to change directory to prgfiles, type cd /home/accountant/prgfiles.
– Use the mkdir command with name to make a new directory. For example to create a new directory name linux, type mkdir linux.
– It should be noted that the users can only create directories in their own home directory or where they have permission to write.
– The permission to any file or folder in your directory can be modified using chmod command
– To change the permission of file for owner, group, world or all use the format : chmod (permission code)(+ or -)(permission type)
– For permission code use u for owner, g for group, w for world and a for all.
– Use + if you want to give permission, use – if you want to remove permission.
– For permission type use r for read, w for write and x for execution.
To remove an unused directory used rmdir command
For example, type rmdir x to remove the directory with the directory name x (Smith).
3. Create a step-by-step set of instructions to explain how to accomplish deleting subdirectories and their contents and copying files from one area to another.
Subdirectories and their contents can be removed by using the rm command. For remove the contents of a subdirectory x type
rm -r *