কম্পিউটার টিউটোরিয়াল

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

পরিচয়

অত্যাবশ্যক লিনাক্স কমান্ডের এই বিস্তৃত নির্দেশিকা দিয়ে আপনার লিনাক্স সিস্টেমের সম্পূর্ণ সম্ভাবনা আনলক করুন। আপনি একজন অভিজ্ঞ প্রশাসক হোন বা সবে শুরু করুন, দক্ষ সার্ভার পরিচালনা, স্ক্রিপ্ট লেখা এবং সমস্যা সমাধানের জন্য এই কমান্ডগুলি আয়ত্ত করা অত্যন্ত গুরুত্বপূর্ণ। এই টিউটোরিয়ালে, আপনি ফাইল ম্যানেজমেন্ট, প্রসেস কন্ট্রোল, ইউজার এক্সেস, নেটওয়ার্ক কনফিগারেশন এবং সিস্টেম ডিবাগিং এর জন্য সবচেয়ে বেশি ব্যবহৃত এবং শক্তিশালী কমান্ড শিখবেন।

আপনি 50+ এর বেশি লিনাক্স কমান্ড জানতে পারবেন যা আপনাকে লিনাক্স পাওয়ার ব্যবহারকারীতে রূপান্তরিত করবে। বেসিক থেকে অ্যাডভান্স পর্যন্ত, এই কমান্ডগুলি আপনার পথে আসা যেকোনো কাজ মোকাবেলা করার জন্য আপনার গো-টু টুল হয়ে উঠবে।

প্রধান টেকওয়ে

  • লিনাক্স কমান্ড উদ্দেশ্য অনুসারে সংগঠিত হয়:ফাইল ব্যবস্থাপনা (ls , cp , mv , rm ), প্রক্রিয়া নিয়ন্ত্রণ (ps , kill , top ), ব্যবহারকারীর অনুমতি (chmod , chown , sudo ), এবং নেটওয়ার্কিং (ssh , ping , wget )।
  • man কমান্ড যেকোন লিনাক্স কমান্ডের জন্য অন্তর্নির্মিত ডকুমেন্টেশন প্রদান করে এবং যখন আপনার সিনট্যাক্স বা বিকল্পের বিবরণের প্রয়োজন হয় তখন এটি প্রাথমিক রেফারেন্স।
  • grep ব্যবহার করুন পাঠ্য আউটপুট বা ফাইল অনুসন্ধান করতে, head /tail ফাইলের বিষয়বস্তুর পূর্বরূপ দেখতে, এবং diff /cmp ফাইল তুলনা করতে।
  • ফাইল অনুমতি chmod দিয়ে পরিচালিত হয় (মোড বিট পরিবর্তন করুন) এবং chown (মালিক পরিবর্তন করুন), যা সার্ভারের নিরাপত্তা এবং অ্যাক্সেস নিয়ন্ত্রণের জন্য গুরুত্বপূর্ণ।
  • কমান্ড যেমন tar , zip , এবং unzip সংরক্ষণাগার এবং কম্প্রেশন হ্যান্ডেল; ssh এবং scp নিরাপদ দূরবর্তী অ্যাক্সেস এবং ফাইল স্থানান্তর পরিচালনা করুন।
  • প্রসেস ম্যানেজমেন্ট কমান্ড (ps , kill , killall , top ) সিস্টেমের স্বাস্থ্য নিরীক্ষণ এবং প্রতিক্রিয়াশীল প্রক্রিয়াগুলি বন্ধ করার জন্য অপরিহার্য৷

পূর্বশর্ত

আমরা একটি উবুন্টু সার্ভারে এই কমান্ডগুলি চালাব, তবে আপনি যেকোনো আধুনিক লিনাক্স বিতরণে অনুসরণ করতে পারেন। আপনি এই টিউটোরিয়ালের জন্য একটি উবুন্টু সার্ভার সেট আপ করতে পারেন উবুন্টুতে প্রাথমিক সার্ভার সেটআপের জন্য আমাদের নির্দেশিকা অনুসরণ করে৷

DigitalOcean অ্যাপ প্ল্যাটফর্ম ব্যবহার করে GitHub থেকে আপনার ফ্রন্টএন্ড অ্যাপ্লিকেশনগুলি স্থাপন করুন। DigitalOcean কে আপনার অ্যাপ স্কেল করার উপর ফোকাস করতে দিন।

আসুন সরাসরি এতে প্রবেশ করি!

নিয়মিত ব্যবহারকারী হিসাবে আপনাকে অবশ্যই জানতে হবে শীর্ষ 50টি লিনাক্স কমান্ড

  1. ls - ডিরেক্টরি তালিকাভুক্ত করার জন্য লিনাক্সে সর্বাধিক ব্যবহৃত কমান্ড
  2. pwd - লিনাক্সে প্রিন্ট ওয়ার্কিং ডিরেক্টরি কমান্ড
  3. cd - ডিরেক্টরির মাধ্যমে নেভিগেট করার জন্য লিনাক্স কমান্ড
  4. mkdir - লিনাক্সে ডিরেক্টরি তৈরি করতে ব্যবহৃত কমান্ড
  5. mv - লিনাক্সে ফাইলগুলি সরান বা পুনঃনামকরণ করুন
  6. cp - mv এর মতোই ব্যবহার কিন্তু Linux-এ ফাইল কপি করার জন্য
  7. rm - ফাইল বা ডিরেক্টরি মুছুন
  8. স্পর্শ করুন - খালি/খালি ফাইল তৈরি করুন
  9. ln - অন্যান্য ফাইলে প্রতীকী লিঙ্ক (শর্টকাট) তৈরি করুন
  10. পরিষ্কার - টার্মিনাল ডিসপ্লে সাফ করুন
  11. বিড়াল - টার্মিনালে ফাইলের বিষয়বস্তু প্রদর্শন করুন
  12. প্রতিধ্বনি - যে কোনো টেক্সট প্রিন্ট করুন যা কমান্ড অনুসরণ করে
  13. কম - টার্মিনালে পৃষ্ঠাযুক্ত আউটপুট প্রদর্শনের জন্য লিনাক্স কমান্ড
  14. মানুষ - সমস্ত লিনাক্স কমান্ডের জন্য ম্যানুয়াল পৃষ্ঠাগুলি অ্যাক্সেস করুন
  15. নাম - ওএস সম্পর্কে প্রাথমিক তথ্য পেতে লিনাক্স কমান্ড
  16. whoami - সক্রিয় ব্যবহারকারীর নাম পান
  17. tar - লিনাক্সে ফাইল এক্সট্র্যাক্ট এবং কম্প্রেস করার কমান্ড
  18. grep - একটি আউটপুটের মধ্যে একটি স্ট্রিং অনুসন্ধান করুন
  19. মাথা - উপরে থেকে নির্দিষ্ট সংখ্যক লাইন ফেরত দিন
  20. লেজ - নিচ থেকে নির্দিষ্ট সংখ্যক লাইন রিটার্ন করুন
  21. পার্থক্য - দুটি ফাইলের মধ্যে পার্থক্য খুঁজুন
  22. cmp - আপনাকে দুটি ফাইল অভিন্ন কিনা তা পরীক্ষা করার অনুমতি দেয়
  23. com - diff এবং cmp
  24. এর কার্যকারিতা একত্রিত করে
  25. বাছাই - আউটপুট করার সময় একটি ফাইলের বিষয়বস্তু বাছাই করার জন্য Linux কমান্ড
  26. রপ্তানি - লিনাক্সে পরিবেশের ভেরিয়েবল রপ্তানি করুন
  27. zip - লিনাক্সে জিপ ফাইল
  28. আনজিপ করুন - লিনাক্সে ফাইল আনজিপ করুন
  29. ssh - লিনাক্সে সিকিউর শেল কমান্ড
  30. পরিষেবা - পরিষেবাগুলি শুরু এবং বন্ধ করার জন্য লিনাক্স কমান্ড
  31. ps - সক্রিয় প্রক্রিয়া প্রদর্শন করুন
  32. হত্যা এবং হত্যা - প্রসেস আইডি বা নাম দিয়ে সক্রিয় প্রক্রিয়াগুলিকে হত্যা করুন
  33. df - ডিস্ক ফাইল সিস্টেম তথ্য প্রদর্শন করুন
  34. মাউন্ট - লিনাক্সে ফাইল সিস্টেম মাউন্ট করুন
  35. chmod - ফাইলের অনুমতি পরিবর্তন করার আদেশ
  36. chown - ফাইল বা ফোল্ডারের মালিকানা প্রদানের আদেশ
  37. ifconfig - নেটওয়ার্ক ইন্টারফেস এবং IP ঠিকানা প্রদর্শন করুন
  38. traceroute - গন্তব্যে পৌঁছানোর জন্য সমস্ত নেটওয়ার্ক হপস ট্রেস করুন
  39. wget - ইন্টারনেট থেকে সরাসরি ডাউনলোড ফাইল
  40. ufw - ফায়ারওয়াল কমান্ড
  41. iptables - অন্যান্য সকল ফায়ারওয়াল ইউটিলিটির সাথে ইন্টারফেস করার জন্য বেস ফায়ারওয়াল
  42. apt, pacman, yum, rpm - ডিস্ট্রিবিউশনের উপর নির্ভর করে প্যাকেজ ম্যানেজার
  43. সুডো - লিনাক্সে সুযোগ-সুবিধা বাড়ানোর নির্দেশ
  44. cal - একটি কমান্ড লাইন ক্যালেন্ডার দেখুন
  45. উনাম - আপনার নিয়মিত ব্যবহৃত কমান্ডের জন্য কাস্টম শর্টকাট তৈরি করুন
  46. dd৷ - প্রধানত বুটযোগ্য USB স্টিক তৈরি করার জন্য ব্যবহৃত হয়
  47. কোথায় আছে - একটি কমান্ডের জন্য বাইনারি, উত্স এবং ম্যানুয়াল পৃষ্ঠাগুলি সনাক্ত করুন
  48. কি - একটি কমান্ড কি জন্য ব্যবহৃত হয় তা খুঁজুন
  49. শীর্ষ - সক্রিয় প্রক্রিয়াগুলি তাদের সিস্টেম ব্যবহারের সাথে লাইভ দেখুন
  50. useradd এবং usermod - একটি নতুন ব্যবহারকারী যোগ করুন বা বিদ্যমান ব্যবহারকারীর ডেটা পরিবর্তন করুন
  51. passwd - বিদ্যমান ব্যবহারকারীদের জন্য পাসওয়ার্ড তৈরি বা আপডেট করুন

