🔴 UNIT 4 – UNIX & LINUX COMMANDS
1️⃣ Introduction to UNIX / Linux
✅ UNIX
UNIX is a multi-user, multitasking operating system developed at AT&T Bell Labs.
✅ Linux
Linux is an open-source UNIX-based operating system.
🔹 Features of Linux
✔ Open source
✔ Secure
✔ Portable
✔ Multi-user
✔ Multitasking
2️⃣ Linux File System Structure
| Directory | Purpose |
|---|
| / | Root directory |
| /bin | System commands |
| /etc | Configuration files |
| /home | User files |
| /usr | User programs |
| /var | Variable files |
| /tmp | Temporary files |
3️⃣ Basic Linux Commands
📁 Directory Commands
| Command | Description |
|---|
pwd | Show current directory |
ls | List files |
cd | Change directory |
mkdir | Create directory |
rmdir | Remove empty directory |
📄 File Commands
| Command | Description |
|---|
touch | Create file |
cat | View file |
cp | Copy file |
mv | Move/rename file |
rm | Delete file |
file | File type |
📘 Viewing Files
| Command | Use |
|---|
more | View page by page |
less | Scrollable view |
head | First 10 lines |
tail | Last 10 lines |
4️⃣ File Permission Commands
Permission Types:
| Symbol | Meaning |
|---|
| r | Read |
| w | Write |
| x | Execute |
Example:
Change Permission:
5️⃣ Disk Related Commands
| Command | Description |
|---|
df | Disk free space |
du | Disk usage |
mount | Mount disk |
umount | Unmount disk |
6️⃣ Process Management Commands
| Command | Function |
|---|
ps | Show running processes |
top | Real-time process |
kill | Kill process |
nice | Set priority |
sleep | Delay execution |
7️⃣ Input / Output Redirection
Symbols:
| Symbol | Use |
|---|
> | Output redirect |
>> | Append |
< | Input redirect |
| ` | ` |
Example:
8️⃣ Background Processing
9️⃣ Process Scheduling Commands
| Command | Purpose |
|---|
at | Schedule job |
cron | Repeated jobs |
crontab | Cron table |
🔹 Example Cron Job:
🔟 File Editing Commands
Editors:
✔ vi
✔ vim
✔ nano
vi Editor Modes:
-
Command mode
-
Insert mode
-
Exit mode
Important vi Commands:
| Command | Function |
|---|
i | Insert |
:w | Save |
:q | Quit |
:wq | Save & quit |
dd | Delete line |
📌 EXAM IMPORTANT QUESTIONS (UNIT 4)
✔ Explain Linux file system
✔ Explain Linux commands
✔ File permission in Linux
✔ Explain I/O redirection
✔ Explain process management commands
✔ Explain cron & at
Comments
Post a Comment