2. INTRODUCTION
Linux is open ware/opensource operating system with free
license to use.
An operating system is a software that establish
communication between computer hardware and software.
Developed by Linus Torvalds in 1991
BASICS OF LINUX OPERATING SYSTEM 2
31/01/2023
4. BASICS OF LINUX OPERATING SYSTEM 4
1. pwd (present working directory) : Displays present
working directory.
2. cd (change directory) : Change the current
directory
• cd ./ : presents this directory
• cd ../ : move to the parent directory of current
directory
• cd - : change to previous directory
3. ls (list command) : Show the full list or content of
the directory
• ls -l : Display the content in long listing format.
• ls -a : Displays all the hidden files and directories
in the current directory.
• ls -t : Sort the files by modification time, showing
the last edited file first.
• ls -r : Sort the file names in the reverse order.
LINUX DIRECTORY
COMMANDS
5. BASICS OF LINUX OPERATING SYSTEM 5
7. touch : Create a new file(s)
8. rm (remove): Removes a file(s)
9. cp (copy) : Copy a file(s)
10. mv (move) : move a group of files to different directory and also to rename a file or folder
11. cat (concatenate) : used to create, view and concatenate files
• cat [filename] : view the file content
• cat > [file] : create a new file
• cat [file1] > [file2] : copy the content of one file to other
• cat [file1] >>[file2] :append the content of one file to the end of other file
• cat –n [filename] : view the content of the file with line number
• tac : display the content in reverse order
• head : Displays the top 10 lines of the file
• tail : Displays the last 10 lines of the file
4. mkdir (make directory) : create new directory(s)
• mkdir -p [directories] : create directories in the parent directory.
5. rmdir (Remove directory) : Removes the directory
6. rm –rf [directory] : Remove the directory with all the files and directories in it
LINUX
FILE
COMMANDS
6. BASICS OF LINUX OPERATING SYSTEM 6
12. chmod (change mode) : change the access mode of
the file
13. find : To find files and directories
• find -name pattern : find files and directories that
match the pattern
• find -iname pattern : similar to –name but ignores the
case
14. diff : To compare files/differentiate between file
contents
• sdiff : comparing the files side by side
15. vim : To edit files vim editor is used
16. grep : The grep filter searches a file for a particular
characters, and displays all lines that contain that pattern.
• grep -c : prints the line count that match the pattern
• grep –i :ignore, case for matching
• grep -l :displays list of filenames only
• grep –n :displays matched line and their line number
• grep -v : prints all the lines that do not match the
pattern
• grep -w : match whole word
7. PRESENTATION TITLE 7
17. wc (word count) : used for counting purpose
• wc -l : print the number of lines in a file
• wc -c : print the number of words in a file
18. sort : sort text in a file
19. clear : clear the terminal
20. exit : exit the terminal
21. history : displays history of all the commands used
22. df : Displays the amount of disk space available on the file system containing
each file name argument
23. tee -a : Read the standard input and writes it to both the standard output and one
or more files
8. AWK IS A TEXT PROCESSING COMMAND
DIVIDE EACH WORD INTO FIELD{$}
$1 FIRST WORD……LAST WORD{$NF}
AWK –F,(SEPARATED BY WHOM)=HERE BY ,
PRESENTATION TITLE 8