root

joined 2 years ago
MODERATOR OF
 

Author: Zeenat Zeeshan Fazil

In 2022, the Jammu & Kashmir Police had warned that properties of those who provide shelter to terrorists or terror associates would be attached.

The Special Investigation Unit (SIU) of Jammu and Kashmir police’s CID wing on June 22 attached the house of a person accused for his involvement in terror activities in south Kashmir’s Anantnag district.

“SIU Shopian attached the residential house of a terrorist associate in Subhanpora Bijbhera area of Anantnag district of south Kashmir, after obtaining necessary sanctions from competent authority,” officer investigating the case said.

A residential house of Abdul Rehman Ganai (father of terrorist associate Zubair Ahmad Ganai) has been found used by terrorists of proscribed terror outfit Lashkar-e-Taiba (LeT). The process for attachment of property was initiated by SIU Shopian under Section 25 of Unlawful Activities (Prevention) Act (UAPA).

The officer informed that the course of investigation was registered with Police Station Zainpora in Shopian district under FIR No. 22/2022.

Stern warning to terrorists & their supporters

In 2022, the Jammu & Kashmir Police had warned that properties of those who provide shelter to terrorists or terror associates would be attached.

The attachment of the property serves as a strong message to terrorists and their supporters that their actions will not go unnoticed or unpunished. “It underscores the unwavering commitment of the J&K Police to combating terrorism at its roots and dismantling its infrastructure,” said the SIU officer who wished not to be named for obvious reasons.

On June 15, the State Investigation Unit (SIU) of Jammu and Kashmir Police attached property of land measuring 26 kanals and 4 marlas located at three different locations within the district at Diver Lolab in Kupwara district of North Kashmir.

These properties belong to the Pakistan-based terrorist, Almas Rizwan Khan, originally a resident of Diver Lolab, who has been a persistent threat to peace and security of Jammu and Kashmir since the time he exfiltrated to Pakistan in early 1990s.

 

Author: Amandeep Dixit

Punjab Police recovered four .30 bore pistols after it busted a cross-border weapons smuggling bid in Amritsar on Thursday, June 22.

Punjab Police foiled a major cross-border weapons smuggling bid after recovering four .30 bore pistols from an area in Kakkar village in Amritsar's Lopoke on Thursday, June 22. The consignment of the weapon is suspected to be dropped by drones from across the border.

AIG Counter Intelligence Amritsar, Sukhminder Singh Mann said, "Based on secret information regarding cross-border smuggling of arms and ammunition, a team of Counter-Intelligence Amritsar carried out a search operation in the area of village Kakkar and successfully recovered four pistols along with magazines from a field."

The police official added, "The consignment seems to be delivered via drone but could not be retrieved due to heightened activities of BSF and State Police. The police teams are conducting investigations to identify the sender and retriever of the consignment."

Third weapon-smuggling module busted in less than a week

Pertinently, this is the third such cross-border weapon smuggling module busted by the Amritsar Counter Intelligence team in less than a week, taking the total recovery of weapons to 11 pistols along with ammunition.

Earlier on June 16, CI Amritsar had arrested Rajinder Kumar alias Ghudi, Jagjit Singh, Inderjit Singh alias Malhi, and Jashandeep Singh alias Boora, all residents of Amritsar after recovering four pistols from their possession.

Similarly, on June 19, another person identified as Rajan Singh of Patti, Tarn Taran was arrested with three .32-bore Pistols along with ammunition.

 

Lab-grown diamonds (LGDs) are much in demand now and the Indian government has decided to promote them in a big way to boost the diamond industry, which has its headquarters in Surat in Gujarat.

The 7.5 carat eco-friendly lab-grown diamond, which Prime Minister Narendra Modi gifted to the US First Lady Jill Biden in Washington during his ongoing state visit, has been manufactured in a Surat factory in Gujarat by recreating the same process that takes place beneath the earth in formation of natural diamonds.