ফাইল এবং ডিরেক্টরি কমান্ড

কমান্ড বিবরণ উদাহরণ lsList ডিরেক্টরি বিষয়বস্তু।ls cd চেঞ্জ ডিরেক্টরি।cd /path/to/directory pwd বর্তমান ডিরেক্টরি দেখান।pwd mkdir একটি নতুন ডিরেক্টরি তৈরি করুন।mkdir new_directory rmdir একটি খালি ডিরেক্টরি সরান।rmdir empty_directory rm ফাইল বা ডিরেক্টরি মুছুন।rm file.txt স্পর্শ একটি খালি ফাইল তৈরি করুন৷touch new_file.txt৷ cpকপি ফাইল বা ডিরেক্টরি।cp file.txt /path/to/destination mvMove বা ফাইলের নাম পরিবর্তন করুন।mv file.txt /path/to/new_location catDisplay ফাইলের বিষয়বস্তু।cat file.txt টার্মিনালে nano / vimEdit ফাইল।nano file.txt একটি ডিরেক্টরি অনুক্রমে ফাইলের জন্য অনুসন্ধান করুন৷find . -name "file.txt"৷ grep প্যাটার্ন ব্যবহার করে পাঠ্য অনুসন্ধান করুন।grep "pattern" file.txt tarArchive এবং ফাইল কম্প্রেস করুন।tar -cvf archive.tar file1.txt file2.txt df ফাইল সিস্টেমের ডিস্ক ব্যবহার দেখান।df duShow ডিরেক্টরি/ফাইলের আকার।du -sh /path/to/directory chmod ফাইলের অনুমতি পরিবর্তন করুন।chmod 755 file.txt chown ফাইলের মালিক পরিবর্তন করুন।chown user:group file.txt মাউন্ট মাউন্ট একটি ফাইল সিস্টেম।mount /dev/sdb1 /mnt umount একটি ফাইল সিস্টেম আনমাউন্ট করুন।umount /mnt

নেটওয়ার্কিং কমান্ড

কমান্ড বিবরণ নমুনা ব্যবহার একটি হোস্টের সাথে পিংটেস্ট সংযোগ।ping google.com ifconfig / ip aDisplay নেটওয়ার্ক ইন্টারফেস।ifconfig অথবা ip a netstat / ss নেটওয়ার্ক সংযোগগুলি দেখান৷netstat -tuln৷ অথবা ss -tuln wget HTTP/FTP এর মাধ্যমে ফাইল ডাউনলোড করুন।wget http://example.com/file.zip ইউআরএল সিনট্যাক্স ব্যবহার করে কার্ল ট্রান্সফার ডেটা।curl -O http://example.com/file.zip nc (Netcat)নেটওয়ার্ক ডিবাগিং এবং ডেটা স্থানান্তর।nc -zv 192.168.1.1 80 tcpdump নেটওয়ার্ক প্যাকেট ক্যাপচার এবং বিশ্লেষণ করুন।tcpdump -i eth0 iptables ফায়ারওয়াল নিয়ম কনফিগার করুন।iptables -A INPUT -p tcp --dport 22 -j ACCEPT traceroute একটি নেটওয়ার্ক হোস্টে যে পাথ প্যাকেটগুলি নিয়ে যায় তা ট্রেস করুন৷traceroute example.com ডোমেন নাম বা আইপি ঠিকানা ম্যাপিং পেতে nslookupQuery DNS।nslookup example.com sshসুরক্ষিতভাবে দূরবর্তী হোস্টের সাথে সংযোগ করুন।ssh user@example.com

প্রক্রিয়া এবং সিস্টেম মনিটরিং কমান্ড

কমান্ড বিবরণ উদাহরণ কমান্ড psচলমান প্রক্রিয়াগুলি দেখান৷ps aux৷ টপডাইনামিক প্রসেস ভিউয়ার।top htop শীর্ষের উন্নত সংস্করণ।htop kill একটি প্রক্রিয়ায় একটি সংকেত পাঠান।kill <PID> killallKill প্রসেস নামের মাধ্যমে।killall <process_name> আপটাইম সিস্টেম আপটাইম এবং লোড।uptime whoami বর্তমান লগ-ইন ব্যবহারকারী।whoami envDisplay এনভায়রনমেন্ট ভেরিয়েবল।env একটি প্রক্রিয়ার straceTrace সিস্টেম কল।strace -p <PID> systemctl systemd পরিষেবাগুলি পরিচালনা করুন৷systemctl status <service_name>৷ journalctlView সিস্টেম লগ।journalctl -xe ফ্রি ডিসপ্লে মেমরি ব্যবহার।free -h vmstat প্রতিবেদন ভার্চুয়াল মেমরি পরিসংখ্যান।vmstat 1 iostatReport CPU এবং I/O পরিসংখ্যান।iostat lsofপ্রসেস দ্বারা ফাইল খুলুন।lsof dmesgPrint কার্নেল রিং বাফার বার্তা।dmesg

ব্যবহারকারী এবং অনুমতি ব্যবস্থাপনা কমান্ড

কমান্ড বিবরণ উদাহরণ কমান্ড passwd ব্যবহারকারীর পাসওয়ার্ড পরিবর্তন করুন।passwd <username> adduser / useraddএকজন নতুন ব্যবহারকারী যোগ করুন।adduser <username> অথবা useradd <username> deluser / userdel একজন ব্যবহারকারীকে মুছুন।deluser <username> অথবা userdel <username> usermod ব্যবহারকারীর অ্যাকাউন্ট মডিফাই করুন।usermod -aG <group> <username> গ্রুপ গ্রুপ সদস্যতা দেখান।groups <username> রুট হিসাবে sudoExecute কমান্ড।sudo <command> ব্যবহারকারীর পাসওয়ার্ড মেয়াদোত্তীর্ণ তথ্য পরিবর্তন করুন।chage -l <username> idDisplay ব্যবহারকারী পরিচয় তথ্য।id <username> newgrp একটি নতুন গ্রুপে লগ ইন করুন।newgrp <group>

ফাইল স্থানান্তর এবং সিঙ্ক্রোনাইজেশন কমান্ড

কমান্ড বিবরণ উদাহরণ কমান্ড scpসুরক্ষিতভাবে SSH এর মাধ্যমে ফাইল কপি করুন।scp user@remote:/path/to/file /local/destination rsync দক্ষতার সাথে ফাইল এবং ডিরেক্টরি সিঙ্ক করুন।rsync -avz /local/directory/ user@remote:/path/to/destination ftp ফাইল ট্রান্সফার প্রোটোকল ব্যবহার করে ফাইল ট্রান্সফার করুন।ftp ftp.example.com sftp SSH ফাইল ট্রান্সফার প্রোটোকল ব্যবহার করে নিরাপদে ফাইল স্থানান্তর করুন।sftp user@remote:/path/to/file wget ওয়েব থেকে ফাইল ডাউনলোড করুন।wget http://example.com/file.zip কার্ল থেকে বা সার্ভারে ডেটা স্থানান্তর করুন।curl -O http://example.com/file.zip

টেক্সট প্রসেসিং কমান্ড

