Difference between revisions of "Linux-Ubuntu/C2/File-System-in-Linux/English"
Ketkinaina (Talk | contribs) (Created page with "'''Title of the Script: File System''' '''in Linux''' '''Author: EduPyramids Team.''' '''Keywords: '''Linux, terminal, file, directories, pwd, ls command, cat command, video...") |
|||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | '''Title of the Script | + | '''Title of the Script''': '''File System in Linux''' |
'''Author: EduPyramids Team.''' | '''Author: EduPyramids Team.''' | ||
| Line 6: | Line 6: | ||
'''Prerequisite tutorial: General Purpose Utilities''' | '''Prerequisite tutorial: General Purpose Utilities''' | ||
| + | |||
{|border=1 | {|border=1 | ||
| Line 12: | Line 13: | ||
|| '''Narration''' | || '''Narration''' | ||
|- | |- | ||
| − | || '''Slide | + | || '''Slide 1''' |
| + | |||
| + | '''Title Slide''' | ||
|| Welcome to this''' Spoken tutorial '''on''' File System''' '''in Linux'''. | || Welcome to this''' Spoken tutorial '''on''' File System''' '''in Linux'''. | ||
|- | |- | ||
| − | || '''Slide 2 Learning Objectives ''' | + | || '''Slide 2''' |
| + | |||
| + | '''Learning Objectives ''' | ||
|| In this tutorial we will learn to: | || In this tutorial we will learn to: | ||
| − | * Define Files | + | * Define Files and directories. |
* Create a file and add text in it. | * Create a file and add text in it. | ||
* Create directories and | * Create directories and | ||
| Line 35: | Line 40: | ||
To follow this tutorial, | To follow this tutorial, | ||
| − | Learners should know the basics of using the | + | Learners should know the basics of using the Linux terminal. |
For the prerequisite Linux tutorials please visit | For the prerequisite Linux tutorials please visit | ||
| Line 52: | Line 57: | ||
# '''fs-commands.txt''' | # '''fs-commands.txt''' | ||
| − | This file is provided in the Code Files link of this tutorial page. | + | This file is provided in the '''Code Files''' link of this tutorial page. |
|| The following code file is required to practice this tutorial. | || The following code file is required to practice this tutorial. | ||
| − | This file is provided in the Code Files link of this tutorial page. | + | This file is provided in the '''Code Files''' link of this tutorial page. |
| − | + | ||
| − | + | ||
| − | + | ||
|- | |- | ||
|| '''Slide 6''' | || '''Slide 6''' | ||
| − | + | '''Linux File System hierarchy''' | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | '''Linux-filesystem.png''' | |
| + | || Let us discuss files and directories. | ||
| − | + | All the files are connected in a tree structure. | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
At the top of this tree is the '''root directory''' indicated by slash(/). | At the top of this tree is the '''root directory''' indicated by slash(/). | ||
| Line 120: | Line 76: | ||
Every file and directory exists under root(/). | Every file and directory exists under root(/). | ||
|- | |- | ||
| − | || '''Slide | + | || '''Slide 7''' |
'''Types of Files''' | '''Types of Files''' | ||
| Line 130: | Line 86: | ||
# '''Regular files : '''They store data as a stream of characters. | # '''Regular files : '''They store data as a stream of characters. | ||
| − | For example: text files, images, videos | + | For example: text files, images, videos. |
# '''Directories: '''Organize files and other directories. | # '''Directories: '''Organize files and other directories. | ||
# '''Device files: '''These represent hardware such as disks, USBs, Cds. | # '''Device files: '''These represent hardware such as disks, USBs, Cds. | ||
| Line 139: | Line 95: | ||
Press''' Ctrl, Alt '''and''' T keys '''on your''' keyboard''' | Press''' Ctrl, Alt '''and''' T keys '''on your''' keyboard''' | ||
| − | || Let us now open the '''terminal '''window. | + | || Let us now open the '''terminal ''' window. |
|- | |- | ||
|| '''Type pwd ''' | || '''Type pwd ''' | ||
| Line 148: | Line 104: | ||
|| By default we are always in the home directory. | || By default we are always in the home directory. | ||
| − | Let me type '''pwd '''and press '''Enter'''. | + | Let me type '''pwd ''' and press '''Enter'''. |
| − | The output shows '''/home/spoken '''as the present working directory. | + | The output shows '''/home/spoken ''' as the present working directory. |
|- | |- | ||
|| Type''' ls -l '''and press '''Enter'''. | || Type''' ls -l '''and press '''Enter'''. | ||
| Line 158: | Line 114: | ||
* List of all files with file permissions, | * List of all files with file permissions, | ||
* file owner's name, | * file owner's name, | ||
| − | * file size in bytes | + | * file size in bytes, |
* last modification time, | * last modification time, | ||
| − | * File or directory name | + | * File or directory name. |
|- | |- | ||
|| Point to the information on the terminal. | || Point to the information on the terminal. | ||
| Line 168: | Line 124: | ||
'''ls -l >fileinfo''' and press '''Enter'''. | '''ls -l >fileinfo''' and press '''Enter'''. | ||
| − | || So type '''ls space hyphen l space greater than fileinfo''' and | + | || So type '''ls space hyphen l space greater than fileinfo''' and press''' Enter'''. |
Observe that nothing is displayed on the screen. | Observe that nothing is displayed on the screen. | ||
| Line 177: | Line 133: | ||
|| To see the content of the files we have to use '''cat''' command. | || To see the content of the files we have to use '''cat''' command. | ||
| − | So type '''cat space fileinfo '''and | + | So type '''cat space fileinfo '''and press''' Enter'''. |
Output shows the file contents. | Output shows the file contents. | ||
| Line 188: | Line 144: | ||
It can also be used to create or append files. | It can also be used to create or append files. | ||
| − | Type '''cat space greater than file1 dot | + | Type '''cat space greater than file1 dot txt '''and''' '''press''' Enter.''' |
|- | |- | ||
|| Type '''I am creating a new file.''' and press Enter. | || Type '''I am creating a new file.''' and press Enter. | ||
| Line 234: | Line 190: | ||
|| Let us now learn to create directories. | || Let us now learn to create directories. | ||
| − | To create a directory I will type '''mkdir space test1 '''and press '''Enter | + | To create a directory I will type '''mkdir space test1 '''and press '''Enter'''. |
If no output appears it means that the command has executed successfully. | If no output appears it means that the command has executed successfully. | ||
| Line 287: | Line 243: | ||
Let me type '''cd space dot dot slash dot dot slash''' | Let me type '''cd space dot dot slash dot dot slash''' | ||
| − | |||
| − | |||
Here the first two dots move up one level. | Here the first two dots move up one level. | ||
| Line 314: | Line 268: | ||
This indicates that if the directory is not empty it cannot be deleted. | This indicates that if the directory is not empty it cannot be deleted. | ||
| − | A directory must be empty before it can be removed using''' rmdir'''. | + | A directory must be empty before it can be removed using ''' rmdir'''. |
|- | |- | ||
|| | || | ||
|| With this we come to the end of this tutorial. | || With this we come to the end of this tutorial. | ||
|- | |- | ||
| − | || '''Slide | + | || '''Slide 8''' |
'''Summary''' | '''Summary''' | ||
In this tutorial we have learn to: | In this tutorial we have learn to: | ||
| − | * Define Files | + | * Define Files and directories. |
* Create a file and add text in it | * Create a file and add text in it | ||
* Create directories and | * Create directories and | ||
| Line 330: | Line 284: | ||
|| Let us summarise. | || Let us summarise. | ||
|- | |- | ||
| − | || '''Slide | + | || '''Slide 9''' |
'''Assignment''' | '''Assignment''' | ||
| Line 339: | Line 293: | ||
|| As an assignment, please do the following. | || As an assignment, please do the following. | ||
|- | |- | ||
| − | || '''Slide | + | || '''Slide 10''' |
'''Thank you''' | '''Thank you''' | ||
| − | + | ||
| + | This Spoken Tutorial is brought to you by EduPyramids Educational Services Private Limited SINE IIT Bombay. | ||
| + | || Thank you. | ||
|- | |- | ||
|} | |} | ||
Latest revision as of 14:45, 11 March 2026
Title of the Script: File System in Linux
Author: EduPyramids Team.
Keywords: Linux, terminal, file, directories, pwd, ls command, cat command, video tutorial, EduPyramids.
Prerequisite tutorial: General Purpose Utilities
| Visual Cue | Narration |
| Slide 1
Title Slide |
Welcome to this Spoken tutorial on File System in Linux. |
| Slide 2
Learning Objectives |
In this tutorial we will learn to:
|
| Slide 3
System Requirements |
To record this tutorial, I am using,
Ubuntu OS version 24 point 04. |
| Slide 4
Pre-requisites To follow this tutorial, Learners should know the basics of using the Linux terminal. For the prerequisite Linux tutorials please visit |
To follow this tutorial,
|
| Slide 5
Code files The following code file is required to practice this tutorial
This file is provided in the Code Files link of this tutorial page. |
The following code file is required to practice this tutorial.
This file is provided in the Code Files link of this tutorial page. |
| Slide 6
Linux File System hierarchy Linux-filesystem.png |
Let us discuss files and directories.
All the files are connected in a tree structure. At the top of this tree is the root directory indicated by slash(/). Every file and directory exists under root(/). |
| Slide 7
Types of Files types-of-files1.png |
Types of files in Linux.
Linux has three main types of files:
For example: text files, images, videos.
They can be read and written like files. |
| Screencast:
Press Ctrl, Alt and T keys on your keyboard |
Let us now open the terminal window. |
| Type pwd
Point to the output /home/spoken |
By default we are always in the home directory.
Let me type pwd and press Enter. The output shows /home/spoken as the present working directory. |
| Type ls -l and press Enter. | Now type ls space hyphen l and press Enter.
Terminal shows the following output.
|
| Point to the information on the terminal. | Instead of displaying all information on the screen, we can store it in a file. |
| Type at the prompt
ls -l >fileinfo and press Enter. |
So type ls space hyphen l space greater than fileinfo and press Enter.
Observe that nothing is displayed on the screen. |
| Type at the prompt
cat fileinfo and press Enter. |
To see the content of the files we have to use cat command.
So type cat space fileinfo and press Enter. Output shows the file contents. |
| Type at the prompt
cat > file1.txt and press Enter. |
The cat command is mainly used to display file contents.
It can also be used to create or append files. Type cat space greater than file1 dot txt and press Enter. |
| Type I am creating a new file. and press Enter.
Press Ctrl + D keys to end the input. |
After pressing Enter, the command waits for input from the user.
So let’s type I am creating a new file. and press Enter. Whatever we type will be written into the file. The input is ended by pressing Ctrl and D keys together. |
| Type at the prompt
cat >>file1.txt and press Enter. |
If you wish to append to the end of an existing file type
cat space greater than greater than file1 dot txt and press Enter. |
| Type at the prompt
This is a new line in the file. and press Enter. Press Ctrl + D keys together. |
Again the command waits for input from the user.
So type, This is a new line in the file. and press Enter. Press Ctrl and D keys together to end the input. |
| Type: cat file1.txt and press Enter. | To see the contents written in file1 type,
cat space file1 dot txt and press Enter. |
| Type: clear and Press Enter. | Type clear to clear the terminal window. |
| Type: mkdir test1 and Press Enter.
While recording, show the directory creation in the home directory. Place the terminal and home directory side-by-side. |
Let us now learn to create directories.
To create a directory I will type mkdir space test1 and press Enter. If no output appears it means that the command has executed successfully. |
| Type mkdir test2 test3 and press Enter | Let us now create multiple directories.
So I will type mkdir space test2 space test3 and press Enter. |
| Type mkdir -p test4/test4.1 and press Enter.
Show the folders test4 and test4.1 Highlight -p. |
Now to show the directory hierarchy let me type mkdir space hyphen p space test4 slash test4 point 1 and press Enter.
This will create a directory test4 point 1 within the test4 directory. Here the argument hyphen p creates parent directories if they do not already exist. Then test4 point 1 directory is created inside test4. |
| Now let us learn to move into various directories. | |
| Type: cd test1 press Enter. | Type cd space test1 and press Enter.
We are now in the test1 directory. |
| Type cd .. and press Enter. | Let us go back to the parent directory.
So type cd space dot dot |
| Type: cd test press Tab keys twice .
Press the backspace key to erase the prompt. |
Now type cd test and press the Tab key twice.
All the directories with the name test will be displayed. Press the backspace key to erase the prompt. |
| Type cd test4/test4.1 and press Enter. | Type cd test4/test4 point 1 and press Enter to move to test4 point 1. |
| Type: cd ../../
Press the Enter key. |
Now let us learn to do multi-level navigation to come back to the home directory.
Let me type cd space dot dot slash dot dot slash Here the first two dots move up one level. Second two dots moves up one more directory level. Press the Enter key. |
| Type: rmdir test1 and press Enter. | Now we will learn to delete the created test 1 directory.
Type rmdir space test1 and press Enter. Now, we can see that the test1 directory is removed. |
| Type: rmdir test4 test4/test4.1
Highlight the output: rmdir: failed to remove 'test4': Directory not empty |
Type rmdir space test4 space test4 slash test4 point 1.
The output shows rmdir: failed to remove 'test4': Directory not empty. This indicates that if the directory is not empty it cannot be deleted. A directory must be empty before it can be removed using rmdir. |
| With this we come to the end of this tutorial. | |
| Slide 8
Summary In this tutorial we have learn to:
|
Let us summarise. |
| Slide 9
Assignment
|
As an assignment, please do the following. |
| Slide 10
Thank you This Spoken Tutorial is brought to you by EduPyramids Educational Services Private Limited SINE IIT Bombay. |
Thank you. |