📘 PAPER 5 – OPERATING SYSTEM (UNIT 4 – UNIX & LINUX COMMANDS) university of allahabad

 

🔴 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

DirectoryPurpose
/Root directory
/binSystem commands
/etcConfiguration files
/homeUser files
/usrUser programs
/varVariable files
/tmpTemporary files

3️⃣ Basic Linux Commands


📁 Directory Commands

CommandDescription
pwdShow current directory
lsList files
cdChange directory
mkdirCreate directory
rmdirRemove empty directory

📄 File Commands

CommandDescription
touchCreate file
catView file
cpCopy file
mvMove/rename file
rmDelete file
fileFile type

📘 Viewing Files

CommandUse
moreView page by page
lessScrollable view
headFirst 10 lines
tailLast 10 lines

4️⃣ File Permission Commands

Permission Types:

SymbolMeaning
rRead
wWrite
xExecute

Example:

-rwxr-xr--

Change Permission:

chmod 755 file.txt

5️⃣ Disk Related Commands

CommandDescription
dfDisk free space
duDisk usage
mountMount disk
umountUnmount disk

6️⃣ Process Management Commands

CommandFunction
psShow running processes
topReal-time process
killKill process
niceSet priority
sleepDelay execution

7️⃣ Input / Output Redirection

Symbols:

SymbolUse
>Output redirect
>>Append
<Input redirect
``

Example:

ls > file.txt cat file.txt | grep abc

8️⃣ Background Processing

command &

9️⃣ Process Scheduling Commands

CommandPurpose
atSchedule job
cronRepeated jobs
crontabCron table

🔹 Example Cron Job:

* * * * * echo "Hello"

🔟 File Editing Commands

Editors:

✔ vi
✔ vim
✔ nano


vi Editor Modes:

  1. Command mode

  2. Insert mode

  3. Exit mode


Important vi Commands:

CommandFunction
iInsert
:wSave
:qQuit
:wqSave & quit
ddDelete 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

Popular Posts