Basic Linux Commands

Linux Commands क्या हैं?

Linux Commands वो instructions होते हैं जिन्हें terminal में लिखकर हम system से काम करवाते हैं।

मतलब:
User command देता है → System उसे execute करता है

Basic Concept

  • Commands terminal में run होती हैं
  • Case-sensitive होती हैं
  • Commands के साथ options और arguments भी होते हैं

File Related Commands

ls (List)

Directory के अंदर की files और folders दिखाता है

Example:

ls

cp (Copy)

File को copy करने के लिए

Example:

cp file1.txt file2.txt

mv (Move / Rename)

File को move या rename करता है

Example:

mv file1.txt file2.txt

cat (Concatenate)

File का content दिखाता है

Example:

cat file.txt

wc (Word Count)

Lines, words और characters count करता है

Example:

wc file.txt

sort

File के data को sort करता है

Example:

sort file.txt

grep

Text search करने के लिए use होता है

Example:

grep "hello" file.txt

dd

Low-level copy (disk/data copy)

Example:

dd if=input.txt of=output.txt

File Viewing Commands

head

File के starting lines दिखाता है

Example:

head file.txt

tail

File के last lines दिखाता है

Example:

tail file.txt

uniq

Duplicate lines हटाता है

Example:

uniq file.txt

diff

दो files compare करता है

Example:

diff file1.txt file2.txt

echo

Text display करता है

Example:

echo "Hello"

touch

नई empty file create करता है

Example:

touch file.txt

User & System Commands

who

Logged-in users दिखाता है

who

whoami

Current user दिखाता है

whoami

uname

System info दिखाता है

uname

ps

Running processes दिखाता है

ps

pwd

Current directory दिखाता है

pwd

kill

Process को terminate करता है

kill 1234

clear

Screen clear करता है

clear

exit

Terminal exit करता है

exit

Compression Commands

compress

File compress करता है

compress file.txt

uncompress

Compressed file को extract करता है

uncompress file.txt.Z

Directory Commands

mkdir

नई directory बनाता है

mkdir folder

cd

Directory change करता है

cd folder

rmdir

Empty directory delete करता है

rmdir folder

df

Disk space दिखाता है

df

du

Directory size दिखाता है

du

Permission Commands

chmod

File permissions बदलता है

chmod 755 file.txt

chown

File owner बदलता है

chown user file.txt

chgrp

Group बदलता है

chgrp group file.txt

Hard & Soft Links

Hard Link

Same file का दूसरा name

ln file1 file2

Soft Link (Symbolic Link)

Shortcut जैसा होता है

ln -s file1 link

Environment & Path Setting

Environment Variables

System variables होते हैं

Example:

echo $PATH

Path Setting

export PATH=$PATH:/new/path

I/O Redirection & Piping

Output Redirection

ls > file.txt

Append Output

ls >> file.txt

Input Redirection

wc < file.txt

Pipe (|)

एक command का output दूसरे को देना

ls | grep txt

Short Conclusion

Linux Commands system के साथ interact करने के लिए use होते हैं। ये file handling, directory management, process control, permissions और data processing के लिए उपयोगी हैं। Practical exam में commands directly पूछी जाती हैं।

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top