File System Organization-2
File System Organization-2
Types of Files
Types of Files in Linux:
1) Normal or Ordinary files:These files contain data. It can be either text files (like abc.txt) OR binary
files (like images, videos etc).
3) Device Files:In Linux, every device is represented as a file. By using this file we can communicate with
that device.Note: short-cut commands to open and close terminal
Creating Files
• Touch Command (Create empty files)-for creating normal or ordinary files.
Eg – touch sample1
➔ When creating multiple files – touch sample1 sample2 sample3
➔ When displaying a particular file –cat filename
➔ When listing (whether the file is present or not)- ls –l filename
• Cat > sample
Write the text here
And then press CTRL d
• Vi editor
Vi filename
4) $cd → If we are not passing any argument, then changes to user home directory.
2. tac Command:
It will display file content in reverse order of lines. i.e first line will become last line and last line will
become first line.This is vertical reversal.
CAT
RAT
MAT
MAT
RAT
CAT
rev means reverse.Here each line content will be reversed.It is horizontal reversal.
CAT
RAT
MAT
TAC
TAR
TAM
Note:
cat command will display total file content at a time. It is best suitable for small files. If the
file contains huge lines then it is not recommended to use cat command. We should go for