UNIX File Basics
-
Files live on a filesystem
-
ext4 -- The default Linux file system, very like other UNIX filesystems
-
NFS -- The network file system, for sharing files across a net.
-
ISO9960 -- The file system used on most CD-ROMS.
-
VFAT (msdos or win95) -- The file system used by Microsoft
- NTFS (Windows NT) -- Still being developed. Works
read-only for sure.
-
/proc -- Files that describe the state of the Linux kernel
-
Reading tell the user the state
-
Writing sometimes changes the state
-
This is a Linux specific thing, most UNIX's don't have this.
-
The numbers are processes
-
Within each process are cmdline, cwd, exe, mem, status, and others
-
The normal filenames are global trates (loadavg, cpuinfo, etc)
-
Filesystems have metadata
-
Space available, space used, mount point
-
Options like nosuid, noexec, read-only
-
Files have a type
-
Normal file
-
Hard link -- two files with the same name
-
Soft link - like a shortcut in Win95
- Directory
-
Device special files
-
Represent physical devices
-
Have a major number (type of device) and a minor number (instance of
device)
-
The device file can exist without the device being present (maybe this
will change in the future)
-
Files have metadata
-
Name
-
Size
-
ctime, atime
-
Owner, group
-
Permissions
-
Based on a user/group/other scheme.
-
Both files and dircs have a read/write/execute
-
X for dirs means list the directory
-
Don't need 'r' for executables (execuatables you can run but not copy)
-
There is no equivilent to 'system' or 'hidden'.
-
SUID means run as the owner, not as the user typing the command
-
Legal file names
-
Legal is different from reasonable
-
Legal is any char and up to 255 chars long
-
Reasonable is avoid ' ', &, *, ?,; and the control chars.
-
All filenames starting with '.' are not shown ina default directory
listing
-
Filenames like .\t\tpirate can be used to hide ftp sites from the ftp
owner
or his boss.
- The filename ".." means the directory above.