लिनक्स में सॉफ्टवेयर इंस्टॉल करते समय लोग "गूंज" कमांड का उपयोग क्यों करते हैं?

विषयसूची:

लिनक्स में सॉफ्टवेयर इंस्टॉल करते समय लोग "गूंज" कमांड का उपयोग क्यों करते हैं?
लिनक्स में सॉफ्टवेयर इंस्टॉल करते समय लोग "गूंज" कमांड का उपयोग क्यों करते हैं?

वीडियो: लिनक्स में सॉफ्टवेयर इंस्टॉल करते समय लोग "गूंज" कमांड का उपयोग क्यों करते हैं?

वीडियो: लिनक्स में सॉफ्टवेयर इंस्टॉल करते समय लोग
वीडियो: How to Delete Hard Disk Partition | Merge Partition | Increase Partition Size kaise kare in hindi - YouTube 2024, अप्रैल
Anonim
यदि आप लिनक्स का उपयोग करने के लिए नए हैं, तो इसके कई आदेश और विविधताएं थोड़ा उलझन में लग सकती हैं। उदाहरण के लिए "echo" कमांड लें। सॉफ़्टवेयर इंस्टॉल करते समय लोग इसका उपयोग क्यों करते हैं? आज के सुपर यूज़र क्यू एंड ए पोस्ट में नए लिनक्स उपयोगकर्ता के सवाल का जवाब है।
यदि आप लिनक्स का उपयोग करने के लिए नए हैं, तो इसके कई आदेश और विविधताएं थोड़ा उलझन में लग सकती हैं। उदाहरण के लिए "echo" कमांड लें। सॉफ़्टवेयर इंस्टॉल करते समय लोग इसका उपयोग क्यों करते हैं? आज के सुपर यूज़र क्यू एंड ए पोस्ट में नए लिनक्स उपयोगकर्ता के सवाल का जवाब है।

आज का प्रश्न और उत्तर सत्र हमारे पास सुपरयूसर की सौजन्य है - स्टैक एक्सचेंज का एक उपविभाग, क्यू एंड ए वेब साइट्स का एक समुदाय संचालित समूह।

प्रश्न

सुपर यूज़र रीडर पल्लवबक्षी जानना चाहते हैं कि लोग लिनक्स में सॉफ़्टवेयर इंस्टॉल करते समय "echo" कमांड का उपयोग क्यों करते हैं:

I am new to the computing world. While installing ROS Indigo, the first step said that I should use the following code:

sudo sh -c ‘echo “deb https://packages.ros.org/ros/ubuntu $(lsb_release -sc) main” > /etc/apt/sources.list.d/ros-latest.list’

Why do people use the “echo” command along with “sh -c” in this context? I have seen the “echo” command used in other installation processes as well.

Links I Looked Through

What Exactly is the “sh” Command?

Ubuntu Install of ROS Indigo

लिनक्स में सॉफ़्टवेयर इंस्टॉल करते समय लोग "echo" कमांड का उपयोग क्यों करते हैं?

उत्तर

सुपरयूसर योगदानकर्ता फ्लीट कमांड का जवाब हमारे लिए है:

Ordinarily, the function of the “echo” command is to display a string (piece of text) on the console. But this time, a (greater than) > character is added after the echo command, redirecting its output to a text file located in /etc/apt/sources.list.d/ros-latest.list.

Basically, this whole command writes a piece of text to a text file. Now, here comes the tricky part:

The string written to the file may be different for each computer. The part, $(lsb_release -sc), is resolved (changed into something else) when the “echo” command runs.

You can open /etc/apt/sources.list.d/ros-latest.list in a text editor before and after the command to see the changes for yourself. Keep in mind that the file might not exist before using this command.

स्पष्टीकरण में जोड़ने के लिए कुछ है? टिप्पणियों में विचार व्यक्त करो। अन्य तकनीक-समझदार स्टैक एक्सचेंज उपयोगकर्ताओं से अधिक उत्तरों पढ़ना चाहते हैं? यहां पूर्ण चर्चा धागा देखें।

सिफारिश की: