Saturday, September 10, 2022

What is 5G



World is on the verge of a revolution, this revolution is not like a traditional revolution, but it is brought by ever evolving technology, just 30 years ago no body imagined that we will have phones more powerful than most advanced computers at that time, smartphones have changed the way we live our life, however that smartest of phones today wont be able to do much without a good mobile network, like our phones have evolved continuously, the current generation is 5G. Let us discuss about this latest gift from technology world.

What is 5G ?

5G is a successor to 4G mobile network, it is a Technology Standard developed by 3rd Generation Partnership Project ( 3GPP ) for broadband mobile networks, South Korea was first country to launch 5G on large scale in 2019, though Ooredoo ( Qatar ) was the first operator to launch 5G. USA too had 5G network in some parts since 2019, telecom operators are set to launch 5G in India by late 2022. As per 3GPP , A Cellular network system using 5G NR ( 5G new radio ) software can be called 5G networks, 5G networks can make use of three frequency bands : High, medium and low. One of the reason for higher speeds supported by 5G is it that it is able to make use of High frequency band ( 24 GHz up to 54 GHz ),

5G NR is Radio Access Technology ( RAT ) developed for 5G, this is equivalent to GSM in 2G, UMTS in 3G and LTE in 4G. Radio Access Technology is a name for method of physical connection for radio connection.

According to 5G NR standard , frequency ranges below 6 GHz ( lower frequency range ) is Called FR1 ( Frequency Range 1 ), while frequency ranges above 24 GHz ( Higher frequency range ) is Called FR2 ( Frequency Range 2 ). It has been observed that if an operator uses FR1 deployment on 4G hardware ( non-stand alone ), it can achieve only slight improvement ( between 15-50 % ) in terms of speed over LTE.

Frequency range above 30 Ghz and upto 300 GHz ( Wavelength 1-10 mm ) are also called , millimetre wave ( mmWave ), These Frequencies belong to Extremely high frequency band or EHF band.

Do you know that its was great Indian scientist Mr. Jagdish Chandra Bose who first investigated about EHF band .

One important point about FR2 ( Frequency range 2 ) is that these frequency are not able to travel long distance and can work only upto few hundred meters , these higher frequencies are also not good at penetrating objects or obstacles in their way, hence with these frequency ranges we are going to see cells in larger numbers but smaller in size,

Following are the types of cells in order of increasing size and capacity :

Femtocell, Pico cell ,Micro cell, Metro cell .

Femtocell, Pico cell are frequently used for indoor coverage

What are different deployment modes for 5G ?

5G can have two type of deployment modes, stand alone (SA) and non stand-alone ( NSA), NSA will make use of exiting 4G LTE infrastructure while SA mode will be using 5G packet core instead of 4G Evolved Packet Core (EPC).

What is edge computing ? What is the main purpose of edge computing?

Many mission critical application require low latency and delay, one way to achieve this is performing computing operation closer to user , This kind of network architecture is called mobile edge computing or Multi-access edge computing (MEC) or simply edge computing , Edge computing provides distributed computing environment.

What is 5G UC ?

Or

What is 5G ER ?

Or

What is 5G UW ?

or

What is 5G plus ?

“5G UC” ( 5G Ultra capacity ) and “5G ER” ( 5G Extended Range ) are 5G Versions which belongs to Telecom Operator T-mobile, 5G UC includes higher and mid frequency range and provides Higher speed compared to 5G ER which uses lower frequencies, Still 5G ER speeds are slightly better than 4G LTE

“5G UW” ( 5G ultra wideband ) is 5G version which belongs to Telecom Operator Verizon and includes higher and mid frequency range and provide Higher speeds. Verizon uses “5G Nationwide” term For lower frequencies.

“5G Plus” ( 5G + ) is 5G version which belongs to Telecom Operator "AT&T" and includes higher and mid frequency range and provide Higher speeds. "AT&T"' uses “5G Evolution” For lower frequencies.

When 5G network will launch in India?

According to reports in several media outlets, 5G in India is going to be launched by late 2022.

Which are some of the best 5G phones ?

Here is list complied by us for some of the best 5G phones in 2022 :

Samsung Galaxy S21+
Sony Xperia PRO-I ( XQBE62/B )
Sony Xperia PRO (XQAQ62/B)
Apple iPhone 14 Pro Max ( Model A2651)

Please note that many other good 5G phones are available in markets which are not listed here, we request our readers to make informed decision based on their own requirements.

Disclaimer : this content is written as general information and does not claim to be complete or accurate, readers should consult their respective mobile phone manufactures and mobile network operators before making any decision, we are not responsible for any damage caused due to above information. we are not associated with any of the brands or companies mentioned in this article, this content does not include any paid promotion.

return to Tech World Update page

Go to Whats Cool page

Go to green world Page

return to Home Page

Sunday, August 28, 2022

Create bootable USB for Ubuntu from Windows using balenaEtcher



Linux Operating system is one of the best choice for Laptop and Personal Computers, Linux is Open Source, in most cases you need not to worry about licenses and heavy charges, which are needed to pay for paid operating systems, you can download Linux for Free, you can choose from various Linux downloads, if you want a free Linux Tutorial ( Linux Commands ) you can click here

Linux Tutorial

Ubuntu is one of best Linux operating system among various Linux distributions, Due to its immense popularity among masses, you are more likely to get support, although i do believe each Linux distribution is unique and special , you if want to know about popular Linux distros, you can click here,

Linux distributions

In this post i will explain how to Create bootable USB Ubuntu from Windows for free,

before we move ahead, i want to answer some commonly asked questions about Ubuntu and Linux :

Q: What is Linux is used for?
A: Linux is not a single operating system, but it is family of various Unix like operating systems, Linux is dominant in super computer and server market, it can be used as web server, mail server etc, it can also be used on personal computers, where is getting popular now a days.

Q: Is Ubuntu better than Windows?
A: Both Windows have and Linux ( Ubuntu ) have their own USP, Both are good in their own way, however Ubuntu is largely free and open source, which makes it affordable for everyone.

Q: Is Ubuntu 20.04 stable now?
A: Yes it is stable.

Q: Is Ubuntu 20.04 better?
A : Yes As per my opinion its better than previous Ubuntu versions like Ubuntu 16.04 or Ubuntu 18.04

Q: What is the best Linux operating system? Or What is the best Linux to run from USB?
A: Again as i said earlier, each Linux distribution is special and have a specific purpose, some like Ubuntu are more popular than others, it purely depends upon your requirements, for example Kali Linux is very popular in the area of Cyber Security

You can Read Our Cyber Security tips here :

Cyber Security tips

Q: Can Ubuntu be run from a USB stick? Or Can I run an operating system from a flash drive? Or Can you boot Linux from a flash drive?
A :Yes, its possible.

