CH03_File and Directory Basics
File and Directory Basics:
• Introduction to Directories • Checking Free Space
• Navigate Directories • Display File Content
• Creating Regular File • File Globing
• cd Commands • Examples of Metacharacters
• Listing Directory Contents • File and Directory
• Display Files & directories Manipulation
Properties
Make directory Commands:
• mkdir : make directory
Navigating directories Commands:
• pwd : print working directory
• cd: change directory
o cd ../ → goes one level up
o cd /home/iti/desktop → go to
absolute directory whatever where I am.
o cd - → switch between current and
previous directory
o cd ~ → go to home directory of a certain user
ex. cd ~iti
o cd → go to home directory
Creating regular files Commands:
• touch : create a file
Listing directory content Commands:
• ls : list current directory content
o -a → list all content including (hidden / unhidden) files and
directories
o -f → differentiate between files and directories using /
o -r → lists the contents of directories recursively, displaying all
files and subdirectories in the current directory and its
subdirectories.
o File ending with @ is a fast link file (like shortcut file in windows)
o File ending with * is an executable file (like .exe in windows)
CH03_VID07_Checking Free Space
الحظ هنا الفرق بين االمر األول أظهر المساحه 4KBعلشان هو هنا بينظر لل /boot as a file
وبالنسباله فهو بيحتوي على أسماء الملفات والديريكتوريز اللي جواه
لكن األمر التاني اظهر المساحة 94MBعلشان هنا هو بيظهر المساحة الفعلية بقى للبارتيشن دا نفسه أو
الدايريكتوري دا
CH03_VID08_Display File Content
→ head /etc/passwd هيعرضلي أول 10سطور ممن الملف
→ head -3 /etc/passwd هيعرضلي أول 3سطور ممن الملف
tail /etc/passwd → هيعرضلي آخر 10سطور ممن الملف
→ tail -3 /etc/passwd هيعرضلي آخر 3سطور ممن الملف
CH03_VID09_File Globing (metacharacters)
The * is a wildcard that matches zero or more characters.
• ls f* → list files and directories in the current directory whose
names start with the letter f.
• ls *3 → lists files and directories in the current directory whose
names end with character 3.
• ls [a-f]* → lists all files and directories in the current directory whose
names start with any letter in the range a to f (inclusive).
• ls [af]* → lists all files and directories in the current directory whose
names start with either a or f.
The ? wildcard matches exactly one character.
• Ls file? → lists files and directories in the current directory whose
names start with file and are followed by exactly one additional character.
CH03_VID10_Examples of Metacharacters
CH03_VID11_File and Directory Manipulation
CH04_Manipulating Files Within VI
• Introduction to Command-line • Text Substitute, Delete and
Text Editors Search
• Modes of vi Editor • Copy, Paste, Save and Quit
• Demo on Using vi Editor Commands
• VI Editing Commands • Customizing vi session
vi text editor
vi textfile: open a file with vi
If the file doesn't exist, vi will create a new file with the specified
name.
vi Three basic Modes
1) Command Mode(Default Mode): To perform commands delete, copy,
saving, exiting, and performing other file operations.
معين لكن مش بيتكتب في الفايلcommand في المود دا الحرف بيعمل
cursor ودا المود اللي بقدر أحرك فيك ال
):( التالية بحط في البدايةfunctions باإلضافة لبعض ال
آلخر تعديل عملتهundo بيعمل:u لو دوست على حر ال
وانا بتحركcopy & paste بعمل
أوامر3 بين السطور بالنسبة ألول
):( لكن آخر امرين بعملهم بال
2) Insert Mode (Edit Mode): Used for typing and editing text.
Esc [ وعلشان ارجع منه بدوسa, i, o]ِ بدخل المود دا من خالل الضغط على
3) Last line Mode: Used for executing advanced editing commands.
To access it, enter a (:) while in the command mode
CH05_User and Group Administration
• "passwd" File • Modifying User Accounts
• "shadow" File • Password Aging Policies
• "group" File • Managing Groups
• Adding a New User Account • Changing Active Group
• Adding Password to User • Switching Accounts
• Accounts • "sudo" Command
Slides:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
CH06_ File Ownership and Permissions
• File Ownership • Set GID Bit
• File Permissions • Sticky Bits
• Changing the Permissions • The Default Permissions
• Set UID Bit
1.
2.
CH07_Shutting Down/Rebooting the System
• Virtual Consoles • Reboot and Shutdown System
Ctrl + Alt + F1 بGUI وبيرجع للCtrl + Alt + F4 دا اللي بيظهر عندي لما ادوس
CH_08_Network & Configuration & initialization Files
1) Network Configuration 4) More about Environment Variables
2) Shell Initialization Files 5) Alias Command
3) Environment Variables
CH_09_Processes, Priorities and Signals
1) Processes 3) Overview of Signals
2) Change Process Priority 4) Send a Signal to a Process
The top command is a powerful tool for monitoring system performance
and the activity of running processes in real-time.
CH10_Input-Output Redirection and Piping
1) Output Redirection 3) pipe & tee Commands
2) Input & Error Redirection
CH11 _Sort and Compare Files
1) wc & diff Commands 3) sort Command
2) cut & grep Commands
CH12_Inodes, Links, and Search for Files
1) Inodes 3) Hard Link
2) Soft Link 4) Search for Files
CH13_Compress and Archive Files
1) File archiving 2) File compression
What's Next?
https://youtu.be/Bm5_jnAe16w?si=VDmZ0PzyNe2h7WWd