Lab-grown diamonds (LGDs) are much in demand now and the Indian government has decided to promote them in a big way to boost the diamond industry, which has its headquarters in Surat in Gujarat.

“Diamonds are formed naturally deep underneath the earth surface, when carbon deposits are subjected to high temperature and pressure. It can take millions of years to form the crystal. Diamonds come to the earth's surface through volcanic eruptions," Chairman of Surat-based Indian Diamond Institute Dinesh Navadiya told PTI.

The process involved in the formation of natural, earth-mined precious stones is adopted in a facility for lab-grown diamonds, he said.

“We procure diamond seed (chips of other diamonds), and then it is subjected to intense heat and pressure along with high carbon-containing gases. Layers of carbon start depositing on seeds and after a month-long process turn out to be a lab-grown diamond,” Navadiya explained.

"Natural diamonds take millions of years to form, while LGDs are manufactured in a matter of a few weeks. There is no difference between the two as the process is the same,” he maintained.

Two technological methods are adopted to produce LGDs -- chemical vapour deposition (CVD) and high pressure, high temperature (HPHT) using a chemical composition.

Talking to PTI in Surat, Asmit Patel, convenor of the Gem & Jewellery Export Promotion Council (GJEPC), said the diamond gifted by Modi to the US First Lady was grown in India using VCD technology that creates the purest form of diamonds.

"The Kohinoor was a type Two A pure diamond. This diamond (gifted by PM) is 7.5 carat, which represents the 75 years of Independence. This diamond was also created using green energy. So that is also a step towards showing that India is moving towards green and renewable energy -- a goal espoused by PM Modi himself," said Patel.

On an average a diamond like this size would take around two months to grow, cut and polish, he said.

"Everyone in the diamond industry is so proud and emotional because this is such a big promotion for everyone in this industry," said Patel.

“We are happy to note that Prime Minister Narendra Modiji gifted 7.5 carat 'green' lab-grown diamond (LGD) to US First Lady Dr Jill Biden during a private dinner at the White House in Washington. This remarkable gesture highlights the exemplary advancements made by India in the lab-grown diamond sector,” said Vipul Shah, chairman, GJEPC, India's apex body supported by the Ministry of Commerce and Industry.

He said India has seen a robust rise in export of LGDs.

“Today, India is the largest player in growing of Chemical Vapor Deposition (CVD) lab-grown diamonds. Presenting a 7.5 carat lab-grown diamond in the 75th year of Independence highlights India's leadership in the LGD sunrise sector. It is also a great example of the Make in India story after attaining undisputed global leadership in natural diamonds. India's exports of LGD has grown exponentially and crossed USD 1.67 billion mark in 2022- 2023," Shah said.

GJEPC lab-grown diamond convenor Smit Patel said India has mastery over the CVD technology and most of the LGDs produced in India are produced using this technique.

“This is like an IVF (in vitro fertilization) baby. After the IVF baby is born, looking at the baby nobody can say the difference. In the same way, diamonds produced using the CVD technology have the same quality, hardness as natural diamond,” Smit Patel said.

He said the 7.5 carat diamond gifted by Modi was manufactured in a Surat-based lab.

Carat is the unit of measurement for the physical weight of diamonds. One carat equals 0.200 grams or 1/5 gram and is subdivided into 100 points.

Lab-made diamonds are developed from a carbon seed placed in a microwave chamber and superheated into a glowing plasma ball. The process creates particles that crystallize into diamonds in weeks, said a report by Prabhudas Lilladher, a research-driven financial services firm.

“Since the 1950s, scientists have been trying to recreate that process above ground - resulting in two techniques. The High Pressure, High Temperature (HPHT) system is where a diamond seed is surrounded by pure graphite (a type of carbon) and exposed to temperatures of about 1,500C and pressurised to approximately 1.5 million pounds per square inch in a chamber," said the report.

The Chemical Vapour Deposition (CVD) process involves putting the seed in a sealed chamber filled with carbon-rich gas and heating to around 800C. The gas sticks to the seed, building up a diamond atom by atom, it explained.

