0% found this document useful (0 votes)
16 views

OSY_microproject

Uploaded by

Sanket Karade
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

OSY_microproject

Uploaded by

Sanket Karade
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

INDEX

Sr. No. Content/Title


1. Rational

2. Aims/benefits of Microproject

3. Course outcomes addressed

4. Literature Review

5. Actual Methodology Followed

6. Actual Resources Used

7. Skill Developed
Micro-project Report
Course : Operating System (22516)
Project Title:

“File and directory manipulation commands”


1.0 Rationale
The rationale behind studying and implementing file and directory manipulation
commands in an operating system project is to understand hoe operating systems interact
with files and directories, which are fundamental to system operations. These commands
allow users and processes to create, modify, delete and navigate the file system efficiently.
Mastery of these commands is essential because file and directory management is integral
to tasks such as data organization, software development, backup management and overall
system administration.

2.0 Aims/benefits of Microproject


 To understand the file and directory manipulation commands.
 To improve skills in using command-line interfaces.
 To understand how operating system organizes, store and manage files and directories.

3.0 Course Outcomes addressed


 Install operating system and configure it.
 Use operating system tools to perform various functions.

4.0 Literature Review


Website : https://askubuntu.com
Book : Operating System Concepts.

5.0 Actual Methodology Followed


 Introduction of the microproject.
 File and directory manipulation commands
Introduction
The operating system (OS) is the backbone of any computer system, managing hardware
resources and providing an interface for users to interact with the machine. One of the most
critical functions of an OS is file and directory management, which involves creating,
organizing, modifying, and deleting files and directories. This project focuses on executing file
and directory manipulation commands using Ubuntu, a popular Linux distribution that offers a
powerful command-line interface.

Ubuntu, built on the Linux kernel, provides users with access to essential file system
operations through the Bash shell, enabling efficient management of files and directories. In this
project, commands such as ls, cd, mkdir, touch, cp, mv, and rm are explored in detail, allowing
users to perform key tasks related to file navigation, creation, copying, moving, and deletion.
These commands form the foundation of system administration, development environments, and
everyday data management.

By executing these commands on Ubuntu, the project aims to enhance command-line


proficiency and deepen understanding of how Linux-based systems handle file and directory
management. This practical experience will be invaluable for working in real-world
environments, where Linux is widely used for both personal and professional tasks.
File and Directory Manipulation Commands

File and directory manipulation commands are fundamental for managing files and
directories efficiently through the command-line interface. Following is the detailed explanation
of each command and how it functions.

1. ls command :
 Description : The ls command is used to list the contents of a directory, including files
and subdirectories. By default, it lists the contents of the current working directory.
 Syntax : ls [options] [directory]
 Command options :
1. -a : Shows all files, including hidden files.
2. -l : Displays detailed information in long format.
3. -h : Shows file sizes in human-readable format (used with -l as -lh).
4. -t : Sorts files by modification time.
5. -R : Lists files and directories recursively.
 Example : ls -R
Lists all files, including hidden files (files that start with a dot .).
 Output :
2. rm command :
 Description : The rm command is used to remove/delete files and directories. By
default, rm only removes files, but with additional options, it can delete directories and
their contents as well.
 Syntax : rm [options] [file/directory]
 Command options :
1. -i : Interactive mode, prompts before deleting each file.
2. -r : Recursively deletes directories and their contents.
 Example : rm -i file.txt

3. mv command :
 Description : The mv command is used to move or rename files and directories. It is a
versatile command, often used for reorganizing files and directories by relocating them to
new locations or renaming them.
 Syntax : mv [options] source destination
 Command options :
1. -i : Interactive mode, prompts before overwriting files.
2. -f : Force move, skips prompts and overwrites files without confirmation.
3. -v: Verbose mode, displays the files or directories being moved or renamed.
 Example : mv -v file.txt /home/user/Documents/
4. cp command :

 Description : The cp command is used to copy files and directories from one location to
another. cp creates a copy of the file or directory, leaving the original intact.
 Syntax : cp [options] source destination
 Command options :
