Linux Terminal Basics 2 | Working with Files

Linux Terminal Basics 2 | Working with Files

16.034 Lượt nghe
Linux Terminal Basics 2 | Working with Files
This time around we look deeper into creating files, organizing files, finding files and removing files. Commands covered: touch mkdir cp mv rmdir fild locate grep mc (Midnight Commander) stat type Linux Filesystem Basics Terms: "Directory" A special kind of file that contains links to other files. "File" is a self-contained piece of information available to the operating system and any number of individual programs. Files are owned by the user who creates them. "Filesystem" Can refer to the filsystem hierarchy (the way files are organized and managed) or it can refer to the type of format that is used to store files on a block device such as Ext4, XFS Fat32 and NTFS. "Folder" Another name for a directory, especially when working in graphic environments. Interchangeable with the term "Directory" "Link" Refers to a file that points to another file or directory (symbolic link) or it can refer to a file that has more than one name. (hard link) "Mount" Refers to the way devices are made to appear in a Unix/Linux filesystem. Partitions on hard drives, USB sticks and CD/DVD are "mounted" to a directory somewhere in the filesystem. This can be done automatically or manually by a user with root privileges. "Path" A path points to a file system location by following the directory tree hierarchy. Example: /home/joe/Documents/letter_to_cindy.txt "Permissions" File attributes that define who can access or change a file and whether a file can be executed as a program. "-rwxr-xr-x" Shows file type and permissions. +-------------+------+-------+ | d--------- | File Type | +-------------+------+-------+ | - = regular file | | d = directory | | l = link | +-------------+------+-------+ | Permission | Octal| Field | +-------------+------+-------+ | -rwx------ | 700 | User | | ----rwx--- | 070 | Group | | -------rwx | 007 | Other | +-------------+------+-------+ Octal values: Read = 4 Write = 2 Execute = 1 8 bits = 1 byte. Uses digits 0 1 2 3 4 5 6 7. You can set permissions in the file manager or with the commend "chmod." Examples: Set a file to be executable and readable by by everyone but only writable by you: 'chmod 755 filemane' Set execute bit without changing other permisions: 'chomd +x filename' When applying permissions to directories on Linux, the permission bits have different meanings than on regular files. The write bit allows the affected user to create, rename, or delete files within the directory, and modify the directory's attributes. The read bit allows the affected user to list the files within the directory. The execute bit allows the affected user to enter the directory and access files and directories inside. "Root" Can refer to the base of a filesystem ("/") or a user with administrator privileges for a Unix/Linux computer. "Tree" A way to visualize filesystem structure. Dir ├── Dir │ ├── File │ ├── File │ └── Dir │ └── File ├── File └── File Check out https://www.ezeelinux.com for more about Linux. Please join the discussion at EzeeTalk. https://www.ezeelinux.com/talk/ It's free, secure and fun!