"These days, a one carat diamond - a popular size and common in engagement rings - made in a lab would be around 20 per cent cheaper than its naturally-formed equivalent,” the report said.

India already produces around three million (30 lakh) lab-grown diamonds a year, accounting for 15 per cent of global production, according to the Ministry of Commerce and Industry.

China is the other big producer, with a similar market share, industry experts said.

India witnessed a sharp rise in LGD exports worth USD 443 million which rose 102 per cent year-on-year.

The Prabhudas Lilladher report said even at the start of 2020, lab-grown diamond exports in India were up 60 per cent Y-o-Y, while natural diamond exports were down by 41 per cent Y-o-Y.

 

cross-posted from: https://lemmy.run/post/15061

Author: Eashaan Dhillon

Frank Kendall gave the opening address and said Indo-US ties are growing, & asserted there was enormous potential for startups of both nations to collaborate.

The India-US Defence Acceleration Ecosystem was launched at an event in Washington DC, US, on Wednesday, June 21. The INDUS-X event was co-organised by Innovations for Defence Excellence (iDEX), the Ministry of Defence and the US Department of Defence. It was hosted by the US-India Business Council.

A reception for Indian and US government representatives, defence startups, think tanks, incubators, investors, industries, and other stakeholders was organised on June 20. US Ambassador to India Eric Garcetti gave the keynote address during the reception and said that due to their shared diplomatic ideals, similar political views, and strong inter-ethnic ties, India and the United States have a strong worldwide strategic alliance that spans practically all facets of human effort, and strong strategic, economic, and military links exist between the two nations. The US and India are collaborating to advance harmony and peace in the Indo-Pacific region.

At #INDUSX being hosted at @USChamber, USIBC hosted a substantive discussion on procurement, export controls, and industrial security with government, industry, and academia.

About the Indo-US INDUS X Event

US Secretary of Air Force Frank Kendall, who gave the opening keynote address, said that the India-US partnership is growing exponentially. He emphasised that there was enormous potential for startups of both nations to collaborate in deep tech innovations, especially in the Space and Artificial Intelligence domain (AI).

Anurag Bajpai, Joint Secretary (Defence Industries Promotion), MoD, who led the Indian delegation in the two-day INDUS-X event, in his welcome remarks on ''Investing in the future of India-US defence relations'', hailed the launch of iCET as a landmark event in Indo-US defence ties. As the leaders of the biggest and oldest democracies in the world gather in Washington, he asserted that this is an opportune moment. The idea for a defence innovation bridge is a part of the initiative on critical and emerging technologies unveiled by the national security advisors Ajit Doval and Jake Sullivan in January and the Pentagon said that through INDUS-X, the ties will be strengthened between defence industrial ecosystem to make them more innovative, accessible and resilient.

In addition, the Pentagon also said that both Department of Defence and the Ministry of Defence along with external stakeholders will explore joint challenges for India and US startups that leverage common dual use cases for both the countries. An unprecedented joint presentation of cutting-edge technologies from startups in the US and India was presented during the event. The event also saw a first-of-its-kind joint showcasing of innovative technologies by Indian and American startups. Fifteen Indian and 10 US startups from multiple domains such as maritime, AI, autonomous systems and space showcased their technologies to Indian and US stakeholders.

Senior American officials watched the exhibition, including Congressman RO Khanna, co-chair of the Congressional Caucus on India and Indian Americans, and Radha Iyengar Plumb, deputy undersecretary of defence for acquisition and sustainment for the US Department of Defence. Khanna serves on the House Armed Services Committee. Two panel discussions and two roundtables were held, focussing on deepening collaborations across various domains including export control regulations. INDUS-X will also enhance connectivity between American and Indian defence startups to explore joint opportunities in high-tech defence innovation, research and development, and strengthen bilateral trade relationships and defence establishment linkages.