1. -i : Interactive mode, prompts before overwriting files.
2. -f : Force move, overwrites files without confirmation.
3. -v: Verbose mode, shows the copying process in detail.
4. -r: Recursive mode, used for copying directories and their contents.
 Example : cp file.txt newfile.txt
Copies file.txt and renames the copy to newfile.txt

5. touch command :

 Description : The touch command is primarily used to create an empty file.


 Syntax : touch filename
 Example : touch file.txt
Creates an empty file in current directory.

6. cat command :
 Description : The cat command stands for "concatenate" and is used to view the
contents of a file, create a new file, and combine multiple files into one.
 Syntax : cat [file_name(s)]
 Example : cat > newfile.txt (to create file)
7. join command :
 Description : The join command is used to combine lines from two files based on a
common field. It is useful when you have two text files that have a common key or field,
and you want to merge their content based on that field.
 Syntax : join [options] file1 file2
 Command options :
1. -t char: Specifies a custom delimiter to use instead of space.
 Examle : join -t "," file1 file2

8. mkdir command :
 Description : The mkdir command is used to create new directories (folders) within the
file system. It stands for "make directory" and is a simple, yet powerful command for
managing directory structures.
 Syntax : mkdir [options] directory_name
 Command options :
1. -v: Displays a message for each directory that is created (verbose mode).
2. --help: Displays help information about the mkdir command.
3. –version: Shows the version of the mkdir command being used.
 Example : mkdir –v myfolder

9. cd command :
 Description : The cd command is used to change the current working directory. It
stands for "change directory" and is used command for navigating the file system.
 Syntax : cd [directory_name]
 Example : cd /home/user/Documents (Changes current directory to given directory)

cd ~ (Changes the current directory to the home directory of the user.)

cd . . (Moves up to the parent directory of the current directory)

cd / (Changes the current directory to the root directory of the file system)
10. rmdir command :
 Description : The rmdir command is used to remove empty directories. Unlike the rm
command, which can delete both files and directories, rmdir specifically targets
directories that do not contain any files or subdirectories.
 Syntax : rmdir [options] directory_name
 Command options :
1. -v: Displays a message for each directory being removed (verbose mode).
2. --help: Displays help information about the rmdir command.
3. –version: Shows the version of the rmdir command being used.
 Example : rmdir myfolder
The directory myfolder is deleted if it contains no files or subdirectories.

11. pwd command :


 Description : The pwd command in Linux stands for Print Working Directory. It is
used to display the current working directory (the directory you are currently in) within
the file system. It is useful for confirming your location in the directory hierarchy.
 Syntax : pwd
 Example : pwd
 Output :
12. chmod command :
 Description : The chmod command in Linux stands for change mode and is used to
change the file permissions of a file or directory. File permissions determine who can
read, write, or execute a file for all the three categories users.
 Types of users :

 To identify the permissions of a file or directory use ls –l command


 Syntax : ls – l

 ‘chmod’ can be operated in two ways :


i. Symbolic or alphabetical notation.
ii. Octal or absolute notation.
i. Symbolic or alphabetical notation :

 It uses symbols for assigning permissions to the users. There are following operations of
three categories :
1. + : Assigns the permission
2. - : Removes the permission
3. = : Assigns absolute permissions

 Syntax : chmod <user_type> <operation> <permission> <file_name>

 Example : chmod ug + rwx file1

Assigns read, write and execute permissions for user/owner and group for
“file1”.
ii. Octal or absolute notation :

 This method uses a number to specify each set of permissions for the file. It assigns
permissions in three digits. (Digits range is 0 to 7)
 First digit assigns permission for owner, second digit for group and third for others.

 Syntax : chmod <three digit octal number> <file_name>

 Example : chmod 750 file1

It assigns all permissions for user, read and execute for group and no permission
for others for file “file1”.
6.0 Actual Resources Used

Sr. No. Name of required resources Specification Quantity

1. Hardware (PC/Laptop) Core i5, 4GB RAM 1


2. Operating System Ubuntu 1

7.0 Skills Developed

 Gaining an understanding of Linux file systems, directory structure.


 Understood the file and directory manipulation commands.
 Understood how operating system organizes, store and manage files and directories.

You might also like