OSY_microproject
OSY_microproject
2. Aims/benefits of Microproject
4. Literature Review
7. Skill Developed
Micro-project Report
Course : Operating System (22516)
Project Title:
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.
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 :
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 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.
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
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.
It assigns all permissions for user, read and execute for group and no permission
for others for file “file1”.
6.0 Actual Resources Used