You are on page 1of 8

INT 249 CA2

Q1)
a) File and directory Organization
Ans) We ca create a file or Directory by using the following commands.

 For Directory Creation the command is


mkdir <name of the directory>

 Also, we can create multiple directories at a single Time


mkdir <name1> <name2> <name3>
by giving spaces between we can create

 To move into a particular directory the command is


cd <directory name>

 From one directory to another we have to came back to home by entering “..” this
we can come back to home now cd <name>
In order to check the directories created or not we use the command “ls-l”

 Now to create a file we use the command


touch <file name>

 for multiple file creation we use


touch <name1> <name2> <name3>
to open files, we use nano <file name> and we can edit the text file.
To verify whether file are created or not we use the same “ls –l” command.

b) File System Maintenance

1. Check free space available.


we can check the space by gparted in the the menu bar
2. Calculate directory size.
3. Remove vs empty files.
check the empty files in the folders or directories and remove or delete them
using the command rm <filename>

So we can remove the these empty files as its storage is zero and there is no
data in it

4. Count the number of files in a directory.


5. Get the bigger files in a filesystem.
6. List the largest files in a directory.
7. Calculate the size of only certain files
C)Security Measures
For the security of file we can create or set some passwords to the particular
file

Use the cd command and ls command to navigate to the directory containing the
file you want to password-protect.

Once inside the directory, run the following command to encrypt your file:
“gpg -c filename”.
We can also change the permissions for the files by using the command
chmod [options] [mode] [File_name]

 Read, write and execute permissions to the file owner:

chmod u+rwx [file_name]

 Remove write permission for the group and others:

chmod go-w [file_name]

 Read and write for Owner, and Read-only for the group and other:

chmod u+rw,go+r [file_name]

Value Permission

4 Read Permission

2 Write Permission

1 Execute Permission

 chmod 777 [file_name]

this will give permissions for read, write and execute for all three user , owner, group

If we give all permissions it will change its colour .

You might also like