Also, a group of private stakeholders will engage investors to set up a joint innovation fund, while both governments will explore a public-private partnership model for funding deep tech defence startups. Both India and US also intend to explore standardising certification for technologies developed by defence innovation ecosystems of both countries, to accelerate their absorption. The statement by Pentagon says that the area of focus here will include Quality Assurance parameters, certification standards, and Program success memoranda.

 

Chapter 15, Verse 19

यो मामेवमसम्मूढो जानाति पुरुषोत्तमम् |

स सर्वविद्भजति मां सर्वभावेन भारत ॥19

Transliteration

*yo mām evam asammūḍho jānāti puruṣhottamam

sa sarva-vid bhajati māṁ sarva-bhāvena bhārata*

Word Meanings

yaḥ—who; mām—me; evam—thus; asammūḍhaḥ—without a doubt; jānāti—know; puruṣha-uttamam—the Supreme Divine Personality; saḥ—they; sarva-vit—those with complete knowledge; bhajati—worship; mām—me; sarva-bhāvena—with one’s whole being; bhārata—Arjun, the son of Bharat

Translation

O scion of the Bharata dynasty, he who, being free from delusion, knows Me the supreme Person thus, he is all-knowing and adores Me with his whole being.

 

cross-posted from: https://lemmy.run/post/13868

“India Global Forum’s annual UK-India Week is a highly anticipated fixture in the bilateral calendar of our two great nations,” said UK PM Rishi Sunak.

British Prime Minister Rishi Sunak on Wednesday said he is confident that the India-UK partnership will be a "defining one for our times", as he extended support to the upcoming UK-India Week. Sunak, then UK Chancellor of the Exchequer, was a special guest at the UK-India Awards during last year’s summit when he first spoke about his own Indian heritage and commitment to British Indian values.

In a statement from Downing Street, the 43-year-old leader described the annual event as a catalyst for forging new trade ties and long-term collaborations. “India Global Forum’s annual UK-India Week is a highly anticipated fixture in the bilateral calendar of our two great nations,” said Sunak.

“It is a catalyst for forging new trade ties, lasting collaborations, and a better future for our peoples. I'm confident this partnership will be a defining one for our times,” he said.

UK-India Week 2023 kick-starts with a Young Leaders Forum at the Nehru Centre in London on Saturday and will cover a full spectrum of bilateral issues, from tech and innovation to infrastructure and sustainability at events in London and Windsor. This year marks the fifth edition of the summit and UK-India Awards, which comes just days after the UK government issued a joint outcome statement at the conclusion of the tenth round of free trade agreement (FTA) negotiations with India.

“Technical discussions were held across 10 policy areas over 50 separate sessions. They included detailed draft treaty text discussions in these policy areas,” reads a statement from the Department for Business and Trade (DBT) issued earlier this week.

India and the UK have been negotiating an FTA since January last year, with a goal towards a comprehensive pact that is expected to significantly enhance the bilateral trading relationship, worth an estimated GBP 34 billion in 2022. The 11th round is now scheduled to take place next month, soon after UK-India Week next week.

“Given the geopolitical upheaval and economic turbulence around the world, I believe it is more important now than ever before that the UK and India forge closer and deeper ties. I am, therefore, grateful to Prime Minister Sunak for recognising the role that IGF is playing in bringing our two great democracies closer to unlocking the true potential of the partnership,” said IGF Founder Professor Manoj Ladwa. The six-day series of events will open with an address by Opposition Labour Party Leader Keir Starmer and will also involve interventions by UK Education Secretary Gillian Keegan and India’s Minister of Power, New & Renewable Energy R.K. Singh.

 

On the 21st of June, the Yoga event at UN Headquarters in New York on the International Day of Yoga created a Guinness world record for most nationalities in a Yoga session. The event was led by PM Modi in which 135 nationalities took part.

The Guinness World Records official adjudicator, Michael Empric, said, “Today there was a Guinness World Records title attempt for most nationalities in a Yoga lesson. The mark to be was 140 nationalities. Today in New York, at the UN, they have 135. It is a new Guinness world records title.”

