Difference between revisions of "Tutorial2: Unix / Linux File Management"
(→Pathnames) |
(→Pathnames) |
||
Line 83: | Line 83: | ||
(Please take a few moments to review these pathnames) | (Please take a few moments to review these pathnames) | ||
− | + | [[Image:directory-structure-2.png|thumb|right|350px|Commonly used directories (listed by directory pathname) for for ALL Unix / Linux Filesystems.]] | |
<table cellpadding="5"><tr><th style="border-bottom: 1px solid black;">Directory Pathname</th><th style="border-bottom: 1px solid black;">Purpose</th></tr><tr><td>'''/'''</td><td>Root directory (ancestor to all directories)</td></tr><tr><td>'''/home'''</td><td>Used to store users’ home directories | <table cellpadding="5"><tr><th style="border-bottom: 1px solid black;">Directory Pathname</th><th style="border-bottom: 1px solid black;">Purpose</th></tr><tr><td>'''/'''</td><td>Root directory (ancestor to all directories)</td></tr><tr><td>'''/home'''</td><td>Used to store users’ home directories | ||
</td></tr><tr><td>'''/home/username'''</td><td>A Particular User's Home Directory</td></tr><tr><td>'''/bin'''</td><td>Common system binaries (commands) </td></tr><tr><td>'''/usr/bin'''</td><td>Common utilities (commands) for users. </td></tr><tr><td>'''/usr/sbin'''</td><td>Common utilities for system administration </td></tr><tr><td>'''/etc'''</td><td>System administration files (eg. passwd)</td></tr><tr><td>'''/var'''</td><td>Dynamic files (log and mail files)</td></tr><tr><td>'''/tmp , /var/tmp'''</td><td>Temporary files for programs</td></tr><tr><td>'''/dev'''</td><td>Device driver files (terminals, printers, etc.) | </td></tr><tr><td>'''/home/username'''</td><td>A Particular User's Home Directory</td></tr><tr><td>'''/bin'''</td><td>Common system binaries (commands) </td></tr><tr><td>'''/usr/bin'''</td><td>Common utilities (commands) for users. </td></tr><tr><td>'''/usr/sbin'''</td><td>Common utilities for system administration </td></tr><tr><td>'''/etc'''</td><td>System administration files (eg. passwd)</td></tr><tr><td>'''/var'''</td><td>Dynamic files (log and mail files)</td></tr><tr><td>'''/tmp , /var/tmp'''</td><td>Temporary files for programs</td></tr><tr><td>'''/dev'''</td><td>Device driver files (terminals, printers, etc.) |
Revision as of 18:02, 6 January 2020
Contents
UNIX / LINUX FILE MANAGEMENT
Main Objectives of this Practice Tutorial
- Understand the Purpose of the Unix / Linux Directory Structure.
- List Common Directories that are Contained in a Typical Unix / Linux Filesystem
- Use Common Unix / Linux Commands to Perform Directory Management Tasks.
- Use Common Unix / Linux Commands to Perform Text File Management Tasks.
- Using Text Editors to Create and Manipulate Text Files
- Using Text Editors to Create and Manipulate Text Files
Tutorial Reference Material
Course Notes / Software |
Linux Command/Shortcut Reference |
YouTube Videos | ||
Course Notes:Tutorials:
|
Directory and File Management Commands | Text File Management Commands
Text Editors
|
Brauer Instructional Videos: |
Unix / Linux Directory Concepts
![](/w/imgs/thumb/Directory-structure-1.png/350px-Directory-structure-1.png)
All files and directories appear under a single ancestor directory called "the root directory".
A path 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 ("/").
The Unix/Linux file system is hierarchical, similar to other operating systems such as
Windows, Mac OSX, etc.
Files are organized in directories. Directories may contain sub-directories.
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 the Linux filesystem and manipulating directory and files are essential skills for Linux users and administrators.
In the Linux (Unix) OS, the "root directory" / is the starting directory, and other "child directories", "grandchild directories", etc. are created The hierarchical structure resembles an "upside- down tree". There is actually a command called tree that can display a "tree diagram"!
Pathnames
A path, the general form of the name of a file or directory, specifies a unique location in a file system. A path 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:
(Please take a few moments to review these pathnames)
Directory Pathname | Purpose |
---|---|
/ | Root directory (ancestor to all directories) |
/home | Used to store users’ home directories |
/home/username | A Particular 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.) |
Every user when receiving an account has a “home” directory created (/home/userid). This is where the user keep subdirectories and personal files
We will now learn to create and manage subdirectories within your own home directory.
INVESTIGATION 1: MANAGING DIRECTORIES
x
Part 1: Creating / Removing Directories
x
Perform the Following Steps:
- x
Part 2: Creating / Copying / Moving / Removing Files
x
Perform the Following Steps:
- x
INVESTIGATION 2: MANAGING TEXT FILES
x
Part 1: Creating / Removing Text Files
x
Perform the Following Steps:
- x
Part 2: x Files
x
Perform the Following Steps:
- x
INVESTIGATION 3: USING TEXT EDITORS TO CREATE / MODIFY TEXT FILES
In this section, you will learn how to use the Linux Shell. Topics in the section include:
- x
- x
- x
- x
- x
Part 1: Using the Nano Text Editor
x
Perform the Following Steps:
- x
Part 2: Using the VI / VIM Text Editor
x
Perform the following steps:
- x
LINUX PRACTICE QUESTIONS
The purpose of this section is to obtain extra practice to help with quizzes, your midterm, and your final exam.
Here is a link to the MS Word Document of ALL of the questions displayed below but with extra room to answer on the document to simulate a quiz:
https://ict.senecacollege.ca/~murray.saul/uli101/uli101_week2_practice.docx
Your instructor may take-up these questions during class. It is up to the student to attend classes in order to obtain the answers to the following questions. Your instructor will NOT provide these answers in any other form (eg. e-mail, etc).
Review Questions:
- x
- x
- x
- x
- x
- x
- x
- x
- Create a table listing each Linux command, useful options that were mentioned in the online assignment #1 and command purpose for the following Linux commands: '