Q: How to use USB stick Ubuntu?
A: Please read our complete post.

Q: Can I try Ubuntu without installing?
A: Yes its possible and we recommend you to do it before completely switching to Linux / Ubuntu.

Q: What size USB do you need for Ubuntu? Or Is 8GB USB enough for Ubuntu?
A: We suggest that you should have minimum 8GB USB, though it possible to use a 4GB USB too.

So lets begin , first you need to download ubuntu iso image, As of now some of official links for downloading it are as below :

ubuntu for desktop

ubuntu alternative-downloads

for desktops Latest Version is Ubuntu 22.04, you can download past releases as well as from alternate download links, i have chosen Ubuntu 20.04 for this tutorial, if you want you can download, try and also optionally install Ubuntu 22.04 LTS as well, before you proceed you need to make sure that USB boot is priority over Hard disk and other kind of boot in your laptop or PC BIOS options

One you download iso image, you will also need to download Some software which will write image file ( iso file ) to storage media ( USB or flash drive ), in this tutorial, i will use free and open-source "balenaEtcher" , its a exe file no installation required, there are several other alternatives for it such as "Rufus" and "Ventoy". you can download balenaEtcher from following link :





Alright since we have now both Ubuntu 20.04 iso image and utility to create Live USB system, we need to follow next two steps :

1. Select Ubuntu 20.04 ( or Ubuntu 22.04 LTS, which ever ubuntu version you have downloaded ) image ( iso ) file in balenaEtcher`s dialogue box .



2. After this you need to specify storage name, where you will be creating Live USB system ( your USB flash drive name ) in balenaEtcher`s dialogue box.



you are now ready to create (flash) Live USB system, normally it will take few minutes, once it is completed there is also a optional validation option, i would recommend, go for it,



your bootable USB for Ubuntu is now ready,
all you need to restart you laptop or PC while keeping USB flash drive plugged-in
You will get following screen while you will reboot your laptop or PC,
you need to press enter ( Choose default option ), if it does not proceed automatically in few seconds.




Once you have booted from flash drive, you will get two options on screen, one of them is "Try Ubuntu" and Other one "Install Ubuntu" , Since we want to use USB flash drive to play with Ubuntu first, please select Try Ubuntu, it will take you inside Ubuntu OS.




Congratulation you have completed all steps, you are now ready to use Ubuntu form live USB flash drive, you even get a shortcut on screen to install Ubuntu 20.04 directly to your laptop, We suggest you to try Ubuntu for USB stick for sometime and get used to it before installing, Thanks for Reading.

Disclaimer : this content is written as general information, and does not claim to be complete or accurate, readers should consult their respective Personal Computer/Server/laptop/Flash Drive/Operating system vendors; before performing any of these steps, we are not responsible for any damage caused; due to above information.

return to Whats Cool page

Go to Tech World Update page

Go to green world Page

return to Home Page

Tuesday, August 23, 2022

Top 10 java books for beginners (2022)




Java is one of the widely used programming language, though it first appeared in 1995, it has evolved continuously, its a dominant language in field of client–server web applications as well as mobile application development (Android). Many people ask that “Is Java a good career choice ? ” the answer is, yes, being a Java developer is a very good career choice, you can get high paying jobs if you are proficient in Java , Here are some more information about Java :

Question : Who invented Java?
Answer : James Gosling.

Question : Is Java and JavaScript same?
Answer : Both are two different languages.

Question : Which book is best for learning Java? Answer :
While there are tons of resources for learning java both online and offline , it becomes difficult for beginners to decide, Which book is best for learning Java? I will try to list some of the best java books for beginners in 2022 -

1. Java: A Beginner's Guide by Herbert Schildt : This book is one of my personal favourite and defiantly one of the Top 10 Java Books. This book has right content for beginners, Book Neither too long nor to short everything is perfectly balanced.

2. Effective Java by Bloch Joshua : Effective Java by Bloch Joshua is worth reading if you are trying to get understanding of Java. It is precise, crisp and to the point. You can build a strong foundation of java and overall development knowledge for yourself with the help of this book, this is one of the best book for java developers, even experienced java professionals find it very useful.

3. Java The Complete Reference by Herbert Schildt : Another Gem by Author Herbert Schildt, which finds place in our list of top 10 java books for beginners. This book covers a lot of , hence its quite big. It can be sometimes overwhelming for beginners , use it as reference book.

4. Head First Java by Kathy Sierra , Bert Bates, Trisha Gee : Reading Head first book is always a fun, this books covers all basic concepts and keep you engaged, this book also provides good amount of practical examples.

5. Programming with Java by E. Balagurusamy : E. Balagurusamy is one of my favourite author, He has explained java concepts in very simple language, you get good understanding of theory and also get good practical examples, print quality is also good, though some people may not like colour scheme of fonts. This book focuses more on basic concepts and not meant for advanced user.

6. Effective Java by Bloch Joshua : Effective Java by Bloch Joshua is worth reading if you are trying to get understanding of Java. It is precise, crisp and to the point. You can build a strong foundation of java and overall development knowledge for yourself with the help of this book, this is one of the best book for java developers, even experienced java professionals find it very useful.

7. Java - An Introduction to Problem Solving and Programming Walter Savitch : A very good book , popular among college students, easy to understand. You will find a lot of projects to do in this book.

8. Let us Java by Yashavant Kanetkar : This book has same been written in same style as hugely popular “Let us C”, this book is good if you have some programming ( any other language ) knowledge , this book is good for quick reading.

9. Core Java: an Integrated Approach by Rao R. Nageswara : This book is good for beginners to intermediate users.

10. Core Java: Made Simple by Som Prakash Rai : Good for beginners with comparatively less theory and more examples.

Here are Some honourable mentions :

1. Beginning Programming with Java For Dummies by Barry A. Burd : if you are from non programming background ,you can surely go for this book, book is written in very simple and easy language. While Some people might say that this book is for kids, i would say this book is useful for everyone who is just Beginning.

2. Core and Advanced Java, Black Book , Dreamtech Press India Pvt. Ltd : This book covers both core and advanced java, it also covers frameworks like Hibernate. It also explains topics like collection framework very nicely .

3. Data Structures and Algorithms Made Easy in Java by Karumanchi Narasimha : As name suggests ,This book focuses more on Algorithms. Its good if you have prior coding knowledge while reading this book.



return to Tech World Update page

return to Home Page

Saturday, August 20, 2022

Mobile Screen not working , Don't Worry, try this solution


Android OS which is based on Linux kernel has become inseparable part of our life in form of smart phones, your smartphones contains your valuable data, be it your memorable moments, or important documents, since overwhelming numbers smartphones are now have only touch interface, this dependency comes with a cost, you are always at risk of losing this data if your screen suddenly stops responding due to fall or some other issue, your data is still there, but you cant access this data since the interface between you and this data "the screen" has become Unresponsive, however this seemingly complex issue comes with a simple solution, if your phone supports OTG (USB On-The-Go),

