Home » Linux » The Linux file system and management commands

The Linux file system and management commands

(1) rootfs (Root, FileSystem)

/boot: systems boot related files, such as kernel, initrd, grub (bootloader),

/dev: device file

block device file: random access, data block

character file: linear access, in bytes

each device file has one master device number and one slave device number

/etc: configuration file

/home: home directory

each user's home directory defaults to /home, which is the same name as the user name

/root: administrator home directory

/lib: library file

static library (.A)

dynamic library (.So shared object)


/media: mount point directory is primarily for mobile devices such as: U disk


/mnt: mount directory is primarily an additional temporary file system, such as disk

/opt: optional directory

/proc: pseudo file system, kernel mapping file, the directory is empty before the system starts.

/sys: pseudo file system, property mapping file associated with hardware device, which is empty

before the system is started

/tmp: temporary file

/var: variable file

/bin: executable file, user command

/sbin: executable file, administrator commands

/usr: global shared read-only file

/usr/local: third party software installation directory

(two) naming rule

1. file name length not more than 255 characters

2. cannot use / make the file name

3. is strictly case insensitive

(three) common command for file management

touch: the timestamp of the modified file can also be used to create a blank file (change, file, timestamps)

-c, --no-create: do not create a file (do, not, create, any, files)


of (use [[CC]YY]MMDDhhmm[.ss] instead current time)

stat: displays, modifies the

file (display or file system status)

nano: edit files (Nano's, ANOther, editor, an, enhanced, free, Pico, clone)

vim: edit files (IMproved, a, programmers, text, editor)

rm: delete files (remove, files, or, directories)

-f, --force: forced deletion, no hint (ignore, nonexistent, files, and, never, prompt, arguments)

-r, -R, --recursive: recursive deletion (remove directories and their contents recursively)

-d, --dir: delete the empty directory (remove, empty, directories)

-v, --verbose: display deletion process (explain, what, is, being, done)

cp: copy files and directories, the default state only copy the file, do not copy the directory (copy files and directories)

-R, -r, --recursive: recursive replication (copy, directories, recursively)

-i, --interactive: prompt whether to overwrite (prompt before overwrite (overrides a previous -n option))

-f, --force:if, an, existing, destination, file, be, opened, remove, it, and, Tryagain, cannot (this, option, is,, ignored, when,

, the, -n, used, option, is, also, etc)

-P, --no-dereference: copy the link file, copy the file, not copy the never follow symbolic links in SOURCE

that is linked to the file

-a, --archive: Archive replication, often used to backup

mv: mobile file

install: copy the file and set the file properties (copy, files, and, set, attributes)

(four) directory management common command

ls: displays the files and directories (list, directory, contents)

in the current directory

cd: go to a directory (change, the, working, directory)

pwd: displays the current working directory (print, name, of, current/working, directory)

mkdir: creates a directory (make, directories)

-p, --parents: create a directory from the parent directory level 1 until the target directory is created (no, error, if, existing, make, parent, directories, as, needed)

-v, --verbose: show the detailed creation process (print a message for created directory each)

tree: display directory tree (list, contents, of, directories, in, a, tree-like, format.)

rmdir: delete the empty directory (remove, empty, directories)