কমান্ড বিবরণ উদাহরণ কমান্ড awkPattern স্ক্যানিং এবং প্রসেসিং।awk '{print $1}' file.txt পাঠ্য ফিল্টারিং/সংশোধনের জন্য sedStream সম্পাদক।sed 's/old/new/g' file.txt টেক্সটের লাইন থেকে বিভাগগুলি কাটুন।cut -d':' -f1 /etc/passwd টেক্সটের লাইন সাজান।sort file.txt grep টেক্সটে প্যাটার্নের জন্য অনুসন্ধান করুন।grep 'pattern' file.txt wcCount শব্দ, লাইন, এবং অক্ষর।wc -l file.txt পেস্ট ফাইলের লাইন মার্জ করুন।paste file1.txt file2.txt একটি সাধারণ ক্ষেত্রে দুটি ফাইলের লাইন যোগ করুন।join file1.txt file2.txt হেডআউটপুট ফাইলের প্রথম অংশ।head -n 10 file.txt tailoutput ফাইলের শেষ অংশ।tail -n 10 file.txt

শেল ইউটিলিটি এবং শর্টকাট কমান্ড

কমান্ড বিবরণ উদাহরণ কমান্ড alias কমান্ডের জন্য শর্টকাট তৈরি করুন।alias ll='ls -la' unalias একটি উপনাম সরান।unalias ll ইতিহাস পূর্বে প্রবেশ করা কমান্ডগুলি দেখান৷history৷ টার্মিনাল স্ক্রীন সাফ করুন।clear রিবুট সিস্টেম রিবুট করুন।reboot শাটডাউন পাওয়ার বন্ধ করুন।shutdown now date সিস্টেম তারিখ এবং সময় প্রদর্শন বা সেট করুন।date echo পাঠ্যের একটি লাইন প্রদর্শন করুন।echo "Hello, World!" একটি নির্দিষ্ট সময়ের জন্য ঘুম বিলম্ব।sleep 5 সময় কমান্ড কার্যকর করার সময়কাল পরিমাপ করুন।time ls ঘড়ি পর্যায়ক্রমে একটি প্রোগ্রাম চালান, আউটপুট পূর্ণস্ক্রীন দেখাচ্ছে।watch -n 5 df -h

এখন আসুন এই কমান্ডগুলির প্রতিটিতে একটু গভীরভাবে ডুব দেওয়া যাক এবং সেগুলিকে আরও বিশদে বুঝতে পারি। আমাদের কাছে ইতিমধ্যেই সেই স্বতন্ত্র কমান্ডগুলির জন্য অনেকগুলি বিদ্যমান নিবন্ধ রয়েছে। আপনার সুবিধার জন্য, আমরা বিদ্যমান সমস্ত নিবন্ধের লিঙ্ক যোগ করব এবং নতুন বিষয়গুলি কভার করার সাথে সাথে নিবন্ধটি আপডেট করা চালিয়ে যাব।

ls লিনাক্সে কমান্ড

ls কমান্ড বর্তমান কার্যকারী ডিরেক্টরিতে ফাইল এবং ডিরেক্টরি তালিকাভুক্ত করতে ব্যবহৃত হয়। এটি হতে চলেছে সর্বাধিক ব্যবহৃত লিনাক্স কমান্ডগুলির একটি যা আপনার অবশ্যই জানা উচিত৷

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

আপনি উপরের ছবিতে দেখতে পাচ্ছেন, কোনো আর্গুমেন্ট ছাড়াই কমান্ডটি ব্যবহার করা আমাদের ডিরেক্টরির সমস্ত ফাইল এবং ডিরেক্টরি সহ একটি আউটপুট দেবে। কমান্ডটি আউটপুটে ডেটা প্রদর্শনের ক্ষেত্রে অনেক নমনীয়তা প্রদান করে।

ls ব্যবহার করার বিষয়ে আরও জানুন আদেশ

কমান্ড তালিকায় ফিরে যান ↑

pwd লিনাক্সে কমান্ড

pwd কমান্ড আপনাকে আপনার টার্মিনালে বর্তমান কাজের ডিরেক্টরি প্রিন্ট করতে দেয়। এটি একটি খুব মৌলিক কমান্ড এবং এর উদ্দেশ্য খুব ভালোভাবে সমাধান করে।

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

এখন, আপনার টার্মিনাল প্রম্পটে সাধারণত সম্পূর্ণ ডিরেক্টরি থাকা উচিত। কিন্তু এটি না হলে, আপনি যে ডিরেক্টরিতে আছেন সেটি দেখতে এটি একটি দ্রুত কমান্ড হতে পারে। এই কমান্ডের আরেকটি প্রয়োগ হল স্ক্রিপ্ট তৈরি করার সময় যেখানে এই কমান্ডটি আমাদের সেই ডিরেক্টরি খুঁজে পেতে দেয় যেখানে স্ক্রিপ্টটি সংরক্ষিত হয়েছে।

কমান্ড তালিকায় ফিরে যান ↑

cd লিনাক্সে কমান্ড

টার্মিনালের মধ্যে কাজ করার সময়, ডিরেক্টরিগুলির মধ্যে ঘুরে বেড়ানো একটি প্রয়োজনীয়তা। সিডি কমান্ড হল একটি গুরুত্বপূর্ণ লিনাক্স কমান্ড যা আপনাকে অবশ্যই জানতে হবে এবং এটি আপনাকে ডিরেক্টরির মাধ্যমে নেভিগেট করতে সাহায্য করবে। শুধু cd টাইপ করুন নির্দেশিকা অনুসরণ করে, যেমন নীচে দেখানো হয়েছে।

root@ubuntu:~# cd <directory path>

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

আপনি উপরের কমান্ডে দেখতে পাচ্ছেন, আমি কেবল cd /etc/ টাইপ করেছি /etc ডিরেক্টরিতে প্রবেশ করতে। আমরা pwd ব্যবহার করেছি বর্তমান কার্যকারী ডিরেক্টরি প্রিন্ট করার জন্য কমান্ড।

কমান্ড তালিকায় ফিরে যান ↑

mkdir লিনাক্সে কমান্ড

mkdir কমান্ড আপনাকে টার্মিনাল থেকে ডিরেক্টরি তৈরি করতে দেয়।

root@ubuntu:~# mkdir <folder name>

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

আপনি উপরের স্ক্রিনশটে দেখতে পাচ্ছেন, আমরা এই সাধারণ কমান্ড দিয়ে একটি নতুন ডিরেক্টরি তৈরি করেছি।

কমান্ড তালিকায় ফিরে যান ↑

cp এবং mv কমান্ড

cp এবং mv কমান্ডগুলি উইন্ডোজের কপি-পেস্ট এবং কাট-পেস্ট কমান্ডের সমতুল্য। কিন্তু যেহেতু লিনাক্সে ফাইলের নাম পরিবর্তন করার জন্য সত্যিই কোনো কমান্ড নেই, তাই আমরা mvও ব্যবহার করি ফাইল এবং ফোল্ডারের নাম পরিবর্তন করার আদেশ৷

root@ubuntu:~# cp <source> <destination>

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

উপরের কমান্ডে, আমরা নমুনা নামে ফাইলটির একটি অনুলিপি তৈরি করেছি। আসুন দেখি কিভাবে আমরা mv ব্যবহার করি একই পদ্ধতিতে আদেশ।

root@ubuntu:~# mv <source> <destination>

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

উপরের ক্ষেত্রে, যেহেতু আমরা একই ডিরেক্টরির মধ্যে ফাইলটি স্থানান্তর করছিলাম, এটি একটি পুনঃনাম হিসাবে কাজ করেছে। ফাইলের নাম এখন পরিবর্তন করা হয়েছে৷

কমান্ড তালিকায় ফিরে যান ↑

rm লিনাক্সে কমান্ড

পূর্ববর্তী বিভাগে, আমরা নমুনা-কপি ফাইলটি মুছে দিয়েছি। rm কমান্ডটি ফাইল এবং ফোল্ডারগুলি মুছে ফেলার জন্য ব্যবহৃত হয় এবং এটি একটি গুরুত্বপূর্ণ Linux কমান্ড যা আপনার অবশ্যই জানা উচিত৷

root@ubuntu:~# rm <file name>

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

একটি ডিরেক্টরি মুছে ফেলতে, আপনাকে অবশ্যই -r যোগ করতে হবে এটা যুক্তি. -r ছাড়া যুক্তি, rm কমান্ড ডিরেক্টরি মুছে ফেলবে না।

root@ubuntu:~# rm -r <folder/directory name>

-r rm-এ পতাকা লিনাক্সে কমান্ড মানে “রিকারসিভ ” যখন rm এর সাথে ব্যবহার করা হয় কমান্ড, এটি শুধুমাত্র নির্দিষ্ট ফাইলই নয় বরং এর সমস্ত সাবডিরেক্টরি এবং সেই সাবডিরেক্টরিগুলির মধ্যে থাকা ফাইলগুলিকে বারবার মুছে ফেলবে৷