People from all walks of life, prominent New Yorkers, Hollywood celebrities, members of the Indian diaspora, and envoys of over 100 nations, attended the event under PM Modi’s leadership.

PM Modi: Yoga means to unite

At the event, PM Modi said, “I am delighted to see you all and thank you all for coming. I am told that almost every nationality is represented here today and what an amazing cause to bring us together. Yoga means to unite. The coming together in itself is another form of Yoga.”

PM added, “Like all Indian traditions, yoga is dynamic. It is free from royalty, copyright, and patents.”

He stated that you can do it at home, at work, or in transit and it is flexible, you can learn from a teacher or be self-taught.

PM Modi further said, “Yoga is a way of life. A holistic approach to health and well-being. A way to mindfulness in thoughts and actions. A way to live in harmony with self, with others, and with nature.”

Attending the event, New York Mayor Eric Adams said, “Use Yoga to fight against wars, gender violence, food insecurity, and the destruction of our planet.”

Major attendees of the event include the President of the United Nations General Assembly Csaba Korosi, the Mayor of New York City Eric Adams, Deputy Secretary-General of the United Nations Amina J. Mohammed, and the popular American actor Richard Gere among others.

Earlier in the day, India created another Guinness Record on the International Yoga Day event. The Yoga program held in Gujarat’s Surat hosted the largest gathering for a yoga session at one place with 1.53 lakh participants.

Previously, Kota City of Rajasthan made a Guinness record in 2018 when 1,00,984 people participated in a Yoga Day session in one place.

The International Day of Yoga was first celebrated on the 21st of June, 2015, following a call by Indian PM Narendra Modi at the United Nations General Assembly. Overall, this was the 9th edition of International Yoga Day.

 

The Uttar Pradesh Police has filed an FIR against a man identified as Jameel for raping a Hindu woman. The accused posed as a Hindu person named Shailendra to trap the Hindu woman in a love affair and then forced her to marry him. Later, he made the victim a hostage and raped her with his friends.

According to the reports, the incident is said to have taken place in the Raebareli district of Uttar Pradesh. The FIR has been filed by the police based on the complaint filed by the victim woman.

The Hindu victim woman in the complaint said that the accused posed as a Hindu person named Shailendra. He used to meet her when she would go to drop her younger brother at school. One day he expressed his love for her and promised to marry her. He also established sexual relations with her before marriage.

The original identity of the accused was exposed after the duo decided to marry each other in March this year. The woman said that while signing the marriage documents, ‘Shailendra’ wrote his name as Jameel. He also submitted his Aadhaar card during the process which had his original name on it. She said she was shocked when she found out that ‘Shailendra’ belonged to another religion. She tried to refuse to marry him, but she was forced to sign the marriage documents.

As per the reports, the woman was then kept hostage in an unidentified apartment. The accused raped her there and he also allowed his friends to rape her for money. The woman somehow managed to escape from there and reached her family to reveal the shocking sequence of events.

She then registered a police complaint based on which an FIR has been filed in the case. CO Vandana Singh confirmed the incident and stated that the police is looking for the accused. She also said that the girl was forced to change her religion. Further investigations into the case are underway.

 

Introduction to Upanishads

The Upanishads are a collection of ancient philosophical and spiritual texts that form the core teachings of Hinduism. These texts are considered the culmination of Vedic knowledge and are revered for their profound insights into the nature of existence, consciousness, and the ultimate reality. The word "Upanishad" is derived from the Sanskrit root words "upa" (near), "ni" (down), and "shad" (to sit), implying the act of sitting close to a spiritual teacher to receive esoteric knowledge.

Significance of the Upanishads

The Upanishads occupy a central position in Hindu philosophy and have influenced various schools of thought, including Vedanta, Yoga, and Buddhism. These texts delve into profound metaphysical and spiritual concepts, exploring the nature of the self (Atman), the ultimate reality (Brahman), and the interconnectedness of all things. They offer profound meditations on the nature of existence, the purpose of life, and the path to spiritual liberation (Moksha).

