CH9: Working with file Flashcards
all files are case sensitive (T/F)
True
winter.txt !== Winter.txt
everything is a file (T/F)
True
A directory is a special kind of file, but it is still a (case sensitive!) file.
Define DIrectory
A directory is a special kind of file, but it is still a (case sensitive!) file.
file
The file utility determines the file type. Linux does not use extensions to determine the file type
~$ file pic33.png
pic33.png: PNG image data, 3840 x 1200, 8-bit/color RGBA, non-interlaced
how linux recognize file types ?
The file command uses a magic file that contains patterns to recognise file types. The magic file is located in /usr/share/file/magic
file -s
for special files
like:
/ prod
/ dev
touch
create an empty file
touch -t
set some properties while creating empty files
rm
remove forever
Linux have a trash bin to recover removed files (T/F)
the command line in general does not have a waste bin or trash can to recover files
rm -i
o prevent yourself from accidentally removing a file
rm -rf
O will not remove none empty directories
O The rm -rf statement is famous because it will erase anything
You can literally erase your entire file system by accident.
cp
To copy a file, use cp with a source and a target argument.
how to copy file
cp file42 file42.copy
Copy file to another directory
paul@debian7:~$ mkdir dir42 paul@debian7:~$ cp SinkoDeMayo dir42