দ্রষ্টব্য: rm ব্যবহার করার সময় সতর্কতা অবলম্বন করা গুরুত্বপূর্ণ -r দিয়ে কমান্ড পতাকা, কারণ এটি দ্রুত এবং স্থায়ীভাবে বিপুল সংখ্যক ফাইল এবং ডিরেক্টরি মুছে ফেলতে পারে। -i ব্যবহার করা একটি ভাল ধারণা -r এর সাথে পতাকা পতাকা, যা প্রতিটি ফাইল এবং ডিরেক্টরি মুছে ফেলার আগে আপনাকে নিশ্চিতকরণের জন্য অনুরোধ করবে৷

উদাহরণস্বরূপ, mydir সরাতে ডিরেক্টরি এবং নিশ্চিতকরণের সাথে এর বিষয়বস্তু, আপনি এই কমান্ডটি ব্যবহার করতে পারেন:

root@ubuntu:~# rm -ri mydir

mydir-এর মধ্যে প্রতিটি ফাইল এবং ডিরেক্টরি মুছে ফেলার আগে এটি আপনাকে নিশ্চিতকরণের জন্য অনুরোধ করবে ডিরেক্টরি।

কমান্ড তালিকায় ফিরে যান ↑

touch লিনাক্সে কমান্ড

touch লিনাক্সে কমান্ড একটি খালি ফাইল তৈরি করে বা বিদ্যমান ফাইলের টাইমস্ট্যাম্প আপডেট করে।

root@ubuntu:~# touch <file name>

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

কমান্ড তালিকায় ফিরে যান ↑

ln লিনাক্সে কমান্ড

অন্য ফাইলে একটি লিঙ্ক তৈরি করতে, আমরা ln ব্যবহার করি আদেশ আপনি যদি লিনাক্স অ্যাডমিনিস্ট্রেটর হিসাবে কাজ করার পরিকল্পনা করছেন তবে এটি সবচেয়ে গুরুত্বপূর্ণ Linux কমান্ডগুলির মধ্যে একটি যা আপনার জানা উচিত৷

root@ubuntu:~# ln -s <source path> <link name>

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

-s পতাকা একটি সিম্বলিক লিঙ্ক তৈরি করে একটি ফাইল বা ডিরেক্টরিতে (একটি সিমলিঙ্ক বা সফ্ট লিঙ্ক হিসাবেও পরিচিত)। একটি প্রতীকী লিঙ্ক হল একটি বিশেষ ধরনের ফাইল যা অন্য ফাইল বা ডিরেক্টরিতে শর্টকাট বা পয়েন্টার হিসেবে কাজ করে।

ডিফল্টরূপে, ln কমান্ড হার্ড লিঙ্ক তৈরি করবে প্রতীকী বা নরম লিঙ্কের পরিবর্তে।

দ্রষ্টব্য: বলুন আপনার একটি টেক্সট ফাইল আছে। আপনি যদি একটি সিম্বলিক লিঙ্ক করেন সেই ফাইলটিতে, লিঙ্কটি শুধুমাত্র মূল ফাইলের একটি পয়েন্টার। আপনি যদি আসল ফাইলটি মুছে ফেলেন তবে লিঙ্কটি ভেঙে যাবে, কারণ এটিতে আর নির্দেশ করার কিছু নেই৷

একটি হার্ড লিঙ্ক হুবহু একই বিষয়বস্তু সহ একটি আসল ফাইলের একটি মিরর কপি। সিম্বলিক লিঙ্কের মতো, আপনি যদি মূল ফাইলের বিষয়বস্তু সম্পাদনা করেন, সেই পরিবর্তনগুলি হার্ড লিঙ্কে প্রতিফলিত হবে। আপনি যদি আসল ফাইলটি মুছে ফেলেন, যদিও, হার্ড লিঙ্কটি এখনও কাজ করবে, এবং আপনি এটি দেখতে এবং সম্পাদনা করতে পারবেন যেভাবে আপনি মূল ফাইলের একটি সাধারণ অনুলিপি করবেন৷

সফট এবং হার্ড লিঙ্ক সম্পর্কে আরও জানুন।

কমান্ড তালিকায় ফিরে যান ↑

clear লিনাক্সে কমান্ড

clear লিনাক্সে কমান্ড টার্মিনাল স্ক্রীন পরিষ্কার করে। এটি বর্তমানে টার্মিনালে প্রদর্শিত সমস্ত পাঠ্য এবং আউটপুট সরিয়ে দেয় এবং আপনাকে কাজ করার জন্য একটি পরিষ্কার স্লেট দেয়৷

কিভাবে clear ব্যবহার করতে হয় তার একটি উদাহরণ এখানে দেওয়া হল কমান্ড:

root@ubuntu:~# clear

এটি টার্মিনাল স্ক্রীন পরিষ্কার করবে এবং কার্সারটিকে স্ক্রিনের উপরের-বাম কোণায় নিয়ে যাবে।

এছাড়াও আপনি clear ব্যবহার করতে পারেন অন্যান্য কমান্ডের সাথে একত্রিত কমান্ড, যেমন:

root@ubuntu:~# ls -l; clear

এটি বর্তমান ডিরেক্টরিতে ফাইল এবং ডিরেক্টরিগুলিকে তালিকাভুক্ত করবে এবং তারপরে টার্মিনাল স্ক্রীনটি সাফ করবে৷

দ্রষ্টব্য: clear কমান্ড আপনার সিস্টেম থেকে কোনো ফাইল বা ডেটা মুছে দেয় না। এটি শুধুমাত্র টার্মিনালের প্রদর্শনকে প্রভাবিত করে৷

cat , echo , এবং less কমান্ড

যখন আপনি একটি ফাইলের বিষয়বস্তু আউটপুট করতে চান বা টার্মিনাল আউটপুটে কিছু মুদ্রণ করতে চান, আমরা cat ব্যবহার করি অথবা echo আদেশ আসুন তাদের মৌলিক ব্যবহার দেখি।

root@ubuntu:~# cat <file name>
root@ubuntu:~# echo <Text to print on terminal>

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

আপনি উপরের উদাহরণে দেখতে পাচ্ছেন, cat কমান্ড, যখন আমাদের New-File এ ব্যবহার করা হয় , ফাইলের বিষয়বস্তু প্রিন্ট করে। একই সময়ে, যখন আমরা echo ব্যবহার করি কমান্ড, এটি কমান্ডের পরে যা অনুসরণ করে তা কেবল প্রিন্ট করে।

less কমান্ড ব্যবহার করা হয় যখন কোনো কমান্ড দ্বারা প্রিন্ট করা আউটপুট স্ক্রীন স্পেসের চেয়ে বড় হয় এবং স্ক্রল করার প্রয়োজন হয়। less কমান্ড ব্যবহারকারীকে আউটপুট ভাঙতে এবং এন্টার বা স্পেস কী ব্যবহার করে স্ক্রোল করতে দেয়।

এটি করার সহজ উপায় হল পাইপ অপারেটর (|) ব্যবহার করা )।

root@ubuntu:~# cat /boot/grub/grub.cfg | less

দ্রষ্টব্য: -S ব্যবহার করুন less সহ পতাকা লাইন মোড়ানো সক্ষম করতে। এটি আপনাকে অনুভূমিকভাবে স্ক্রোল না করে পাঠ্যের দীর্ঘ লাইন দেখতে দেয়৷

-N ব্যবহার করুন less সহ পতাকা লাইন সংখ্যা প্রদর্শন করতে। আপনি যখন একটি নির্দিষ্ট অংশের পাঠ্যের লাইন নম্বর জানতে চান তখন এটি কার্যকর হতে পারে।

আপনি নিম্নলিখিত উপায়ে এই দরকারী পতাকাগুলি ব্যবহার করতে পারেন:

root@ubuntu:~# cat /boot/grub/grub.cfg | less -SN

less ব্যবহার করা হচ্ছে পাইপ অপারেটরের সাথে বিভিন্ন পরিস্থিতিতে উপযোগী হতে পারে। এখানে কয়েকটি উদাহরণ রয়েছে:

  • দীর্ঘ-চলমান কমান্ডের আউটপুট দেখা, যেমন top অথবা htop .
  • কমান্ডের আউটপুটে নির্দিষ্ট পাঠ্য অনুসন্ধান করা, যেমন grep অথবা cat .

কমান্ড তালিকায় ফিরে যান ↑

man লিনাক্সে কমান্ড

man কমান্ড একটি খুব দরকারী লিনাক্স কমান্ড যা অবশ্যই জানা উচিত। লিনাক্সের সাথে কাজ করার সময়, আমরা যে প্যাকেজগুলি ডাউনলোড করি সেগুলিতে অনেক কার্যকারিতা থাকতে পারে। এটা সব জানা অসম্ভব।