All you need to is one OTG to USB cable or OTG to USB connector and one mouse as shown in picture. OTG to USB connector are easily available online as well as in regular mobile accessories shops.

Just follow below steps : 1. First you need to connect this OTG connector to your mobile phone as shown in picture, remember to use OTG to USB connector which is compatible with your mobile, for example if your mobile have USB type-c port, you need to use type c OTG to USB connector.

2. Now connect mouse to other end of this OTG to USB cable or OTG to USB connector

3. After this you will see a pointer or cursor on your screen, as shown in picture, you are now ready to use mouse on your mobile phone , just like you can use it on your PC or laptop and operate your phone, even make phone calls, now you can access your data.







Disclaimer : this content is written as general information, and does not claim to be complete or accurate, readers should consult their respective mobile phone manufactures before connecting with any external device, we are not responsible for any damage caused to mobile phone due to above information.

return to Whats Cool page


return to Home Page

Monday, August 15, 2022

Download Free whatsapp status for engineers, Click here


Download Free:
#WhatsApp Status for it professionals
#WhatsApp Status for engineers
#WhatsApp Status for software engineers
Happy Engineers Day
#HappyEngineersDay
#Engineer'sDayquotes





















return to Home Page

Sunday, August 14, 2022

Five Simple Ways you can save the environment




1. Use a human powered bicycle – While using a car or motorcycle might look more stylish, riding human powered bicycle may help you in many ways, first you don't need to burn lot of fossil fuel which reduces emission of toxic and green house gases, Second you save some money which was meant to be used for fuel , third you save more money in form of your hospital bills by burning lot of unwanted calories.

2. Green roof or Roof garden – Start growing some plants on your unused roof, this may contribute to reduction of temperature and your electricity bills since you have to use Air conditioning less often, this will also add some scenic beauty to your house and may provide accommodation to some beautiful birds and butterflies.

3. Waste segregation – modern urban lifestyle produces unimaginable amount of waster each year, while its not possible to recycle entire waste, We can still make waste management process more efficient by adopting waste segregation, wet waste specially food waste can be turned to into high quality fertilizers. While dry waste like plastic (at least some part of it) can be recycled into some other useful objects, segregation makes it easier to recycle. You can also adopt golden rule of RRR (reduce, reuse, recycle ).

4. Rainwater harvesting – Do some investment towards rain water harvesting, you can use this water for your garden during dryer times and keep your surrounding evergreen , even when water becomes scarce resource.

5. Avoid pesticides and harmful chemical – All pesticide and chemicals which are being used by us ultimately end up in our environment, mostly in our water resources, so try to avoid them or at least minimise their use, you can also use organic and nature friendly alternatives wherever possible , for example “Neem oil” is natural pesticide.

return to greep world Page

return to Home Page

Tuesday, August 9, 2022

Know the programming language behind your favourite social media platforms


We all use different social media networks in our day to day life, lets discuss about the programing languages which give them their special powers :



1. Twitter : Microblogging Platfrom twitter which have 300+ million monthly active users since 2019 is written in Java,Ruby,Scala,JavaScript.

2. Facebook : Online social networking service Facebook which is belived to have 2.8 billion monthly active users as of 2020 is powered by C++ and Hack , dont be surprised by the name "Hack", its a dialect of php devloped by meta.

3. Youtube : Online video sharing platform which had 2.6 billion active users as on January 2021, is written in C, C++, Java,Python , Go and JavaScript.

4. Instagram : Photo and video sharing social networking service Instagram is mainly written in Python, As on June 2018 it had 1 billion monthly active users.

5. WhatsApp : Instant messaging (IM) and voice-over-IP (VoIP) service WhatsApp which had over 2 billion active users As of February 2020, is written in Erlang.

6. Telegram : Instant messaging (IM) service Telegram, which is belived to have 700 million monthly active users as on June 2022, is written in C++ , C , Java.


Source : Wikipedia



if you want learn to Basic Unix Commands in 1 Hour, here is the link

Basic Unix Commands in 1 Hour

if you want learn Unix/Linux Commands in detail, here is the link

Learn Unix/Linux Commands in detail

Also keep visiting my blog to learn more

unixtechworld.blogspot.com

Tuesday, August 2, 2022

Why We need more wildlife crossings

Why We need more wildlife crossings :

Picture credit : https://www.publicdomainpictures.net/

Human population is growing at a rapid pace, unfortunately humans need more and more place by each passing day. we have built megacities by deforestating large chunk of jungles, many species have become extinct and many more are endangered, humans also need to travel a lot , we have builts highways and major road which connects are cities. In this process we are destroying already shrinking habbitate of wildlife. We fragment once thriving jungles for our own short term benefit though in long term it is going cause more harm as compared to benefit.

We can't stop every human settlement from building roads and cities however there is something we can do about this fragmentation. While roads and railways are necessary for development, wildlife crossings are equally necessary for sustainable development.

Let's understand this with an example, imagine you are part of hypothetical endangered species residing in dense forest, now due to a newly built road your habitate is divided in two parts, some of the necessary resources like lake full of fresh water remain at one side,while most of plants which you like to eat remains on other side of highway. Now in order to just fulfil the basic needs like food and water you have to cross a dangerous road on daily basis, many members of your species are killed in this process, slowly your species is almost finished, sadly this does not stop here, there are few more predator species which relied on your species, since their prays are gone, they will go soon, entire wildlife numbers slowly start dwindling, since wildlife is gone, trees are plants which are indirectly dependant on wildlife will also will also start declining, as a result Soon we will be slightly closer to global warming and climate change.
wildlife crossings can be created in many ways such as : overpass, underpass, Viaducts, green roofs, Canopy Bridge . wildlife crossings can not only save animals but also many human lives which are lost in wildlife-vehicle collision.
While there are some efforts are ongoing in developed world, there is still very less awareness about this in developing world, we hope that more efforts will be made in this direction in coming future.

return to greep world Page

return to Home Page

Friday, July 29, 2022

Know About AI, ML and DL

There is a lot buzz around AI ( Artificial intelligence ) and ML ( Machine learning ) and DL ( Deep Learning ) now a days, Big IT and Tech Companies are offering hefty paychecks to the people who are proficient in these technologies, even many non tech people have great curiosity about these terms. AI is also one of the favourite word of hollywood, used often in sci fi movies. lets understand basics of these technologies in simple words :

