Labcommands
Labcommands
1. man: Displays the manual pages of a command. It provides information about command usage, options,
and examples.
2. pwd: Prints the current working directory. It shows the path of the directory you're currently in.
3. cd: Changes the current directory. It allows navigation between different directories.
4. ls: Lists directory contents. It shows the files and directories within the current directory.
5. clear: Clears the terminal screen. It removes all previous commands and output from the terminal
window.
6. mkdir: Creates a new directory. It is used to make a new folder or directory.
7. rmdir: Removes an empty directory. It deletes a directory if it's empty.
For Vi Editor:
12. -i, --ignore-case: Ignores case distinctions in both the pattern and input files. This allows searching
without differentiating between uppercase and lowercase letters.
13. -n, --line-number: Prefixes each line of output with the 1-based line number within its input file.
14. -C NUM, --context=NUM: Prints NUM lines of leading and trailing context surrounding each match. This
shows additional context around the matched lines.
15. -r, --recursive: Recursively searches subdirectories. This option is typically used when searching within
directories for specific patterns.
16. -l, --files-with-matches: Suppresses normal output and instead prints the names of files containing
matches.
17. -v, --invert-match: Inverts the sense of matching, selecting non-matching lines.
18. -w, --word-regexp: Searches for the expression as a whole word. This ensures that matches are not part
of larger words.
19. -E, --extended-regexp: Interprets the pattern as an extended regular expression (ERE). This provides
more powerful pattern matching capabilities.
20. Command alias:
alias : Lists or sets aliases.
alias -p : Prints all defined aliases.
alias [name]='[value]' : Defines a new alias.
21. Command sort:
sort : Sorts lines of text files.
sort -f : Performs a case-insensitive sort.
sort -n : Sorts numerically.
sort -r : Sorts in reverse order.
sort -u : Removes duplicate lines.
sort -t ',' : Specifies the delimiter in CSV files.
sort -k : Sorts based on a specific column.