man লিনাক্সে কমান্ড একটি নির্দিষ্ট কমান্ডের জন্য ম্যানুয়াল পৃষ্ঠা প্রদর্শন করতে ব্যবহৃত হয়। এটি কমান্ড সম্পর্কে বিস্তারিত তথ্য প্রদান করে, এর সিনট্যাক্স, বিকল্প এবং উদাহরণ সহ।

man কীভাবে ব্যবহার করবেন তার একটি উদাহরণ এখানে দেওয়া হল কমান্ড:

  1. টার্মিনাল খুলুন এবং man ls টাইপ করুন ls-এর জন্য ম্যানুয়াল পৃষ্ঠা প্রদর্শন করতে আদেশ।
root@ubuntu:~# man ls

এটি একটি পৃষ্ঠা প্রদর্শন করবে যা দেখতে এইরকম কিছু দেখাবে:

LS(1) User Commands LS(1)
NAME
 ls - list directory contents
SYNOPSIS
 ls [OPTION]... [FILE]...
DESCRIPTION
 List information about the FILEs (the current directory by default).
 Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.
 Mandatory arguments to long options are mandatory for short options too.
 -a, --all
 do not ignore entries starting with .
 -A, --almost-all
 do not list implied . and ..
 -c with -lt: sort by, and show, ctime (time of last modification
 of file status information) with -l: show ctime and sort
 by name; 
...

কমান্ড তালিকায় ফিরে যান ↑

uname এবং whoami কমান্ড

uname এবং whoami কমান্ডগুলি আপনাকে কিছু মৌলিক তথ্য অ্যাক্সেস করার অনুমতি দেয় যা আপনি যখন একাধিক সিস্টেমে কাজ করেন তখন কাজে আসে৷

uname লিনাক্সে কমান্ড কার্নেলের নাম, হোস্টনাম, কার্নেল রিলিজ, কার্নেল সংস্করণ এবং মেশিন হার্ডওয়্যার নাম সহ সিস্টেমের কার্নেল সম্পর্কে তথ্য প্রদর্শন করে।

whoami লিনাক্সে কমান্ড বর্তমান ব্যবহারকারীর ব্যবহারকারীর নাম প্রদান করে। এর অর্থ হল "আমি কে?" এবং এটি প্রায়শই শেল স্ক্রিপ্ট বা টার্মিনালে বর্তমান ব্যবহারকারীর পরিচয় নির্ধারণ করতে ব্যবহৃত হয়।

আসুন আমরা উভয় কমান্ডের আউটপুট এবং কিভাবে আমরা এইগুলি ব্যবহার করতে পারি তা দেখি।

root@ubuntu:~# uname -a

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

প্যারামিটার -a uname সহ কমান্ড মানে "সব"। এটি সম্পূর্ণ তথ্য প্রিন্ট করে। যদি প্যারামিটার যোগ না করা হয়, তাহলে আপনি আউটপুট হিসাবে যা পাবেন তা হল “Linux”।

দ্রষ্টব্য: কিছু গুরুত্বপূর্ণ পতাকা যা আপনি uname এর সাথে ব্যবহার করতে পারেন আদেশ৷

  1. uname -s ব্যবহার করুন কার্নেলের নাম প্রদর্শন করতে।
  2. uname -n ব্যবহার করুন হোস্টনাম প্রদর্শন করতে।
  3. uname -r ব্যবহার করুন কার্নেল রিলিজ প্রদর্শন করতে।
  4. uname -v ব্যবহার করুন কার্নেল সংস্করণ প্রদর্শন করতে।
  5. uname -m ব্যবহার করুন মেশিন হার্ডওয়্যার নাম প্রদর্শন করতে।

কমান্ড তালিকায় ফিরে যান ↑

The tar , zip , এবং unzip কমান্ড

tar লিনাক্সে কমান্ড আর্কাইভ করা ফাইল তৈরি এবং বের করতে ব্যবহৃত হয়। আমরা tar ব্যবহার করে একাধিক ভিন্ন আর্কাইভ ফাইল বের করতে পারি আদেশ৷

একটি সংরক্ষণাগার তৈরি করতে, আমরা -c ব্যবহার করি প্যারামিটার, এবং একটি সংরক্ষণাগার বের করতে, আমরা -x ব্যবহার করি প্যারামিটার দেখা যাক এটা কিভাবে কাজ করে।

#Compress
root@ubuntu:~# tar -cvf <archive name> <files separated by space>
#Extract
root@ubuntu:~# tar -xvf <archive name>

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

প্রথম লাইনে, আমরা Compress.tar নামে একটি সংরক্ষণাগার তৈরি করেছি নিউ-ফাইল এবং নিউ-ফাইল-লিঙ্ক সহ। পরবর্তী কমান্ডে, আমরা সেই ফাইলগুলিকে আর্কাইভ থেকে বের করেছি।

আসুন zip নিয়ে আলোচনা করি এবং unzip আদেশ দুটোই খুব সোজা। আপনি কোনো পরামিতি ছাড়াই এগুলি ব্যবহার করতে পারেন এবং সেগুলি ইচ্ছামত কাজ করবে৷ আসুন নীচে একটি উদাহরণ দেখি।

root@ubuntu:~# zip <archive name> <file names separated by space>
root@ubuntu:~# unzip <archive name>

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

যেহেতু আমাদের কাছে সেই ফাইলগুলি ইতিমধ্যেই একই ডিরেক্টরিতে রয়েছে, তাই unzip কমান্ড সেই ফাইলগুলিকে ওভাররাইট করার আগে আমাদের অনুরোধ করে৷

কমান্ড তালিকায় ফিরে যান ↑

grep লিনাক্সে কমান্ড

grep কমান্ড লিনাক্স এবং ইউনিক্স-ভিত্তিক অপারেটিং সিস্টেমে একটি শক্তিশালী এবং বহুমুখী পাঠ্য অনুসন্ধান সরঞ্জাম। এটি এক বা একাধিক ফাইলে নির্দিষ্ট প্যাটার্ন বা স্ট্রিং অনুসন্ধান করতে পারে এবং অন্যান্য কমান্ডের আউটপুট ফিল্টার করতে পারে।

grep কমান্ডের অর্থ হল "গ্লোবাল রেগুলার এক্সপ্রেশন প্রিন্ট", যা একাধিক লাইন এবং ফাইল জুড়ে রেগুলার এক্সপ্রেশন অনুসন্ধান করার ক্ষমতাকে প্রতিফলিত করে।

root@ubuntu:~# <Any command with output> | grep "<string to find>"

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

এটি কমান্ডের একটি সাধারণ প্রদর্শন ছিল। grep কমান্ড সম্পর্কে আরও জানুন।

কমান্ড তালিকায় ফিরে যান ↑

head এবং tail কমান্ড

বড় ফাইল আউটপুট করার সময়, head এবং tail কমান্ড কাজে আসে। এই কমান্ডগুলি যথাক্রমে একটি ফাইলের শুরু বা শেষ প্রদর্শন করে। এগুলি সাধারণত টেক্সট এডিটরে না খুলেই ফাইলের বিষয়বস্তু দ্রুত দেখতে ব্যবহৃত হয়।

head এবং tail কমান্ড ডিফল্টরূপে একটি ফাইলের প্রথম 10 লাইন প্রদর্শন করে। একটি ভিন্ন সংখ্যক লাইন প্রদর্শন করতে, আপনি -n ব্যবহার করতে পারেন বিকল্প, আপনি প্রদর্শন করতে চান লাইন সংখ্যা অনুসরণ করে.

এখানে head ব্যবহার করার একটি উদাহরণ এবং tail কমান্ড:

root@ubuntu:~# head <file name>
root@ubuntu:~# tail <file name>

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

আপনি দেখতে পাচ্ছেন, হেড কমান্ড ফাইলের উপরের দিক থেকে 10টি লাইন দেখায়।

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

টেইল কমান্ড ফাইল থেকে নীচের 10টি লাইন আউটপুট করে।

এই কমান্ডগুলি একটি ফাইলের বিষয়বস্তু দ্রুত দেখতে, সমস্যা সমাধানের সমস্যাগুলির জন্য রিয়েল-টাইম আপডেটগুলি নিরীক্ষণ করতে, অন্যান্য কমান্ড থেকে ফিল্টার আউটপুট এবং লগ বিশ্লেষণ করতে ব্যবহার করা যেতে পারে৷

কমান্ড তালিকায় ফিরে যান ↑

diff , comm , এবং cmp কমান্ড

diff , comm , এবং cmp লিনাক্স এবং ইউনিক্স-ভিত্তিক অপারেটিং সিস্টেমের ফাইলগুলির তুলনা করতে কমান্ডগুলি ব্যবহার করা হয়। এই কমান্ডগুলি দুটি ফাইলের মধ্যে পার্থক্য সনাক্ত করতে, পরিবর্তনগুলি একত্রিত করতে এবং অন্যান্য ফাইল তুলনামূলক কাজগুলি সম্পাদন করতে ব্যবহার করা যেতে পারে৷

