Working with Linux files Flashcards
(45 cards)
Briefly explain Linux file philosophy
In Linux everything is a file, if it is not a file then it is a process.
Explain three basic file types in Linux
- Ordinary files
Contains data, text or program instructions - Directories
Store both ordinary and special files - Special files
Provide access to hardware such as disk drives
Enables you to access a single file using different file names.
Color that represent directory
Blue
Color that represent compressed archives files
Red
Color that represent text files
White
Color that represent images
Pink
Color that represent links
Cyan
Color that represent devices
Yellow
Color that represent executables
Green
Color that represent broken links
Flashing red
What is the important of using colors to represent file types?
It allows the user to see the file type without using any options to ls
The standard scheme for file type colors
/etc/DIR_COLORS:
What command do we use to find out more about data we are dealing with
file command
i. e #file Tama.txt
ls -l First column
represents file type and permission given on a file
ls -l Second column
Represents number of memory blocks taken by the file or dir
ls -l Third column
Represents owner of the file. The one who created it
ls -l Fourth column
Represents group of the owner
ls -l Fifth column
Represents file size in bytes
ls -l Sixth column
Represents date and time when the file was created or modified last time.
ls -l Seventh column
Represents file or directory name
Identify these character as they are used to indicate file type in ls -l list: - b c d l p s
- : Regular file eg ASCII txt file, bins, exe or hard links
b: Block special file. Block input/output device file eg physical hdd
c : Character special file. Raw input/output device file eg physical hdd
d : Directory containing other files
l : Symbolic link file. Links on regular file
p : Named pipe. Mechanism for IPC
s : Socket used for IPC
. : Invisible file
How do list invisible files in Linux?
By including -a option to ls command
What are the three Linux commands that allows you to view the contents of a file?
- cat
- More
- less
How do you display contents of a file with line numbers?
By adding -b option to cat, more or less