AI ( Artificial intelligence ) : We humans have natural intelligence, traditional old fashioned machines did not have intelligence, Artificial intelligence is term used where machines are capable of showing their own intelligence, in other words they can show atleast some amount of human or animal behaviour in terms of intelligence, concepts of AI is older then 60 years. AI ( Artificial intelligence ) is very Big field and ML ( Machine learning ) and DL ( Deep Learning ) are its subset, in fact DL is subset of ML. "Intelligent agents" is a important term in field of AI research, Intelligent agents or IA understands its surrounding or environment, and takes action independently in order to achieve ojectives, unlike normal machines such agents may show improvement in performance either with exiting knowledge ( data ) or through learning which may also involve some kind of feedback mechanism, ( Think of thermostat device which regulates temperature as a simple AI agent ).

have you ever thought that how does Google or other search engines giving you very accurate recommendation ? well answer is simple they are making use of AI.

AI is everywhere from search engines to music or video steaming apps such as youtube, to tesla`s self driving cars.

To make a machine which have Artificial intelligence capabilty you need methods which are able to learn, in other words you need ML, thse learning methods make use of data available to them and try to provide improved performance while making decisions and predictions,ML is sometimes also called predictive analysis, ML programs perform tasks based on learning from data instead of being explicitly Programmed to do so.

DL is part of machine learning ( ML ), just like biological brain has Neurons, DL is based on Artificial neural network which in turn inspired from biological neural networks ( biological brains ), Automatic speech recognition can be cited as example DL.

As a Software Professional, you should know that There are many Programing languages and software libraries used in field of AI,ML and DL, few of them are LISP,R, Python and ternsorflow



if you want learn to Basic Unix Commands in 1 Hour, here is the link

Basic Unix Commands in 1 Hour

if you want learn Unix/Linux Commands in detail, here is the link

Learn Unix/Linux Commands in detail

Also keep visiting my blog to learn more

unixtechworld.blogspot.com



Sunday, July 24, 2022

Basics of Permissions on Unix and Linux Systems and chmod Command | Part -1

Permissions play an important role in unix / linux ecosystem, they are integral part of data security, every file and directory must have clearly defined ownership, As a beginner you should undertand that each file and directory have three types of permissions

A) Read
B) Write
C) Execute

There are some advanced concepts as well such as sticky bit,suid,sgid and umask which are meant for advanced users, we will discuss these in our future posts.

These permissions are represented in following two types of notations :

1) Symbolic notation
a) read : r
b) write : w
c) execute : x

2) Numeric notation
a) read : 4
b) write : 2
c) execute : 1

lets understand these concepts with examples:
i have created two directories Permissionsdemo1 and Permissionsdemo2 inside home path of user "appuser1" with same user, this user is part of group "app", defaults permissions of these directories are "rwxr-xr-x" ( rwx -> owner | r-x -> group | r-x others ), which means owner of these directories have all three read(4), write(2) and execute(1) permissions, the group ( or group members) to which owner belongs to have read(4) and execute (1) permissions, other too have read(4) and execute (1) permissions













Next i have created a file inside Permissionsdemo1 directory with "appuser1" user, with name "Script1.sh", its a executable file ( Script ), default permission of this file is "-rw-r--r--" ( -rw -> owner | r-- -> group | r-- others ), which means owner of this file have read(4) and write(2) permissions,the group ( or group members) to which owner belongs have read(4) permissions and other too have read(4) permissions















Here comes the interesting part, Unix ( or Linux ) Provides you way to change the default permissions, You can do this with the help of "chmod" command. Again this commands as two forms -

A) Symbolic
B) Numerical

In this post i will be focusing on Numerical form , will explain Symbolic form in next part, i personally find Numerical form easier to learn and practice , Please pay close attention to following example where i have provided permsions "640" to file "Script1.sh" . This means owner of this file have this file have read(4) and write(2) permissions,the group ( or group members) to which owner belongs to have read(4) permissions and other Dont have any permissions (0). Notice that only owner of the file or superuser ( example : root ) can run this command . After this change , one other user "neeraj" ( which is not part of group "app" ) is not able to read the file. howver appuser2 which is part of "app" group is still able to read the file, since group has read permissions,















However we notice that neither "appuser1" ( owner ) or "appuser2" ( owners group member ) are are able to execute this file













To Solve this problem, we will again use "chmod" command.
i provided permsions "750" to file "Script1.sh" . This means owner of this file have this file have read(4) and write(2) and execute(1) permissions,the group ( or group members) to which owner belongs have read(4) permissions and execute(1) and others Dont have any permissions (0).










In next expample i have tried to write one line to "Script1.sh" using "appuser2" which is not owner of file but is part of owners group, since the group does not have write permissions, my attempt failed and i got error "Permission denied". group currently has 5 ( Read : 4 + execute : 1 ) Permissions.









To Provide write permissions to group , i have used "chmod 770" , this will provide full permissions ( Read : 4 ,Write : 2 and Execute : 1 ) to owner as well as group but no (0) permission to others, after this i am able to write to file "Script1.sh", i am also able to execute the modified file with "appuser2"











Since now "appuser2" has "full" ( really ? ) permissions to file "Script1.sh" ( As it is part of "app" group and group has read,write and execute permissions). Should it be able to delete ( remove ) the file "Script1.sh" ? The answer is "not yet" and reason is little complex
you can see in following example "appuser2" is not able to delete ( remove ) the file "Script1.sh"







The reason is while deleting a file (Script1.sh) "appuser2" ( owners group user ), also trying to modifiy the directory "PermissionDemo1" , however the group does not have permission to modify the directory. with the help of chmod command we have now modified persmissions of "PermissionDemo1" directory, We have used chmod "771" , this gives read ( 4 ) , write ( 2 ) and execute ( 1 ) permissions to both owner and group and only execute (1) permisions to others, note that this is for directory. after that "appuser2" is able to delete the file.











By now you are aware of basic concepts related to linux persmissions and also about "chmod" command, in next post i will be covering some advacned copncepts




if you want learn to Basic Unix Commands in 1 Hour, here is the link

Basic Unix Commands in 1 Hour

if you want learn Unix/Linux Commands in detail, here is the link

Learn Unix/Linux Commands in detail

Also keep visiting my blog to learn more

unixtechworld.blogspot.com



Get latest Tech world updates

Monday, July 18, 2022

Most Popular Linux distribution as of 2022

Here is list of most poular linux distribution as of 2022 , this list is not in any particualr order, This list include list of distributions aimed for both desktop and servers,



1. Debian Linux

2. Fedora Linux

3. Ubuntu / Ubuntu Server ( derived from Debian )

4. Red Hat Enterprise Linux ( RHEL ) ( Derived from Fedora Linux )

5. openSUSE/SUSE Linux Enterprise



Some honourable mentions

1. MX Linux

2. Slackware

3. Arch Linux

4. CentOS

5. Linux Mint

6. Manjaro Linux

7. oracle linux



Note - this list is based on our own opinion and research and we do not claim that it is accurate and complete
if you want learn to Basic Unix Commands in 1 Hour, here is the link

Basic Unix Commands in 1 Hour

if you want learn Unix/Linux Commands in detail, here is the link

Learn Unix/Linux Commands in detail

Also keep visiting my blog to learn more

unixtechworld.blogspot.com

Monday, July 11, 2022

Top 5 computer languages as of 2022

Top 5 computer languages as of 2022

Top 5 computer languages as of 2022 ( Not in any particular order )





1. Python : Simple and Powerful scripting language, Very Popular for Machine Learning, data science, artificial intelligence , Automation.

2. C : Very efficient and fast language, its simple and have large ecosystem and libraries.

3. C++ : Just like its close relative C, C++ is Very efficient and fast language, used vastly for game development.

4. Java : Platform Independent ( Write once , run anywhere Or WORA ), Used for Mobile Applications development ( Android ), internet of things (IoT),Big data and much more.

5. Javascript : Default language of internet, All major browsers have Javascript Engine, also used for backend devlopement (Node.js).



if you want learn to Basic Unix Commands in 1 Hour, here is the link

Basic Unix Commands in 1 Hour

if you want learn Unix/Linux Commands in detail, here is the link

Learn Unix/Linux Commands in detail

Also keep visiting my blog to learn more

unixtechworld.blogspot.com



Sunday, July 10, 2022

Cyber Safety tips

Cyber Safety tips



Internet has become an important part of our life, while its been helping us in our day to day life, it has its own set of risks, online frauds are becoming very common now a days, people end up loosing their hard earn money or important data, sometimes people become victims of identity theft,or their personal photographs are compromised. here are some tips which can save you from falling pray to such scams.





1. Passwords are first wall of defence against cyber attacks, Keep Complex and long password, Dont use same password for multiple sites /social media accounts , never share otp/password , Avoid writing passwords.

2. Dont install apps from any untrusted source on your mobile phone, Read user reviews of apps, think twice before downloading new apps with very few numbers of downloads, you can Also Control permissions given to apps , try to give minimum required permissions to any app , Avoid scanning qr codes from unkown source.

3. Dont click on random links received via whatsapp/sms, avoid clicking on any unkown link, make sure that the website address is correct, sites starting with "https" ( instead of http ) are relatively safe ( also check for padlock symbol in front of "https" sites ).

4. Avoid international unkown numbers, dont share any personal information on any Call with known numbers, never share otps and passwords on call with anyone, watch for unusual Network absense, long duration unusual Network absense can be serious, Someone may be trying to get another sim with your number.

5. Avoid sharing personal information such as dob/parents name/ contact number/Address on social media platforms, Dont Add unknown people with your social media account, even if someone known asks for money or any data in social media platforms such facebook or instagram dont trust him or her blindly , as impersonating is common thing on social media platforms.

4. Avoid openings attachment in mails from unknown sources.

5. Dont keep phone/latops unattended, also always lock them.

6. use Antivirus Softwares and keep them upto date.

7. Avoid connecting to unsecure network.



if you want learn to Basic Unix Commands in 1 Hour, here is the link

Basic Unix Commands in 1 Hour

if you want learn Unix/Linux Commands in detail, here is the link

Learn Unix/Linux Commands in detail

Also keep visiting my blog to learn more

unixtechworld.blogspot.com



Sunday, June 12, 2022

ls command with examples

ls command with examples

ls command with examples



if you want learn to Basic Unix Commands in 1 Hour, here is the link

Basic Unix Commands in 1 Hour

if you want learn Unix/Linux Commands in detail, here is the link

Learn Unix/Linux Commands in detail

Also keep visiting my blog to learn more

unixtechworld.blogspot.com

ls command is one of the most widely used command on unix,linux platform system, as name suggests ls is used for listing files and directories, but apart from listing it gives a lot of information, lets explore this command.





1. use 'ls' without anything ls you will get a list of files and directories


neeraj@ubuntu:~/unixtechworld_Workshop$ ls
Hello_World_Programs Java.txt Linux_Distro.txt Python.txt

2. Using 'ls' with variety of wildcards makes it very useful, in below example we have listed
a) files/directories names starting with 'J' ( J followed by * )
b) files/directories names ending with 'txt' ( * followed by J )
c) files/directories names ending with 'txt' and 'o' coming anywhere before that ( *o*txt )


neeraj@ubuntu:~/unixtechworld_Workshop$ ls J*
Java.txt
neeraj@ubuntu:~/unixtechworld_Workshop$ ls *txt
Java.txt Linux_Distro.txt Python.txt
neeraj@ubuntu:~/unixtechworld_Workshop$ ls *o*txt
Linux_Distro.txt Python.txt
neeraj@ubuntu:~/unixtechworld_Workshop$

3. ls has a very useful option ( or argument ) called "-l" , l is for long listing, look carefully at below example, each column of output gives you following information
(I) permssions and file type ( plain file / directory etc )
(II) number of hard links
(III) owner
(IV) group
(V) file size
(VI) , (VII) and (VIII) Date, timeamp of file
(IX) filename


neeraj@ubuntu:~/unixtechworld_Workshop$ ls -l
total 16
drwxrwxr-x 2 neeraj neeraj 4096 May 27 11:37 Hello_World_Programs
-rw-rw-r-- 1 neeraj neeraj 61 Mar 6 12:08 Java.txt
-rw-rw-r-- 1 neeraj neeraj 64 May 27 11:30 Linux_Distro.txt
-rw-rw-r-- 1 neeraj neeraj 29 Mar 6 12:07 Python.txt

4. You can '-t' with '-l' to sort file list with time stamp ( modification time )


neeraj@ubuntu:~/unixtechworld_Workshop$ ls -lt
total 16
drwxrwxr-x 2 neeraj neeraj 4096 May 27 11:37 Hello_World_Programs
-rw-rw-r-- 1 neeraj neeraj 64 May 27 11:30 Linux_Distro.txt
-rw-rw-r-- 1 neeraj neeraj 61 Mar 6 12:08 Java.txt
-rw-rw-r-- 1 neeraj neeraj 29 Mar 6 12:07 Python.txt

5. Adding '-r' along with '-l' can help you sort files in reverse order ( old files first )


neeraj@ubuntu:~/unixtechworld_Workshop$ ls -ltr
total 16
-rw-rw-r-- 1 neeraj neeraj 29 Mar 6 12:07 Python.txt
-rw-rw-r-- 1 neeraj neeraj 61 Mar 6 12:08 Java.txt
-rw-rw-r-- 1 neeraj neeraj 64 May 27 11:30 Linux_Distro.txt
drwxrwxr-x 2 neeraj neeraj 4096 May 27 11:37 Hello_World_Programs

6. using '-h' option along with '-l' will give you file size in human readable format ( notice size 4.0 k )


neeraj@ubuntu:~/unixtechworld_Workshop$ ls -lh
total 20K
drwxrwxr-x 2 neeraj neeraj 4.0K May 29 06:08 Hello_World_Programs
-rw-rw-r-- 1 neeraj neeraj 61 Mar 6 12:08 Java.txt
-rw-rw-r-- 1 neeraj neeraj 64 May 27 11:30 Linux_Distro.txt
-rw-rw-r-- 1 neeraj neeraj 29 May 29 05:37 MyFirstFile.txt
-rw-rw-r-- 1 neeraj neeraj 29 Mar 6 12:07 Python.txt

7. using '-d' can help you list directories

neeraj@ubuntu:~/unixtechworld_Workshop$ ls -d Hello_World_Programs
Hello_World_Programs

8. using '-R' can help you list directories recursively


neeraj@ubuntu:~/unixtechworld_Workshop$ ls -R Hello_World_Programs
Hello_World_Programs:
JavaScript.txt Kotlin.txt

9. you can use '-a' ( all )option to list hidden files, notice '.HideMe' file


neeraj@ubuntu:~/unixtechworld_Workshop$ ls -la
total 28
drwxrwxr-x 4 neeraj neeraj 4096 May 27 12:31 .
drwxr-xr-x 16 neeraj neeraj 4096 Mar 6 12:05 ..
drwxrwxr-x 2 neeraj neeraj 4096 May 27 11:37 Hello_World_Programs
drwxrwxr-x 2 neeraj neeraj 4096 May 27 12:31 .HideMe
-rw-rw-r-- 1 neeraj neeraj 61 Mar 6 12:08 Java.txt
-rw-rw-r-- 1 neeraj neeraj 64 May 27 11:30 Linux_Distro.txt
-rw-rw-r-- 1 neeraj neeraj 29 Mar 6 12:07 Python.txt

10. you can use '-A' ( almost all )option to list hidden files except current and parent directory ( . and .. )


neeraj@ubuntu:~/unixtechworld_Workshop$ ls -lA
total 20 drwxrwxr-x 2 neeraj neeraj 4096 May 27 11:37 Hello_World_Programs
drwxrwxr-x 2 neeraj neeraj 4096 May 27 12:31 .HideMe
-rw-rw-r-- 1 neeraj neeraj 61 Mar 6 12:08 Java.txt
-rw-rw-r-- 1 neeraj neeraj 64 May 27 11:30 Linux_Distro.txt
-rw-rw-r-- 1 neeraj neeraj 29 Mar 6 12:07 Python.txt

11. you can use '-S' option to sort output based on file size

neeraj@ubuntu:~/unixtechworld_Workshop$ ls -lS
total 16
drwxrwxr-x 2 neeraj neeraj 4096 May 27 11:37 Hello_World_Programs
-rw-rw-r-- 1 neeraj neeraj 64 May 27 11:30 Linux_Distro.txt
-rw-rw-r-- 1 neeraj neeraj 61 Mar 6 12:08 Java.txt
-rw-rw-r-- 1 neeraj neeraj 29 Mar 6 12:07 Python.txt

12. You can use '-f' option to print file list without any sorting

neeraj@ubuntu:~/unixtechworld_Workshop$ ls -f
. Linux_Distro.txt .. .HideMe Hello_World_Programs Java.txt Python.txt

13. here is an example of ls with wild card mask, we have lsited any filename which is 8 character long

neeraj@ubuntu:~/unixtechworld_Workshop$ ls ????????
Java.txt

14. In below example we have listed any filename which starts by any character followed by any one of three characters 'x','y','z' and after that any number of characters

neeraj@ubuntu:~/unixtechworld_Workshop$ ls ?[x-z]*
Python.txt

15. you can also list the content of current directory by using 'ls .' , since . ( single dot represent current directory )

neeraj@ubuntu:~/unixtechworld_Workshop$ ls .
Hello_World_Programs Java.txt Linux_Distro.txt Python.txt

16. you can list the content of parent directory by using 'ls ..' , since .. ( double dot represent current directory )

neeraj@ubuntu:~/unixtechworld_Workshop$ ls ..
Desktop Documents Downloads Music Pictures Public Templates unixtechworld_Workshop Videos WorkShop

17. you can list the content of child directory by using 'ls */*', this will include all child directories which are in same hierarchy

neeraj@ubuntu:~/unixtechworld_Workshop$ ls */*
Hello_World_Programs/JavaScript.txt Hello_World_Programs/Kotlin.txt

18. if you want to list conent of specific child directory ( for example 'Hello_World_Programs' ) you can do it like below

neeraj@ubuntu:~/unixtechworld_Workshop$ ls Hello_World_Programs/*
Hello_World_Programs/JavaScript.txt Hello_World_Programs/Kotlin.txt





if you want learn to Basic Unix Commands in 1 Hour, here is the link

Basic Unix Commands in 1 Hour

if you want learn Unix/Linux Commands in detail, here is the link

Learn Unix/Linux Commands in detail

Also keep visiting my blog to learn more

unixtechworld.blogspot.com

Sunday, June 5, 2022

awk with examples

awk with examples

awk with examples

'awk' is one of the most versatile command or utility of unix OS, infact its a full-blown domain specific langauge in itself, it has powerfull text processing capabilities, here are some examples which shows how it can be used for text processing


We will be using below Sample File for our examples



neeraj@ubuntu:~/WorkShop$ cat Country.txt
COUNTRY,CAPITAL,AREA IN SQ KM
India,Delhi,3287263
Japan,Tokoyo,377975
USA,Washington DC,9833520
UK,London,242495
Australia,Canberra,7692024
China,Beijing,9596961
Ukraine,Kyiv,603628
Russia,Moscow,17098246
Brazil,Brasília,8515767
South Africa,Cape Town,1221037
France,Paris,643801
Taiwan,Taipei,36197
Canada,Ottawa,9984670


1. Printing Entire content (all columns ) of a comma(,) separated file, within awk "$0" represents all columns


neeraj@ubuntu:~/WorkShop$ awk -F"," '{print $0}' Country.txt
COUNTRY,CAPITAL,AREA IN SQ KM
India,Delhi,3287263
Japan,Tokoyo,377975
USA,Washington DC,9833520
UK,London,242495
Australia,Canberra,7692024
China,Beijing,9596961
Ukraine,Kyiv,603628
Russia,Moscow,17098246
Brazil,Brasília,8515767
South Africa,Cape Town,1221037
France,Paris,643801
Taiwan,Taipei,36197
Canada,Ottawa,9984670


2. Printing specific column of a comma(,) separated file, within awk "$n" represents column n, for example here we have printed 2nd column, Please note the anything can be a input separator ( even space ), we have to give it under Double Quotes after "-F"


neeraj@ubuntu:~/WorkShop$ awk -F"," '{print $2}' Country.txt
CAPITAL
Delhi
Tokoyo
Washington DC
London
Canberra
Beijing
Kyiv
Moscow
Brasília
Cape Town
Paris
Taipei
Ottawa


3. You can use "tolower" inbuilt function to print entire content or a specific column in lower Characters


neeraj@ubuntu:~/WorkShop$ awk -F"," '{print tolower($2)}' Country.txt
capital
delhi
tokoyo
washington dc
london
canberra
beijing
kyiv
moscow
brasília
cape town
paris
taipei
ottawa


4. Similarly we have "toupper" function as well, which can print entire content or a specific column in upper Characters


neeraj@ubuntu:~/WorkShop$ awk -F"," '{print toupper($2)}' Country.txt
CAPITAL
DELHI
TOKOYO
WASHINGTON DC
LONDON
CANBERRA
BEIJING
KYIV
MOSCOW
BRASíLIA
CAPE TOWN
PARIS
TAIPEI
OTTAWA


5. here is how you can use "$0" and "toupper" together to print entire conent in upper case


neeraj@ubuntu:~/WorkShop$ awk -F"," '{print toupper($0)}' Country.txt
COUNTRY,CAPITAL,AREA IN SQ KM
INDIA,DELHI,3287263
JAPAN,TOKOYO,377975
USA,WASHINGTON DC,9833520
UK,LONDON,242495
AUSTRALIA,CANBERRA,7692024
CHINA,BEIJING,9596961
UKRAINE,KYIV,603628
RUSSIA,MOSCOW,17098246
BRAZIL,BRASíLIA,8515767
SOUTH AFRICA,CAPE TOWN,1221037
FRANCE,PARIS,643801
TAIWAN,TAIPEI,36197
CANADA,OTTAWA,9984670


6. You can use "NR" built in variable to print line numbers ( row numbers )

neeraj@ubuntu:~/WorkShop$ awk -F"," '{print NR,$0}' Country.txt
1 COUNTRY,CAPITAL,AREA IN SQ KM
2 India,Delhi,3287263
3 Japan,Tokoyo,377975
4 USA,Washington DC,9833520
5 UK,London,242495
6 Australia,Canberra,7692024
7 China,Beijing,9596961
8 Ukraine,Kyiv,603628
9 Russia,Moscow,17098246
10 Brazil,Brasília,8515767
11 South Africa,Cape Town,1221037
12 France,Paris,643801
13 Taiwan,Taipei,36197
14 Canada,Ottawa,9984670


7. You can use "NF" built in variable to print "Field numbers" ( or the number of coulmns ), which are present in each line (based on field separator )

neeraj@ubuntu:~/WorkShop$ awk -F"," '{print NF}' Country.txt
3
3
3
3
3
3
3
3
3
3
3
3
3
3


8. "NF" can also be used to specify a column, for example here we have printed last column with help of NF ( Since total number of filed or coloumn are three in this file, NF is equal to 3, means we printed 3rd column)

neeraj@ubuntu:~/WorkShop$ awk -F"," '{print $NF}' Country.txt
AREA IN SQ KM
3287263
377975
9833520
242495
7692024
9596961
603628
17098246
8515767
1221037
643801
36197
9984670


9. if you want to print line having specific value, you can do it using following way, this example shows how you can print the line having 3rd column value greater than "3287263"

neeraj@ubuntu:~/WorkShop$ awk -F"," '$3>3287263{print $0}' Country.txt
COUNTRY,CAPITAL,AREA IN SQ KM
USA,Washington DC,9833520
Australia,Canberra,7692024
China,Beijing,9596961
Russia,Moscow,17098246
Brazil,Brasília,8515767
Canada,Ottawa,9984670


10. This example shows how to print rows based on equality condition, Note "==" operator is used

neeraj@ubuntu:~/WorkShop$ awk -F"," '$3==3287263{print $0}' Country.txt
India,Delhi,3287263


11. Again Variable "$NF" hold value at NF ( 3 Column ) position

neeraj@ubuntu:~/WorkShop$ awk -F"," '$NF>3287263{print $0}' Country.txt
COUNTRY,CAPITAL,AREA IN SQ KM
USA,Washington DC,9833520
Australia,Canberra,7692024
China,Beijing,9596961
Russia,Moscow,17098246
Brazil,Brasília,8515767
Canada,Ottawa,9984670


12. One more example with "NF" used with equality operator for comparision of value "$NF" position

neeraj@ubuntu:~/WorkShop$ awk -F"," '$NF==3287263{print $0}' Country.txt
India,Delhi,3287263


13. awk By default have " " ( space ) as its input field separator, Notice that in this example we did not specifiy input field separator hence " " space is input field sperator, hence from the line "South Africa,Cape Town,1221037" it has only printed string "South"

neeraj@ubuntu:~/WorkShop$ awk '{print $1}' Country.txt
COUNTRY,CAPITAL,AREA
India,Delhi,3287263
Japan,Tokoyo,377975
USA,Washington
UK,London,242495
Australia,Canberra,7692024
China,Beijing,9596961
Ukraine,Kyiv,603628
Russia,Moscow,17098246
Brazil,Brasília,8515767
South
France,Paris,643801
Taiwan,Taipei,36197
Canada,Ottawa,9984670


14. By using "+=$N" you can calculate sum of a specific column, Please refer below example , it also make uses of "BEGIN" ,"END" and "FS" keywords , this example starts with "BEGIN" where field separator has been specified, "FS" specify "Field seperator" jist like "-F",after that sum is calculated by "+=$N " at the "END" block prints the Sum

neeraj@ubuntu:~/WorkShop$ awk 'BEGIN{FS=","}; {sum+=$3} {print $0} END{print sum;}' Country.txt
COUNTRY,CAPITAL,AREA IN SQ KM
India,Delhi,3287263
Japan,Tokoyo,377975
USA,Washington DC,9833520
UK,London,242495
Australia,Canberra,7692024
China,Beijing,9596961
Ukraine,Kyiv,603628
Russia,Moscow,17098246
Brazil,Brasília,8515767
South Africa,Cape Town,1221037
France,Paris,643801
Taiwan,Taipei,36197
Canada,Ottawa,9984670
69133584


15. You can print substring with built in function "substr", you need to provide column number , start position within column number and length

neeraj@ubuntu:~/WorkShop$ awk -F"," '{print $1,substr($1,1,2)}' Country.txt
COUNTRY CO
India In
Japan Ja
USA US
UK UK
Australia Au
China Ch
Ukraine Uk
Russia Ru
Brazil Br
South Africa So
France Fr
Taiwan Ta
Canada Ca


16. You can print two functions in combination too, here we have used "substr" result as a input of "toupper" function

neeraj@ubuntu:~/WorkShop$ awk -F"," '{print $1,toupper(substr($1,1,2))}' Country.txt
COUNTRY CO
India IN
Japan JA
USA US
UK UK
Australia AU
China CH
Ukraine UK
Russia RU
Brazil BR
South Africa SO
France FR
Taiwan TA
Canada CA


17. you can use external or SHELL variable inside awk by using "-v" option, this comes handy when you need to compare any column with externally defined value at runtime, in this example we have printed the row where Second Column String is "Delhi".

neeraj@ubuntu:~/WorkShop$ MyVar=Delhi
neeraj@ubuntu:~/WorkShop$ awk -F"," -v x=$MyVar '$2 == x {print $0}' Country.txt
India,Delhi,3287263
neeraj@ubuntu:~/WorkShop$ MyVar=Paris
neeraj@ubuntu:~/WorkShop$ awk -F"," -v x=$MyVar '$2 == x {print $0}' Country.txt
France,Paris,643801


18. You can use "awk" as grep, in this example we have searched for string "London"

neeraj@ubuntu:~/WorkShop$ awk '/London/' Country.txt
UK,London,242495


19. You can even use wild card mask while searching lines. in this example "." ( dot ) represent a single character, we have searched for six character string which surrounded by "," ( at both start and End )

neeraj@ubuntu:~/WorkShop$ awk '/,......,/' Country.txt
Japan,Tokoyo,377975
UK,London,242495
Russia,Moscow,17098246
Taiwan,Taipei,36197
Canada,Ottawa,9984670


20. Here is another example of using wild card within "awk" and using it like "grep", this example prints lines starting with "U"

neeraj@ubuntu:~/WorkShop$ awk '/^U/' Country.txt
USA,Washington DC,9833520
UK,London,242495
Ukraine,Kyiv,603628


21. Following example Searches the pattern starting with "U" followed by any single character "." and then comma (,)

neeraj@ubuntu:~/WorkShop$ awk '/U.,/' Country.txt
UK,London,242495


22. "awk" will print the output in space separated format, if you use comma between fields

neeraj@ubuntu:~/WorkShop$ awk -F"," '{print $1,$2,$3}' Country.txt
COUNTRY CAPITAL AREA IN SQ KM
India Delhi 3287263
Japan Tokoyo 377975
USA Washington DC 9833520
UK London 242495
Australia Canberra 7692024
China Beijing 9596961
Ukraine Kyiv 603628
Russia Moscow 17098246
Brazil Brasília 8515767
South Africa Cape Town 1221037
France Paris 643801
Taiwan Taipei 36197
Canada Ottawa 9984670


23. "awk" will print the output without any separator, if you dont use comma between fields.


neeraj@ubuntu:~/WorkShop$ awk -F"," '{print $1 $2 $3}' Country.txt
COUNTRYCAPITALAREA IN SQ KM
IndiaDelhi3287263
JapanTokoyo377975
USAWashington DC9833520
UKLondon242495
AustraliaCanberra7692024
ChinaBeijing9596961
UkraineKyiv603628
RussiaMoscow17098246
BrazilBrasília8515767
South AfricaCape Town1221037
FranceParis643801
TaiwanTaipei36197
CanadaOttawa9984670


24. "awk" has built in variable "OFS" For separating output fields, it can be used with "BEGIN" block, here is the example, output is separated by , (comma )


neeraj@ubuntu:~/WorkShop$ echo "A B C" | awk 'BEGIN{OFS=","} {print $1,$2,$3}'
A,B,C


25. "OFS" can also be used with -v option, refer below example


neeraj@ubuntu:~/WorkShop$ echo "A B C" | awk -v OFS="," '{print $1,$2,$3}'
A,B,C


26. if you wish to use "OFS" along with "$0" , you need reset the field value using "$1=$1", here is the example

neeraj@ubuntu:~/WorkShop$ echo "A B C" | awk -v OFS="," '{$1=$1;print $0}'
A,B,C


27. "OFS" will not work here as we are not resetting field value

neeraj@ubuntu:~/WorkShop$ echo "A B C" | awk 'BEGIN{OFS=","} {print $0}'
A B C


28. lets apply "OFS" to seperate output fields by "|" ( pipe ) symbol, for our test file "Country.txt".

neeraj@ubuntu:~/WorkShop$ awk 'BEGIN{FS=","} { $1=$1; OFS="|"} {print $0}' Country.txt
COUNTRY CAPITAL AREA IN SQ KM
India|Delhi|3287263
Japan|Tokoyo|377975
USA|Washington DC|9833520
UK|London|242495
Australia|Canberra|7692024
China|Beijing|9596961
Ukraine|Kyiv|603628
Russia|Moscow|17098246
Brazil|Brasília|8515767
South Africa|Cape Town|1221037
France|Paris|643801
Taiwan|Taipei|36197
Canada|Ottawa|9984670


29. "awk" also has inbuilt variable called "FILENAME" , which can be used to print input filename

neeraj@ubuntu:~/WorkShop$ awk -F"," '{print FILENAME,$1}' Country.txt
Country.txt COUNTRY
Country.txt India
Country.txt Japan
Country.txt USA
Country.txt UK
Country.txt Australia
Country.txt China
Country.txt Ukraine
Country.txt Russia
Country.txt Brazil
Country.txt South Africa
Country.txt France
Country.txt Taiwan
Country.txt Canada


30. You can also use "awk" to print your desired string and separator between fields, as below example

neeraj@ubuntu:~/WorkShop$ awk -F"," '{print "Unix is great os,"$1","$2","$3}' Country.txt
Unix is great os,COUNTRY,CAPITAL,AREA IN SQ KM
Unix is great os,India,Delhi,3287263
Unix is great os,Japan,Tokoyo,377975
Unix is great os,USA,Washington DC,9833520
Unix is great os,UK,London,242495
Unix is great os,Australia,Canberra,7692024
Unix is great os,China,Beijing,9596961
Unix is great os,Ukraine,Kyiv,603628
Unix is great os,Russia,Moscow,17098246
Unix is great os,Brazil,Brasília,8515767
Unix is great os,South Africa,Cape Town,1221037
Unix is great os,France,Paris,643801
Unix is great os,Taiwan,Taipei,36197
Unix is great os,Canada,Ottawa,9984670



if you want learn to Basic Unix Commands in 1 Hour, here is the link

Basic Unix Commands in 1 Hour

if you want learn Unix/Linux Commands in detail, here is the link

Learn Unix/Linux Commands in detail

Also keep visiting my blog to learn more

unixtechworld.blogspot.com