root@ubuntu:~# diff <file 1> <file 2>

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

আপনি উপরে দেখতে পাচ্ছেন, আমরা নতুন-ফাইল-সম্পাদিত ফাইলে "এই লাইনটি সম্পাদনা করা হয়েছে" বলে লেখার একটি ছোট অংশ যুক্ত করেছি।

cmp কমান্ড দুটি ফাইলের তুলনা করতে এবং তাদের মধ্যে ভিন্ন প্রথম বাইট প্রদর্শন করতে ব্যবহৃত হয়। এটি বাইনারি ফাইলগুলির মধ্যে পার্থক্য সনাক্ত করতে বা ফাইলগুলিতে দুর্নীতি পরীক্ষা করতে ব্যবহার করা যেতে পারে৷

root@ubuntu:~# cmp <file 1> <file 2>

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

cmp কমান্ড শুধুমাত্র আমাদের লাইন নম্বর বলে, যা ভিন্ন। প্রকৃত পাঠ্য নয়।

comm কমান্ডটি দুটি সাজানো ফাইলের তুলনা করতে এবং প্রতিটি ফাইলের জন্য অনন্য, সেইসাথে উভয় ফাইলের জন্য সাধারণ লাইনগুলি প্রদর্শন করতে ব্যবহৃত হয়৷

root@ubuntu:~# comm <file 1> <file2>

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

বাম দিকে সারিবদ্ধ পাঠ্যটি শুধুমাত্র file 1-এ উপস্থিত . কেন্দ্র-সারিবদ্ধ পাঠ্যটি শুধুমাত্র file 2-এ উপস্থিত . এবং ডান-সারিবদ্ধ পাঠ্য উভয় ফাইলেই উপস্থিত রয়েছে।

এটির চেহারা অনুসারে, comm যখন আমরা বড় ফাইলগুলি তুলনা করার চেষ্টা করি এবং সবকিছু একসাথে সাজানো দেখতে চাই তখন কমান্ডটি সবচেয়ে বেশি অর্থবহ৷

এই তিনটি কমান্ডই লিনাক্স এবং ইউনিক্স-ভিত্তিক অপারেটিং সিস্টেমের ফাইলগুলির সাথে কাজ করার জন্য প্রয়োজনীয় সরঞ্জাম। কিভাবে diff ব্যবহার করতে হয় তা বোঝার মাধ্যমে , comm , এবং cmp কমান্ড কার্যকরভাবে, আপনি ফাইলগুলির মধ্যে পার্থক্য সনাক্ত করতে পারেন, পরিবর্তনগুলি একত্রিত করতে পারেন এবং অন্যান্য ফাইল তুলনামূলক কাজগুলি সম্পাদন করতে পারেন৷

এই কমান্ডগুলি আপনাকে ফাইলগুলির সমস্যাগুলি সনাক্ত করতে এবং সমাধান করতে, সেইসাথে পরিবর্তনগুলি ট্র্যাক করতে এবং সংস্করণ নিয়ন্ত্রণ বজায় রাখতে সহায়তা করতে পারে। আপনি একজন ডেভেলপার বা সিস্টেম অ্যাডমিনিস্ট্রেটর হোন না কেন, এই কমান্ডগুলি আপনার টুলকিটের একটি অপরিহার্য অংশ৷

কমান্ড তালিকায় ফিরে যান ↑

sort লিনাক্সে কমান্ড

sort লিনাক্স এবং ইউনিক্স-ভিত্তিক অপারেটিং সিস্টেমে একটি টেক্সট ফাইল বা স্ট্যান্ডার্ড ইনপুটে লাইন সাজানোর জন্য কমান্ড ব্যবহার করা হয়। এটি ঊর্ধ্বমুখী বা অবরোহী ক্রমে লাইন বাছাই করতে এবং অন্যান্য সাজানোর ক্রিয়াকলাপ সম্পাদন করতে ব্যবহার করা যেতে পারে, যেমন ক্ষেত্র অনুসারে বাছাই করা বা কাস্টম বাছাই ক্রম ব্যবহার করে৷

sort এর মৌলিক সিনট্যাক্স কমান্ড হল:

root@ubuntu:~# sort <filename>

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

ডিফল্টরূপে, sort কমান্ড লাইনগুলিকে ASCII কোলেটিং সিকোয়েন্সে সাজায় , যা সংখ্যা বা বিশেষ অক্ষর বাছাই করার সময় অপ্রত্যাশিত ফলাফলের দিকে নিয়ে যেতে পারে। সংখ্যার ক্রমানুসারে সংখ্যা সাজাতে, আপনি -n ব্যবহার করতে পারেন বিকল্প।

এখানে -n ব্যবহার করার একটি উদাহরণ বিকল্প:

root@ubuntu:~# sort -n file.txt

উপরের কমান্ডটি লাইনগুলিকে file.txt-এ সাজিয়ে দেবে সংখ্যাগত ক্রমে।

sort -k ব্যবহার করে নির্দিষ্ট ক্ষেত্রের উপর ভিত্তি করে লাইন সাজাতেও কমান্ড ব্যবহার করা যেতে পারে বিকল্প।

এখানে -k ব্যবহার করার একটি উদাহরণ বিকল্প:

root@ubuntu:~# sort -k 2 file.txt

এই কমান্ডটি লাইনগুলিকে file.txt-এ বাছাই করবে দ্বিতীয় ক্ষেত্রের উপর ভিত্তি করে।

sort কমান্ড লিনাক্স এবং ইউনিক্স-ভিত্তিক অপারেটিং সিস্টেমে টেক্সট ফাইলগুলির সাথে কাজ করার জন্য একটি শক্তিশালী এবং নমনীয় টুল। কিভাবে sort ব্যবহার করবেন তা বোঝার মাধ্যমে কমান্ড কার্যকরভাবে, আপনি টেক্সট ফাইলে লাইন বাছাই করতে পারেন, নির্দিষ্ট ক্ষেত্রের উপর ভিত্তি করে লাইন বাছাই করতে পারেন এবং অন্যান্য সাজানোর ক্রিয়াকলাপ সম্পাদন করতে পারেন৷

এই কমান্ডগুলি আপনাকে ডেটা সংগঠিত এবং বিশ্লেষণ করতে এবং অন্যান্য ফাইল ম্যানিপুলেশন কাজগুলি সম্পাদন করতে সহায়তা করতে পারে। আপনি একজন বিকাশকারী বা সিস্টেম প্রশাসক হোন না কেন, sort কমান্ড আপনার টুলকিটের একটি অপরিহার্য অংশ৷

কমান্ড তালিকায় ফিরে যান ↑

export লিনাক্সে কমান্ড

export লিনাক্স এবং ইউনিক্স-ভিত্তিক অপারেটিং সিস্টেমে কমান্ড পরিবেশের ভেরিয়েবল সেট করতে ব্যবহৃত হয়। এনভায়রনমেন্ট ভেরিয়েবলগুলি তথ্য সঞ্চয় করতে ব্যবহৃত হয় যা প্রক্রিয়া বা কমান্ড দ্বারা ব্যবহার করা যেতে পারে।

একবার একটি এনভায়রনমেন্ট ভেরিয়েবল সেট হয়ে গেলে, একই শেলে চলমান যেকোনো প্রক্রিয়া বা কমান্ডের মাধ্যমে এটি অ্যাক্সেস করা যেতে পারে।

এনভায়রনমেন্ট ভেরিয়েবলগুলি বিস্তৃত তথ্য যেমন কনফিগারেশন সেটিংস, ব্যবহারকারীর পছন্দ বা সিস্টেম তথ্য সংরক্ষণ করতে ব্যবহার করা যেতে পারে৷

এখানে export ব্যবহার করার একটি উদাহরণ কমান্ড:

root@ubuntu:~# export <variable name>=<value>

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

export সম্পর্কে আরও জানুন আদেশ

কমান্ড তালিকায় ফিরে যান ↑

ssh লিনাক্সে কমান্ড

ssh লিনাক্স এবং ইউনিক্স-ভিত্তিক অপারেটিং সিস্টেমে কমান্ড একটি দূরবর্তী সার্ভারে একটি নিরাপদ শেল সংযোগ স্থাপন করে। কমান্ড স্থানীয় এবং দূরবর্তী সার্ভারের মধ্যে একটি সুরক্ষিত এনক্রিপ্ট করা সংযোগ প্রদান করে, যা ব্যবহারকারীদের কমান্ড চালাতে এবং নিরাপদে ফাইল স্থানান্তর করতে দেয়।

ssh এর মৌলিক সিনট্যাক্স কমান্ড হল:

root@ubuntu:~ ssh username@remote-server

এই কমান্ডটি একটি ssh প্রতিষ্ঠা করে remote-server এর সাথে সংযোগ username ব্যবহার করে অ্যাকাউন্ট।

