linux files - ghdrako/doc_snipets GitHub Wiki

File types

  • Regular file: This is the most common file type, containing text or binary data. -rw-r--r-- 1 dave dave 210 Jan 04 09:30 main.c
  • Directory: Directories are special files that are used to organize other files and directories. drwxr-xr-x 5 root root 4096 Jan 04 09:21 /etc
  • Block special: This special file type provides buffered access to hardware devices, which makes them particularly useful for devices like hard disks where data is accessed in large, fixed-size blocks brw-rw---- 1 root disk 8, 2 Jan 19 11:00 sda2
  • Character special: Similar to block files, character files provide unbuffered, raw access to hardware devices, but they are designed for devices where data is not block-oriented, like keyboards or mice.for example, /dev/urandom, /dev/null, or /dev/zero). A character device like a terminal might appear in a long listing as: crw-rw-rw- 1 root tty 5, 1 Jan 19 22:00 /dev/tty1