Tutorial 2 - Unix / Linux File Management
Contents
UNIX / LINUX FILE MANAGEMENT CONCEPTS
Main Objectives of this Practice Tutorial
- Understand the purpose of directories and directory pathnames.
- Use common Unix / Linux commands to perform directory management tasks.
- Use Text Editors to create and modify text files
- Use Common Unix / Linux commands to manage and manipulate text files.
Tutorial Reference Material
Course Notes |
Linux Command/Shortcut Reference | |
Slides:Tutorials:
|
File Management | Text Editors / File Content |
KEY CONCEPTS
Unix / Linux Directories
To better organize files (eg. text, images, documents, spreadsheets, programs) within your Matrix account, they should be stored in directories. To further organize many files, directories
may contain sub-directories.
The Unix/Linux file system is hierarchical, like other operating systems such as Windows, Mac OSX, etc.
In Unix / Linux (as opposed to MS Windows), there are no drive letters (such as C:, or D:).
All files and directories appear under a single ancestor directory called the "root directory".
Learning how to issue Linux commands for navigating and manipulating directory and files within the the Linux filesystem are essential skills for Linux users and Linux system administrators (i.e. sysadmins).
In the Linux (Unix) OS, the "root directory" / is the starting directory, and other "child directories", "grandchild directories", etc. can be created as required. The hierarchical structure resembles an "upside-down tree". There is actually a command called tree that displays a "directory tree diagram"!
Directory Pathnames
A pathname is used to specify a route to a file within the file system.
A pathname points to a file system location by following the directory tree hierarchy expressed in a string of characters in which path components, separated by a delimiting character, represent each directory. The delimiting character is most commonly the slash ("/"). Reference: https://en.wikipedia.org/wiki/Path_(computing)
The following table displays and defines commonly used directories
(listed by directory pathname) for for ALL Unix / Linux Filesystems:
Directory Pathname | Purpose |
---|---|
/ | Root directory (ancestor to all directories) |
/home | Used to store users’ home directories |
/home/username | A specific User's Home Directory |
/bin | Common system binaries (commands) |
/usr/bin | Common utilities (commands) for users. |
/usr/sbin | Common utilities for system administration |
/etc | System administration files (eg. passwd) |
/var | Dynamic files (log and mail files) |
/tmp , /var/tmp | Temporary files for programs |
/dev | Device driver files (terminals, printers, etc.) |
When you log into your Matrix account, you are automatically directed to your home directory.
This directory is where the user can store files, and create subdirectories to organize their files.