Week 2 – Unix file system and common utilities
I. Unix file system
- The Unix file system is a hierarchical file system that organizes files and directories into a tree structure. It consists of a root directory, which is the top-level directory, and subdirectories, which can contain files and other subdirectories.
II. File types and file naming
- In the Unix file system, there are several types of files, including regular files, directories, symbolic links, and special files such as devices and sockets.
- File names in the Unix file system can contain any printable ASCII character, except for the forward slash (/), which is reserved as the directory separator. File names are case-sensitive.
III. Basic file system commands
- pwd: Prints the current working directory.
- cd: Changes the current working directory.
- tree: Prints a graphical representation of the directory tree.
- ls: Lists the contents of a directory.
- mkdir: Creates a new directory.
- rmdir: Removes an empty directory.
- mv: Moves or renames a file or directory.
- cp: Copies a file or directory.
- rm: Removes a file or directory.
- man: Displays the manual pages for a command.
IV. Text editing
- In the Unix file system, text editors are used to create and edit text files. Some common text editors include vi, emacs, and nano.
V. Common file utilities
- cat: Concatenates and displays the contents of files.
- more: Displays the contents of a file one screen at a time.
- less: Displays the contents of a file one screen at a time, with additional navigation features.
- touch: Updates the modification time of a file or creates an empty file.
- file: Determines the type of a file.
- find: Searches for files based on various criteria.