ssh কমান্ড বিস্তৃত বিকল্প এবং কনফিগারেশন সমর্থন করে, সহ:

  • প্রমাণিকরণ পদ্ধতি কনফিগার করা (পাসওয়ার্ড, পাবলিক কী, ইত্যাদি)
  • এনক্রিপশন অ্যালগরিদম কনফিগার করা হচ্ছে
  • কম্প্রেশন কনফিগার করা হচ্ছে
  • পোর্ট ফরওয়ার্ডিং কনফিগার করা হচ্ছে
  • Configuring X11 forwarding
  • Configuring SSH keys

The service command in Linux

The service command in Linux is used to manage system services, which are long-running processes that are started at boot time and run in the background. These services are responsible for providing various system functionalities, such as networking, database management, and user authentication.

The service command is used to start, stop, restart, and check the status of these services. It is a front-end to the systemctl command, which is used to manage the systemd service manager.

The basic syntax of the command is as below.

root@ubuntu:~ service ssh status
root@ubuntu:~ service ssh stop
root@ubuntu:~ service ssh start 

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

As you can see in the image, the ssh server is running on our system.

Jump back to commands list ↑

The ps , kill , and killall commands

The ps , kill , and killall commands are all used to manage processes in Linux.

The ps command is used to display information about the current running processes on the system. Here are some examples of using the ps command:

Display a list of all running processes:

root@ubuntu:~ ps -ef

Display a list of all processes for a specific process ID (PID):

root@ubuntu:~ ps -p PID

Let’s see all of this in action:

root@ubuntu:~ ps 
root@ubuntu:~ kill <process ID>
root@ubuntu:~ killall <process name>

For demonstration purposes, we will create a shell script with an infinite loop and will run it in the background.

With the use of the & symbol, we can pass a process into the background. As you can see, a new bash process with PID 14490 is created.

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

Now, to kill a process with the kill command, you can type kill followed by the PID(Process Id) of the process.

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

But if you do not know the process ID and just want to kill the process with the name, you can make use of the killall command.

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

You will notice that PID 14490 stayed active. That is because, both times, we killed the sleep process.

Learn more about the ps command and the kill command.

Jump back to commands list ↑

The df and mount commands

When working with Linux, the df and mount commands are very efficient utilities to mount filesystems and get details of the file system.

The df command is used to display the amount of disk space used and available on the file systems, and the mount command is used to mount a file system or device to a specific directory.

When we say mount , it means that we’ll connect the device to a folder so we can access the files from our filesystem. The default syntax to mount a filesystem is below:

root@ubuntu:~ mount /dev/cdrom /mnt
root@ubuntu:~ df -h

In the above case, /dev/cdrom is the device that needs to be mounted. Usually, a mountable device is found inside the /dev ফোল্ডার mnt is the destination folder to which to mount the device. You can change it to any folder you want, but we have used /mnt as it’s the system’s default folder for mounting devices.

To see the mounted devices and get more information about them, we use the df command. Just typing df will give us the data in bytes, which is not readable. So, we’ll use the -h parameter to make the data human-readable.

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

Jump back to commands list ↑

The chmod and chown commands

The chmod and chown commands are used to modify file permissions and ownership in Linux.

The chmod command is used to change the permissions of a file or directory, and the chown command is used to change the ownership of a file or directory

The default syntax for both the commands is chmod <parameter> filename and chown <user:group> filename

root@ubuntu:~ chmod +x loop.sh
root@ubuntu:~ chmod root:root loop.sh

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

In the above example, we’re adding executable permissions to the loop.sh file with the chmod আদেশ In addition, with the chown command, we’ve made it accessible only to the root user and users within the root group.

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

As you will notice, the root root part is now changed to www-data which is the new user who has full file ownership.

Learn more about the Linux file Permissions and using the chmod command.

Jump back to commands list ↑

The ifconfig and traceroute commands

The ifconfig and traceroute commands manage network interfaces and trace the route of network packets in Linux.

The ifconfig command will give you the list of all the network interfaces along with the IP addresses, MAC addresses and other information about the interface.

root@ubuntu:~ ifconfig

There are multiple parameters that can be used, but we’ll work with the basic command here.

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

The traceroute command is used to trace the route of network packets and determine the path they take to reach a specific destination.

When working with traceroute , you can simply specify the IP address, hostname, or domain name of the endpoint.

root@ubuntu:~ traceroute <destination address>

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

Now, obviously, localhost is just one hop (the network interface itself). You can try this same command with any other domain name or IP address to see all the routers your data packets pass through to reach the destination.

Jump back to commands list ↑

The wget command in Linux

If you want to download a file from within the terminal, the wget command is one of the handiest command-line utilities available. It is one of the important Linux commands you should know when working with source files.

When you specify the link for download, it has to directly be a link to the file. If the file cannot be accessed by the wget command, it will simply download the webpage in HTML format instead of the actual file that you wanted.

Let’s try an example. The basic syntax of the wget command is :

root@ubuntu:~ wget <link to file>

Or,

root@ubuntu:~ wget -c <link to file>

The -c argument allows us to resume an interrupted download.

Jump back to commands list ↑

The ufw and iptables commands

The ufw and iptables commands are used to manage firewalls in Linux.

UFW and IPTables are firewall interfaces for the Linux Kernel’s netfilter firewall. IPTables directly passes firewall rules to Netfilter while UFW configures the rules in IPTables, which then sends those rules to Netfilter.

Why do we need UFW when we have IPTables? Because IPTables is pretty difficult for a newbie. UFW makes things extremely easy. See the below example where we are trying to allow port 80 for our webserver.

root@ubuntu:~# iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
root@ubuntu:~# ufw allow 80

I’m sure you now know why UFW was created! Look at how easy the syntax becomes. Both these firewalls are very comprehensive and can allow you to create any kind of configuration required for your network. Learn at least the basics of UFW or IPTables firewall, as these are the Linux commands you must know.

Learn more about managing firewall with ufw and managing firewall with iptables .

Jump back to commands list ↑

Package Managers in Linux

Different Linux distributions use different package managers. Since we’re working on a Ubuntu server, we have the apt package manager. But for someone working on a Fedora, Red Hat, Arch, or Centos machine, the package manager will be different.

Below are the commands on how to use these package managers on different Linux distributions.

  • Debian and Debian-based distros - apt install <package name>
  • Arch and Arch-based distros - pacman -S <package name>
  • Red Hat and Red Hat-based distros - yum install <package name>
  • Fedora and CentOS - yum install <package>

Getting yourself well versed with the package manager of your distribution will make things much easier for you in the long run. So even if you have a GUI based package management tool installed, try an make use of the CLI based tool before you move on to the GUI utility. Add these to your list of Linux commands you must know.

Jump back to commands list ↑

The sudo command in Linux

“With great power, comes great responsibility” _

This is the quote displayed when a sudo-enabled user(sudoer) first uses the sudo command to escalate privileges. This command is equivalent to logging in as root (based on what permissions you have as a sudoer).

non-root-user@ubuntu:~# sudo <command you want to run>
Password: 

Just add the command sudo before any command that you need to run with escalated privileges, and that’s it. It’s very simple to use, but can also be an added security risk if a malicious user gains access to a sudoer.

Learn more about how to create a new sudo user and how to edit sudoers file.

Jump back to commands list ↑

The cal command in Linux

Have you ever wanted to view the calendar in the terminal? There apparently are people who want it to happen, and well, here it is.

The cal command displays a well-presented calendar on the terminal. Just enter the command cal on your terminal prompt.

root@ubuntu:~# cal
root@ubuntu:~# cal March 2024

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

Although we don’t need it often, it’s a great addition! It’s an amazing option for terminal fans.

Jump back to commands list ↑

The alias command

Do you have some commands that you run very frequently while using the terminal? It could be rm -r or ls -l , or it could be something longer like tar -xvzf .

This is one of the productivity-boosting Linux commands you must know.

If you know a command that you run very often, it’s time to create an alias .

What’s an alias? In simple terms, it’s another name for a command that you’ve defined.

root@ubuntu:~# alias lsl="ls -l"
OR
root@ubuntu:~# alias rmd="rm -r"

Now, every time you enter lsl or rmd in the terminal, you’ll receive the output that you’d have received if you had used the full commands.

The examples here are for really small commands that you can still type by hand every time. But in some situations where a command has too many arguments that you need to type, it’s best to create a shorthand version of the same.

Jump back to commands list ↑

The dd command in Linux

This command was created to convert and copy files from multiple file system formats. In the current day, the command is simply used to create bootable USB for Linux but there still are some things important you can do with the command.

The dd command in Linux is a versatile command used for low-level copying and conversion of data. It stands for “data-description” or “data definition,” and it can be used to copy and convert data between different file formats and storage devices.

For example, if we wanted to back up the entire hard drive as is to another drive, we would use the dd command.