Profound Insights and Teachings

The Upanishads provide deep insights into the nature of reality, consciousness, and the human experience. They emphasize the unity of all existence and the interconnectedness of all beings. The texts offer profound teachings on meditation, self-realization, and the nature of the divine. They guide individuals on the quest for self-discovery and spiritual awakening, inviting them to transcend the limitations of the material world and realize their true nature.

Eternal Wisdom and Timeless Relevance

Despite their ancient origins, the wisdom found in the Upanishads remains timeless and relevant. The concepts and teachings presented in these texts continue to inspire seekers and spiritual aspirants across the globe. The Upanishads provide a comprehensive understanding of the human condition and offer guidance on leading a purposeful and fulfilling life. They encourage individuals to explore the depths of their own consciousness and seek answers to life's fundamental questions.

Conclusion

The Upanishads stand as a testament to the profound wisdom and spiritual insights of the ancient sages. Their teachings continue to resonate with individuals seeking to understand the nature of existence, consciousness, and the ultimate reality. By delving into the Upanishads, one embarks on a transformative journey of self-discovery and spiritual growth, uncovering the eternal truths that lie within.

 

cross-posted from: https://lemmy.run/post/10868

Beginner's Guide to grep

grep is a powerful command-line tool used for searching and filtering text in files. It allows you to find specific patterns or strings within files, making it an invaluable tool for developers, sysadmins, and anyone working with text data. In this guide, we will cover the basics of using grep and provide you with some useful examples to get started.

Installation

grep is a standard utility on most Unix-like systems, including Linux and macOS. If you're using a Windows operating system, you can install it by using the Windows Subsystem for Linux (WSL) or through tools like Git Bash, Cygwin, or MinGW.

Basic Usage

The basic syntax of grep is as follows:

grep [options] pattern [file(s)]
  • options: Optional flags that modify the behavior of grep.
  • pattern: The pattern or regular expression to search for.
  • file(s): Optional file(s) to search within. If not provided, grep will read from standard input.

Examples

Searching in a Single File

To search for a specific pattern in a single file, use the following command:

grep "pattern" file.txt

Replace "pattern" with the text you want to search for and file.txt with the name of the file you want to search in.

Searching in Multiple Files

If you want to search for a pattern across multiple files, use the following command:

grep "pattern" file1.txt file2.txt file3.txt

You can specify as many files as you want, separating them with spaces.

Ignoring Case

By default, grep is case-sensitive. To perform a case-insensitive search, use the -i option:

grep -i "pattern" file.txt

Displaying Line Numbers

To display line numbers along with the matching lines, use the -n option:

grep -n "pattern" file.txt

This can be helpful when you want to know the line numbers where matches occur.

Searching Recursively

To search for a pattern in all files within a directory and its subdirectories, use the -r option (recursive search):

grep -r "pattern" directory/

Replace directory/ with the path to the directory you want to search in.

Using Regular Expressions

grep supports regular expressions for more advanced pattern matching. Here's an example using a regular expression to search for email addresses:

grep -E "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b" file.txt

In this case, the -E option enables extended regular expressions.

Conclusion

grep is a versatile tool that can greatly enhance your text searching and filtering capabilities. With the knowledge you've gained in this beginner's guide, you can start using grep to quickly find and extract the information you need from text files. Experiment with different options and explore more advanced regular expressions to further expand your skills with grep. Happy grepping!

 

cross-posted from: https://lemmy.run/post/10868

Beginner's Guide to grep

grep is a powerful command-line tool used for searching and filtering text in files. It allows you to find specific patterns or strings within files, making it an invaluable tool for developers, sysadmins, and anyone working with text data. In this guide, we will cover the basics of using grep and provide you with some useful examples to get started.

Installation

grep is a standard utility on most Unix-like systems, including Linux and macOS. If you're using a Windows operating system, you can install it by using the Windows Subsystem for Linux (WSL) or through tools like Git Bash, Cygwin, or MinGW.

