You are on page 1of 6

Mini Project Assignment

CSF204-Operating System

Submitted By
Rollno: 220102775
SapID: 1000019189
Name: Moli Garg
Section: B “P2”

Submitted to

Dr. Prabhjot Kaur


Assistant Professor
School of Computing
Command Line in Linux
Linux is a popular operating system that is based on the Unix operating system. It has many
distributions which have different interfaces for installing software, different user interfaces, and
so on. One ting all of the ‘distros’ have in common is that they all have a command line
interface, or terminal. In fact, sometimes there is no user interface except the terminal itself. A
Linux server running a web application on AWS, for example, may only contain the software
required to run the application, and no GUI ‘window’ system at all. It is crucial to learn the
Linux command line if you are going to be a productive Linux user and/or administer a Linux
server.
In a video that plays in a split-screen with the work area, the instructor will walk you through
these steps:
1) Display the home directory from a terminal.
2) List files and directories using ls.
3) Use the cd command to change directories.
4) Use touch, copy, mkdir, and rm to create and remove files and directories.
5) Search for files using find, search for patterns using grep.

1) Ls:-
Ls is a Linux shell command that lists directory contents of files and directories. It provides
valuable information about files, directories, and their attributes.
Code:-
ls
Output:-

2) Mkdir:-
The mkdir command in Linux/Unix is a command-line utility that allows users to create new
directories. You can also set permissions, create multiple directories at once, and much more.
Code:-
mkdir <directory_name>
Output:-

3) Rm:-
rm command in Linux is used to remove files from directories.
Code:-
Rm -rf <directory_name>
Output:-

4) Cat:-
Cat command in Linux can be used to display the content of a file, copy content from one file to
another, and concatenate the contents of multiple files.
Code:-
Cat <file_name>
Output:-

5) Cp:-
Cp command in Linux is used to copy file data from one file to another.
Code:-
Cp -f <filename1> <filename2>
Output:-

6) Mv:-
Mv command in Linux can be used to change a directory or a file’s name.
Code:-
Mv <file/directory_name1> <file/directory_name2>
Output:-

7) Touch:-
Touch command in Linux can be used to create an empty file in the directory. Touch create
empty files in the directory or a folder.
Code:-
Touch <file_name>
Output:-

8) Find:-
Find command in Linux is used to search for a file or directory in the system.
Code:-
Find . -name <file_name>
Output:-

9) Grep:-
Grep command in Linux is used to search for particular alphabets or letters in the certain file
using cat command.
Code:-
Cat <file_name> | grep <item_for_search>
Output:-

10)chmod:-
Chmod command in linus can be used to modify the permissions and access mode of files and
directories.
Code:-
Chmod a+<permission> <file_name>
Output:-
Conclusion:-
In this course, we learned using Linux commands to navigate Linux directories, search for files,
search for patterns, create files and directories, and remove files and directories.

Certificate:-

You might also like