Linux कमांड रेफरेंस
आवश्यक Linux/Unix कमांड के लिए त्वरित संदर्भ: फ़ाइल प्रबंधन, टेक्स्ट प्रोसेसिंग, प्रोसेस, नेटवर्किंग और अधिक।
फ़ाइल & डायरेक्टरी
ls -laList files with details and hidden filescd <dir>Change directorypwdPrint working directorymkdir -p <dir>Create directory (and parents)rm -rf <dir>Remove directory recursively (careful!)cp -r <src> <dest>Copy files/directories recursivelymv <src> <dest>Move or rename file/directorytouch <file>Create empty file or update timestampfind . -name "*.txt"Find files by name patternfind . -type f -size +10MFind files larger than 10MBdu -sh *Show disk usage of each itemdf -hShow disk space usageटेक्स्ट प्रोसेसिंग
cat <file>Print file contentsless <file>Page through file (q to quit)head -n 20 <file>Show first 20 linestail -n 20 <file>Show last 20 linestail -f <file>Follow file (live log viewing)grep -r "pattern" .Search for pattern recursivelygrep -i "pattern" <file>Case-insensitive searchgrep -n "pattern" <file>Show line numbers in resultssed -i "s/old/new/g" <file>Replace text in file in-placeawk '{print $1}' <file>Print first columnsort <file>Sort lines alphabeticallysort -n -k2 <file>Sort numerically by 2nd columnuniq -cCount and deduplicate adjacent lineswc -l <file>Count lines in filecut -d"," -f1,3 <file>Cut specific columns (CSV)प्रोसेस
ps auxList all running processestopInteractive process viewerhtopEnhanced process viewer (if installed)kill <pid>Terminate process by PIDkill -9 <pid>Force kill processpkill <name>Kill processes by namepgrep <name>Find PIDs by process namenohup <cmd> &Run command immune to hangups, in backgroundjobsList background jobsbg %1Resume job 1 in backgroundfg %1Bring job 1 to foregroundअनुमतियां & स्वामित्व
chmod 755 <file>Set rwxr-xr-x permissionschmod +x <file>Make file executablechown user:group <file>Change file owner and groupsudo <cmd>Run command as superusersudo -iSwitch to root shellsu - <user>Switch to another userumask 022Set default permission maskनेटवर्किंग
curl -I <url>Show response headers onlycurl -L -o file <url>Download file following redirectswget <url>Download fileping <host>Test network connectivitytraceroute <host>Trace network path to hostnslookup <domain>DNS lookupdig <domain>Detailed DNS lookupnetstat -tulnShow listening portsss -tulnShow listening ports (modern)ssh user@hostConnect via SSHscp <file> user@host:/pathCopy file via SSHrsync -avz src/ user@host:dest/Sync files efficientlyआर्काइव & कम्प्रेशन
tar -czf archive.tar.gz <dir>Create gzip compressed archivetar -xzf archive.tar.gzExtract gzip archivetar -cjf archive.tar.bz2 <dir>Create bzip2 compressed archivezip -r archive.zip <dir>Create zip archiveunzip archive.zipExtract zip archivegzip <file>Compress file with gzipgunzip <file>.gzDecompress gzip fileसिस्टम जानकारी
uname -aSystem and kernel informationcat /etc/os-releaseOS version informationfree -hMemory usageuptimeSystem uptime and loadwhoWho is logged inidCurrent user and group IDsenvShow environment variablesexport VAR=valueSet environment variablewhich <cmd>Find command pathhistoryCommand historyman <cmd>Manual page for a commandइस टूल के बारे में
Linux कमांड रेफरेंस सात श्रेणियों में व्यवस्थित आवश्यक Linux/Unix कमांड का संग्रह प्रदान करता है: फ़ाइल और डायरेक्टरी प्रबंधन, टेक्स्ट प्रोसेसिंग, प्रोसेस नियंत्रण, अनुमतियां और स्वामित्व, नेटवर्किंग, आर्काइव और कम्प्रेशन, और सिस्टम जानकारी।
प्रत्येक कमांड में एक वास्तविक उपयोग उदाहरण और संक्षिप्त विवरण शामिल है। कमांड नाम या विवरण कीवर्ड द्वारा त्वरित फ़िल्टर के लिए सर्च बॉक्स का उपयोग करें।
कैसे उपयोग करें
- सर्च बॉक्स में कमांड नाम या कीवर्ड टाइप करें।
- कमांड ब्राउज़ करने के लिए श्रेणियों में स्क्रॉल करें।
- कमांड और विवरण की समीक्षा करें, फिर इसे अपने टर्मिनल में उपयोग करें।
- एंगल ब्रैकेट में प्लेसहोल्डर्स (<dir>, <file> आदि) को वास्तविक मानों से बदलें।
उपयोग के मामले
डिप्लॉयमेंट स्क्रिप्ट लिखने वाले DevOps इंजीनियर, सर्वर समस्याओं को डीबग करने वाले सिसएडमिन, फ़ाइल अनुमतियां जांचने वाले डेवलपर, और Linux कमांड-लाइन सीखने वाले शुरुआती।
अक्सर पूछे जाने वाले प्रश्न
- एंगल ब्रैकेट (<>) का क्या अर्थ है? एंगल ब्रैकेट प्लेसहोल्डर हैं। <dir> को वास्तविक डायरेक्टरी पथ से, <file> को फ़ाइलनाम से, <pid> को प्रोसेस आईडी से बदलें।
- यदि कमांड नहीं मिली तो क्या करें? htop जैसी कुछ कमांड डिफ़ॉल्ट रूप से इंस्टॉल नहीं होती। पैकेज मैनेजर से इंस्टॉल करें (उदा. sudo apt install htop) या man कमांड से जांचें।
- sudo उपयोग करते समय क्या सावधानी बरतें? sudo सुपरयूजर विशेषाधिकारों के साथ कमांड चलाता है। rm -rf जैसी विनाशकारी कमांड के साथ sudo का उपयोग अपूरणीय डेटा हानि का कारण बन सकता है। निष्पादन से पहले हमेशा जांचें।