root@ubuntu:~# dd if=/dev/sdb of=/dev/sda

The if and of arguments stand for input file and output file .

It’s a powerful and flexible tool, but it can also be dangerous if not used carefully. Always double-check your syntax and make sure you know what the command will do before executing it.

Jump back to commands list ↑

The whereis and whatis commands

The whereis and whatis commands are used in Linux to search for information about programs and files.

The whereis command locates the binary, source, and manual pages for a specific command or program, and the whatis command displays a short description of a command or program.

root@ubuntu:~# whereis sudo
sudo: /usr/bin/sudo /usr/lib/sudo /usr/share/man/man8/sudo.8.gz

The whatis command gives us an explanation of what a command actually is.

root@ubuntu:~# whatis sudo
sudo (8) - execute a command as another user

Jump back to commands list ↑

The top command in Linux

A few sections earlier, we talked about the ps আদেশ You observed that the ps command will output the active processes and end itself.

The top command is like a CLI version of the task manager in Windows.

The top command in Linux is a system monitoring tool that displays real-time information about system processes and resource usage. It provides a dynamic, real-time view of system activity, including CPU usage, memory usage, and process information.

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

দ্রষ্টব্য: Here are some examples of using the top command:

  • Sort processes by memory usage:
root@ubuntu:~# top -o MEM

This will sort the process list by memory usage, with the most memory-intensive processes at the top.

  • Display detailed information about a specific process:
root@ubuntu:~# top -p PID

Replace PID with the ID of the process you want to inspect.

  • Display a summary of system resource usage:
root@ubuntu:~# top -n 1

This will display a single summary screen of system resource usage.

It’s a powerful and flexible tool for monitoring system activity and troubleshooting performance issues.

Jump back to commands list ↑

The useradd and usermod commands

The useradd and usermod commands are used in Linux to manage user accounts.

The useradd or adduser commands are the exact same commands where adduser is just a symbolic link to the useradd আদেশ This command allows us to create a new user in Linux.

root@ubuntu:~# useradd JournalDev -d /home/JD

The above command will create a new user named JournalDev with the home directory as /home/JD .

The usermod command, on the other hand, is used to modify existing users. You can modify any value of the user including the groups, the permissions, etc.

For example, if you want to add more groups to the user, you can type in:

root@ubuntu:~# usermod JournalDev -a -G sudo, audio, mysql

Jump back to commands list ↑

The passwd command in Linux

Now that you know how to create new users, let’s also set the password for them. The passwd command lets you set the password for your own account, or if you have the permissions, set the password for other accounts.

Here are some examples of using the passwd command:

  • Change the password for the current user:

    root@ubuntu:~# passwd
    

This will prompt you to enter a new password for the current user.

  • Change the password for a specific user:

    root@ubuntu:~# passwd username
    

Replace username with the name of the user whose password you want to change.

  • Force a user to change their password at the next login:

    root@ubuntu:~# passwd -f username
    
  • Set an expiration date for a user’s password:

    root@ubuntu:~# passwd -e -n days -w warndays username
    

Replace days with the number of days before the password expires and warm days with the number of days before the password expires that the user will be warned.

These are just a few examples of using the passwd command in Linux. By understanding how to use this command effectively, you can manage user accounts and ensure that your system is secure.

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড

Jump back to commands list ↑

Common Errors and Debugging

When working with Linux commands, you may encounter various errors and issues. Here are some common problems and how to resolve them:

1. Fixing “command not found” errors

If you receive a command not found error, it means that the command you are trying to run is not recognized by the system. This can happen for several reasons:

  1. The command is not installed on your system. You can install it using your package manager (e.g., apt , yum , dnf ).

    If you see:

    bash: xyz: command not found
    

    Use:

    which xyz
    

    If the command isn’t installed, try installing:

    apt-get install <package-name>
    
  2. The command is not in your system’s PATH. You can add the directory containing the command to your PATH.

    export PATH=$PATH:/path/to/command
    
  3. You made a typo. Double-check the command for any spelling errors.

2. Resolving permission issues with sudo

If you encounter permission issues, you can use sudo to run the command with superuser privileges. যেমন:

sudo command_name

3. Handling File Conflicts

File conflicts can occur when multiple users or processes attempt to modify the same file simultaneously. Here are some ways to handle file conflicts:

  1. Use Version Control Systems (VCS): Tools like Git can help manage file conflicts by allowing users to merge changes and resolve conflicts manually.

    git merge <branch_name>
    

    If there are conflicts, Git will prompt you to resolve them. Open the conflicting files, make the necessary changes, and then commit the resolved files.

    git add <resolved_file>
    git commit -m "Resolved merge conflict"
    
  2. Locking Mechanisms: Implement file locking to prevent multiple processes from writing to the same file simultaneously. Use flock in Linux to create a lock on a file.

    flock -x <file> -c "<command>"
    
  3. Atomic Operations: Use atomic operations to ensure that file writes are completed in a single step, reducing the risk of conflicts.

    mv temp_file target_file
    

    Or, Use mv with -f (force) or cp with -i (interactive):

    mv -f file1 file2
    cp -i file1 file2
    

4. Debugging Performance Bottlenecks

Performance bottlenecks can significantly impact the efficiency of your system. Here are some steps to debug and resolve them:

  1. Identify the Bottleneck: Use tools like top , htop , vmstat , and iostat to monitor system performance and identify the resource causing the bottleneck (CPU, memory, disk I/O, etc.).

    top
    
  2. Analyze Logs: Check system and application logs for any errors or warnings that might indicate performance issues.

    tail -f /var/log/syslog
    
  3. Optimize Code: Review and optimize your code to improve performance. Look for inefficient algorithms, unnecessary computations, and memory leaks.

  4. Profile Your Application: Use profiling tools like gprof , perf , or valgrind to analyze your application’s performance and identify slow functions or memory issues.

    gprof <executable> gmon.out
    
  5. Scale Resources: If the bottleneck is due to resource limitations, consider scaling up your hardware or using load balancing to distribute the load across multiple servers.

FAQs

1. What are the most used Linux commands?

The most used Linux commands include cd , ls , mkdir , rm , cp , mv , echo , cat , grep , find , man , sudo , apt-get , ssh , ping , df , du , free , top , ps , kill , killall , service , systemctl , reboot , shutdown , whoami , uname , uptime , history , and clear .

2. How do I list all available commands in Linux?

You can list all available commands in Linux by using the compgen -c আদেশ This will display a list of all commands that are available on your system.

3. How do I find a file in Linux?

You can find a file in Linux using the find আদেশ The basic syntax is find <path> -name "<filename>" , where <path> is the directory where you want to start searching, and <filename> is the name of the file you’re looking for. For example, find /home/user -name "example.txt" .

4. How do I kill a process in Linux?

You can kill a process in Linux using the kill আদেশ First, you need to find the process ID (PID) of the process you want to kill using the ps or top আদেশ Then, use the kill command followed by the PID. For example, kill 1234 , where 1234 is the PID of the process.

5. What is the difference between cp and mv ?

The cp command is used to copy files or directories, while the mv command is used to move or rename files or directories. cp creates a duplicate of the original file, leaving the original intact, whereas mv moves the file to a new location, removing it from the original location.

6. How do I check my Linux system’s memory usage?

You can check your Linux system’s memory usage using the free আদেশ This command displays the total amount of free and used physical and swap memory in the system. For example, free -h will display the memory usage in a human-readable format.

উপসংহার

In this tutorial, you explored over 50 essential Linux commands covering file and directory management, process control, user permissions, networking, text processing, and shell utilities. You also worked through real-world examples, troubleshooting patterns, and comparisons between related commands.

You can now navigate the Linux filesystem, manage processes, configure permissions, and troubleshoot common issues from the command line. These commands form the foundation of effective Linux system administration and scripting.

To go deeper on specific topics, explore these tutorials:

  • The grep Command in Linux/Unix
  • The ls Command in Linux/Unix
  • Process Management in Linux
  • The ps Command in Linux
  • An Introduction to the Linux Terminal

মাস্টার লিনাক্স:দক্ষ সিস্টেম পরিচালনার জন্য 50+ প্রয়োজনীয় কমান্ড এই ক্রিয়েটিভ লাইসেন্সের অধীনে কাজ করে" অ্যাট্রিবিউশন-অবাণিজ্যিক- শেয়ারঅ্যালাইক 4.0 আন্তর্জাতিক লাইসেন্স।


  1. জাভাস্ক্রিপ্টে বিবৃতিতে...এর জন্য ব্যাখ্যা কর?

  2. কিভাবে HTML <title> এলিমেন্ট ব্যবহার করবেন

  3. কিভাবে Pygal পাইথনে গেজ প্লট তৈরি করতে ব্যবহার করা যেতে পারে?

  4. এইচটিএমএল ডম স্টাইল অ্যানিমেশন ডিরেকশন প্রপার্টি