Basic Usage

The basic syntax of grep is as follows:

grep [options] pattern [file(s)]
  • options: Optional flags that modify the behavior of grep.
  • pattern: The pattern or regular expression to search for.
  • file(s): Optional file(s) to search within. If not provided, grep will read from standard input.

Examples

Searching in a Single File

To search for a specific pattern in a single file, use the following command:

grep "pattern" file.txt

Replace "pattern" with the text you want to search for and file.txt with the name of the file you want to search in.

Searching in Multiple Files

If you want to search for a pattern across multiple files, use the following command:

grep "pattern" file1.txt file2.txt file3.txt

You can specify as many files as you want, separating them with spaces.

Ignoring Case

By default, grep is case-sensitive. To perform a case-insensitive search, use the -i option:

grep -i "pattern" file.txt

Displaying Line Numbers

To display line numbers along with the matching lines, use the -n option:

grep -n "pattern" file.txt

This can be helpful when you want to know the line numbers where matches occur.

Searching Recursively

To search for a pattern in all files within a directory and its subdirectories, use the -r option (recursive search):

grep -r "pattern" directory/

Replace directory/ with the path to the directory you want to search in.

Using Regular Expressions

grep supports regular expressions for more advanced pattern matching. Here's an example using a regular expression to search for email addresses:

grep -E "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b" file.txt

In this case, the -E option enables extended regular expressions.

Conclusion

grep is a versatile tool that can greatly enhance your text searching and filtering capabilities. With the knowledge you've gained in this beginner's guide, you can start using grep to quickly find and extract the information you need from text files. Experiment with different options and explore more advanced regular expressions to further expand your skills with grep. Happy grepping!

 

Beginner's Guide to grep

grep is a powerful command-line tool used for searching and filtering text in files. It allows you to find specific patterns or strings within files, making it an invaluable tool for developers, sysadmins, and anyone working with text data. In this guide, we will cover the basics of using grep and provide you with some useful examples to get started.

Installation

grep is a standard utility on most Unix-like systems, including Linux and macOS. If you're using a Windows operating system, you can install it by using the Windows Subsystem for Linux (WSL) or through tools like Git Bash, Cygwin, or MinGW.

Basic Usage

The basic syntax of grep is as follows:

grep [options] pattern [file(s)]
  • options: Optional flags that modify the behavior of grep.
  • pattern: The pattern or regular expression to search for.
  • file(s): Optional file(s) to search within. If not provided, grep will read from standard input.

Examples

Searching in a Single File

To search for a specific pattern in a single file, use the following command:

grep "pattern" file.txt

Replace "pattern" with the text you want to search for and file.txt with the name of the file you want to search in.

Searching in Multiple Files

If you want to search for a pattern across multiple files, use the following command:

grep "pattern" file1.txt file2.txt file3.txt

You can specify as many files as you want, separating them with spaces.

Ignoring Case

By default, grep is case-sensitive. To perform a case-insensitive search, use the -i option:

grep -i "pattern" file.txt

Displaying Line Numbers

To display line numbers along with the matching lines, use the -n option:

grep -n "pattern" file.txt

This can be helpful when you want to know the line numbers where matches occur.

Searching Recursively

To search for a pattern in all files within a directory and its subdirectories, use the -r option (recursive search):

grep -r "pattern" directory/

Replace directory/ with the path to the directory you want to search in.

Using Regular Expressions

grep supports regular expressions for more advanced pattern matching. Here's an example using a regular expression to search for email addresses:

grep -E "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b" file.txt

In this case, the -E option enables extended regular expressions.

Conclusion

grep is a versatile tool that can greatly enhance your text searching and filtering capabilities. With the knowledge you've gained in this beginner's guide, you can start using grep to quickly find and extract the information you need from text files. Experiment with different options and explore more advanced regular expressions to further expand your skills with grep. Happy grepping!

view more: ‹ prev next ›