OS Practical 2_removed
OS Practical 2_removed
Practical : 2
1 ) find Command
• find command searches for files in a directory hierarchy.
• find -name : Find files with names matching the given pattern (wildcards allowed).
• find -newer : Find files modified more recently than the specified file.
• find -empty : Find empty files or directories.
• find -size +N/-N : Find files larger than (+N) or smaller than (-N) bytes.
1
3140702 (Operating System) 230760107011
2 ) uniq Command
• uniq reports or filters out repeated lines in a file.
• It can remove duplicates, show a count of occurrences, show only repeated lines, ignore certain
characters and compare on specific fields.
2
3140702 (Operating System) 230760107011
3 ) tr Command
• The tr command in UNIX is a command line utility for translating or deleting characters.
• It supports a range of transformations including uppercase to lowercase, squeezing repeating
characters, deleting specific characters and basic find and replace.
• It can be used with UNIX pipes to support more complex translation.
4 ) pipe Command
• It redirects the command STDOUT or standard output into the given next command STDIN or
standard input.
• In short, the output of each process directly as input to the next one like a pipeline.
• The symbol “|” denotes a pipe.
3
3140702 (Operating System) 230760107011
5 ) grep Command
• The grep filter searches a file for a particular pattern of characters, and displays all lines that
contain that pattern.
• The pattern that is searched in the file is referred to as the regular expression.
• grep stands for globally search for regular expression and print out.
6) History Command
The history command is a valuable utility that allows users to view and search through their command
history. In this comprehensive guide, enabling users to streamline their workflow and save time by
efficiently accessing and reusing commands.
• history n : This will show the last 5 commands executed in the terminal.
4
3140702 (Operating System) 230760107011
7) Sort Command
The sort command in Linux is used to arrange the lines in a file in a specific order, either alphabetically,
numerically, or based on other criteria.
8 ) write Command
The write utility allows a user to communicate with other users, by copying lines from one user’s terminal
to others. When you run the write command, the user you are writing to gets a message
9 ) wall Command