Osy Final Micro
Osy Final Micro
Osy Final Micro
“Linux commands”
Microproject
OPERATING SYSTEM (22516)
Sr.no Student name Roll no.
1. Pruthviraj 32
Shetkar
2 Omkar Desai 29
Submmited To :-
Prof: Vijaya Patil Mam
ANNEXURE-1
PARTICIPATE DETAIL :
Student Name Roll Enrollment
No. No.
1. Pruthviraj Shetkar 32 2001450041
2. Omkar Desai 29 2001450038
1.1 Introduction:-
The Linux command is a utility of the Linux operating system. All basic and advanced tasks can
be done by executing commands. The commands are executed on the Linux terminal. The
terminal is a command-line interface to interact with the system, which is similar to the
command prompt in the Windows OS.
At the heart of every modern Mac and Linux computer is the “terminal.” The terminal
evolved from the text-based computer terminals of the 1960s and ’70s, which
themselves replaced punch cards as the main way to interact with a computer. It’s also
known as the command shell,Mac, Linux and Windows computers today are mainly
controlled through user-friendly feature-rich graphical user interfaces (GUIs), with
menus, scroll bars and drag-and-drop interfaces. But all of the basic stuff can still be
accomplished by typing text commands into the terminal or command prompt.
Linux Commands
1. pwd Command
Syntax:
• pwd
Output:
2. mkdir Command
Syntax:
• mkdir <directory name>
Output:
3. rmdir Command
Syntax:
• rmdir <directory name>
Output:
4. ls Command
Syntax:
• ls
Output:
5. cd Command
Syntax:
• cd <directory name>
Output:
The cat command is a multi-purpose utility in the Linux system. It can be used to create a file,
display content of the file, copy the content of one file to another file, and more.
Syntax:
• cat [OPTION]... [FILE]..
Press "CTRL+ D" keys to save the file. To display the content of the file, execute it as follows:
• cat <file name>
Output:
7. rm Command
Syntax:
rm <file name>
Output:
8. cp Command
Syntax:
Output:
9. mv Command
The mv command is used to move a file or a directory form one location to another location.
Syntax:
• mv <file name> <directory path>
Output:
The rename command is used to rename files. It is useful for renaming a large group of files.
Syntax:
• rename 's/old-name/new-name/' files
For example, to convert all the text files into pdf files, execute the below command:
• rename 's/\.txt$/\.pdf/' *.txt
Output:
The head command is used to display the content of a file. It displays the first 10 lines of a file.
Syntax:
• head <file name>
Output:
12. Tail Command
The tail command is similar to the head command. The difference between both commands is
that it displays the last ten lines of the file content. It is useful for reading the error message.
Syntax:
• tail <file name>
Output:
The more command is quite similar to the cat command, as it is used to display the file content
in the same way that the cat command does. The only difference between both commands is
that, in case of larger files, the more command displays screenful output at a time.
In more command, the following keys are used to scroll the page:
Syntax:
• more <file name>
Output:
The less command is similar to the more command. It also includes some extra features such as
'adjustment in width and height of the terminal.' Comparatively, the more command cuts the
output in the width of the terminal.
Syntax:
• less <file name>
Output:
Syntax:
• useradd username
Output:
Syntax:
• passwd <username>
Output:
The cut command is used to select a specific column of a file. The '-d' option is used as a
delimiter, and it can be a space (' '), a slash (/), a hyphen (-), or anything else. And, the '-f' option
is used to specify a column number.
Syntax:
• cut -d(delimiter) -f(columnNumber) <fileName>
Output:
This command is used to compare two files or streams. By default, it displays three columns, first
displays non-matching items of the first file, second indicates the non-matching item of the
second file, and the third column displays the matching items of both files.
Syntax:
• comm <file1> <file2>
Output:
The tee command is quite similar to the cat command. The only difference between both filters
is that it puts standard input on standard output and also write them into a file.
Syntax:
• cat <fileName> | tee <newFile> | cat or tac |.....
Output:
20. tr Command
The tr command is used to translate the file content like from lower case to upper case.
Syntax:
• command | tr <'old'> <'new'>
Output:
The uniq command is used to form a sorted list in which every word will occur only once.
Syntax:
• command <fileName> | uniq
Output:
22. wc Command
Syntax:
• wc <file name>
Output: