<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-4726615324507041850</atom:id><lastBuildDate>Thu, 19 Dec 2024 03:30:49 +0000</lastBuildDate><category>30 DAY FAANG INTERVIEW PREPARATION</category><category>algorithms</category><category>dynamic programming</category><category>data structures</category><category>python</category><category>Comprehensive Data Structure and Algorithm Study Guide</category><category>hackerrank solution</category><category>hackerrank solutions data structures</category><category>hackerrank solutions python 30 days of code</category><category>code jam 2021</category><category>list of algorithms and data structures for competitive programming</category><category>placement course</category><category>CSES solutions</category><category>cses</category><category>gate 2022 cs syllabus</category><category>gate made easy material</category><category>Algorithms: How Prefix Sums Can Help Improving Operations Over Arrays</category><category>Best Data structures and algorithms tutorials</category><category>Compiling Important topics of data structures and algorithm And Coding tricks</category><category>Designer PDF Hackerrank Solution</category><category>Electronics Shop Hackerrank Solution</category><category>Made Easy Study Material for GATE CS 2022 pdf</category><category>c++</category><category>cses solution github</category><category>geeksforgeeks</category><category>simple array sum hackerrank</category><category>simple array sum hackerrank solution</category><category>stl c++</category><category>stl cheat sheet c++</category><category>1 day internship at swiggy</category><category>1-day internship 2021</category><category>40 Essential Linux Commands That Every User Should Know</category><category>6 Ways to List Network Interfaces in Debian 11</category><category>8 Ways to Generate a Random Password on Linux Shell</category><category>8pts)</category><category>&gt;How to Mount NFS on Debian 11</category><category>Amazon Interview Questions</category><category>C++ Program to Encrypt and Decrypt a File</category><category>CentOS 8 and Rocky Linux 8</category><category>Equalize the Array Hackerrank Solution</category><category>Find Devices Connected to Your Network with nmap on Ubuntu 22.04</category><category>GATE Syllabus 2022</category><category>Get Linux System and Hardware Details on the Command Line</category><category>Git and GitHub cheat sheet</category><category>GitHub Copilot</category><category>Handbook of Computer Science &amp; IT pdf</category><category>How to Add a User to Group on Linux</category><category>How to Change sudo Password in Ubuntu 22.04</category><category>How to Change the Keyboard Layout in Debian Desktop</category><category>How to Configure Network Settings in Ubuntu</category><category>How to Create Aliases for Customizing Commands in Ubuntu 22.04</category><category>How to Enable Low Graphics Mode in Ubuntu Linux</category><category>How to Flush DNS Cache on Ubuntu</category><category>How to Format a USB drive in Ubuntu</category><category>How to Install AWS-CLI on Ubuntu</category><category>How to Install Debian on Virtual Box</category><category>How to Install Fish Shell on Ubuntu and Linux Mint</category><category>How to Install Foxit PDF Reader on Ubuntu</category><category>How to Install LAMP Stack on Linux Mint</category><category>How to Install Postfix on AlmaLinux 8</category><category>How to Install ProFTPD on Ubuntu 22.04</category><category>How to Install Steam on Ubuntu</category><category>How to Install and Use Snapd on Debian 11</category><category>How to Install notepad++ Editor on Linux Mint</category><category>How to Kill Zombie Processes in Ubuntu</category><category>How to List Installed Packages on Ubuntu 22.04</category><category>How to Restart Network on Ubuntu 22.04</category><category>How to Securely Delete Files Using Shred Command in Debian 11</category><category>How to Show or Hide Line Numbers in Vim</category><category>How to Shut Down Ubuntu</category><category>How to Write a Shell Script in Ubuntu</category><category>How to install PHP 5.6</category><category>How to install and use iTunes on Ubuntu</category><category>How to keep Rocky Linux 8 up to date</category><category>How to password protect files using Vim editor in Ubuntu</category><category>How to use the Linux mtr (My Traceroute) command</category><category>Implementing Binary tree in C++</category><category>Is Coming to VS Code/Visual Studio</category><category>Learn the PERN Stack by building a web app - Full video course</category><category>Leetcode study plan</category><category>Leetcode study plan for faang</category><category>Linux Top 50 Commands</category><category>Linux csplit command explained (with examples)</category><category>Minecraft celebrates being the first game with over one trillion views on YouTube</category><category>Mini Max Sum Hackerrank Solution</category><category>Minimum queue</category><category>Minimum stack</category><category>Minimum stack / Minimum queue</category><category>Network Configuration in Debian 11</category><category>Nginx Performance Tuning</category><category>PERN stack</category><category>PHP 8.0 and PHP 8.1 on Ubuntu 22.04 LTS</category><category>Preorder Traversal of Binary Tree - Recursive</category><category>STL Quick Reference</category><category>Set Your Favorite Browser as Default through Ubuntu Command Line</category><category>Stack in Data structures and algorithms</category><category>Start online college today | Apply for online college classes | Online college application</category><category>Topic wise problems for Beginners</category><category>Transform the String (6pts</category><category>Tutorial: Web Scraping with Python Using Beautiful Soup</category><category>an AI Pair Programmer</category><category>bash scripting</category><category>carbon programming language</category><category>cli</category><category>command line tutorial</category><category>criminal justice degree online</category><category>docker</category><category>docker cheat sheet</category><category>ethical hacking</category><category>faang interview plan</category><category>gate cs 2022</category><category>gate cs material</category><category>git and github cheat sheet pdf</category><category>git and github commands</category><category>google code jam round 1A 2021</category><category>google kickstart 2021 round H</category><category>hacked exam code jam round 1a 2021</category><category>hacking</category><category>how to get internship at swiggy</category><category>how to setup sublime text for competitive programming</category><category>internshala 1-day internship 2021</category><category>k largest(or smallest) elements in an array | added Min Heap method</category><category>kickstart round b</category><category>leetcode study paln</category><category>linux</category><category>one day internship with certificate</category><category>picking numbers hackerrank solution</category><category>picking numbers hackerrank solution in cpp</category><category>prefix sum</category><category>round 1a codejam</category><category>simple array sum hackerrank solution in cpp</category><category>standard template library</category><category>start online college today | apply for online college classes | online college application&#xa;Top Self-Paced Online College Programs</category><category>stl</category><category>stl cheat sheet</category><category>stl cheat sheet github</category><category>stl library</category><category>swiggy internship 2021</category><category>what is smoke testing in software engineering</category><category>zomato internship</category><category>“Minecraft” produces 1 trillion views on YouTube</category><title>CoderPad</title><description>coderpad ,codeforces ,hackerank,code jam 2021,kickstart,dynamic programming, leetcode,codechef.&#xa;solution of competitive programming contest.&#xa;coding shark.&#xa;c++,geeksforgeeks.</description><link>https://coderpad.blogspot.com/</link><managingEditor>noreply@blogger.com (Nick)</managingEditor><generator>Blogger</generator><openSearch:totalResults>99</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-1821613031700145599</guid><pubDate>Fri, 27 Jan 2023 15:13:00 +0000</pubDate><atom:updated>2023-01-29T02:55:55.973-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">python</category><title>Python Read File</title><description>&lt;h1&gt;How to Read files in Python?&lt;/h1&gt;
&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;To read a file in Python, you can use the built-in &lt;code&gt;open()&lt;/code&gt; function to open the file, and then use the &lt;code&gt;.read()&lt;/code&gt; method to read its contents.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;For example:&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
# Open the file
f = open(&quot;example.txt&quot;, &quot;r&quot;)

# Read the contents of the file
contents = f.read()

# Print the contents
print(contents)

# Close the file
f.close()
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;You can also use a &lt;code&gt;with&lt;/code&gt; statement to automatically close the file after you are done reading it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
with open(&quot;example.txt&quot;, &quot;r&quot;) as f:
    contents = f.read()
    print(contents)
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;/span&gt;Or you can use &lt;code&gt;for&lt;/code&gt; loop to read file line by line:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
with open(&quot;example.txt&quot;, &quot;r&quot;) as f:
    for line in f:
        print(line)
&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;python read file line by line&lt;/h2&gt;
&lt;p&gt;You can &lt;code&gt;for&lt;/code&gt; for loop to read file line by line&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
with open(&quot;example.txt&quot;, &quot;r&quot;) as f:
    for line in f:
        print(line)
&lt;/code&gt;
&lt;/pre&gt;

&lt;h2&gt;Python read file line by line into list&lt;/h2&gt;
&lt;p&gt;You can use a &lt;code&gt;for&lt;/code&gt; loop to read a file line by line, and then use the &lt;code&gt;.append()&lt;/code&gt; method to add each line to a list. Here&#39;s an example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
# Initialize an empty list
lines = []

# Open the file
with open(&quot;example.txt&quot;, &quot;r&quot;) as f:
    # Loop through each line in the file
    for line in f:
        # Strip the newline character from the end of the line
        line = line.strip()
        # Append the line to the list
        lines.append(line)

# Print the list of lines
print(lines)
&lt;/code&gt;
&lt;/pre&gt;

&lt;h2&gt;Python read file line by line into list&lt;/h2&gt;
&lt;p&gt;You can also use &lt;code&gt;.readlines()&lt;/code&gt; method, it will read all lines and returns a list of lines.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
with open(&quot;example.txt&quot;, &quot;r&quot;) as f:
    lines = f.readlines()
    print(lines)
&lt;/code&gt;&amp;nbsp;&lt;/pre&gt;
&lt;p&gt;Both of the above examples will open the file &quot;example.txt&quot;, read its 
contents line by line, and store each line in a list called &lt;code&gt;lines&lt;/code&gt;. You can then access the lines in the list by their index, like &lt;code&gt;lines[0]&lt;/code&gt;, &lt;code&gt;lines[1]&lt;/code&gt;, etc.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;Python read file line by line and write to another file&lt;/h2&gt;
&lt;p&gt;You can use a &lt;code&gt;for&lt;/code&gt; loop to read a file line by line, and then use the &lt;code&gt;.write()&lt;/code&gt; method to write each line to a new file. Here&#39;s an example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
# Open the input file
with open(&quot;input.txt&quot;, &quot;r&quot;) as infile:
    # Open the output file
    with open(&quot;output.txt&quot;, &quot;w&quot;) as outfile:
        # Loop through each line in the input file
        for line in infile:
            # Write the line to the output file
            outfile.write(line)
&lt;/code&gt;
&lt;/pre&gt;


&lt;div class=&quot;relative flex w-[calc(100%-50px)] md:flex-col lg:w-[calc(100%-115px)]&quot;&gt;&lt;div class=&quot;flex flex-grow flex-col gap-3&quot;&gt;&lt;div class=&quot;min-h-[20px] flex flex-col items-start gap-4 whitespace-pre-wrap&quot;&gt;&lt;div class=&quot;markdown prose w-full break-words dark:prose-invert dark&quot;&gt;&lt;p&gt;You can use a &lt;code&gt;for&lt;/code&gt; loop to read a file line by line, and then use the &lt;code&gt;.write()&lt;/code&gt; method to write each line to a new file. Here&#39;s an example:&lt;/p&gt;
  
  &lt;pre&gt;
  &lt;code&gt;
  # Open the input file
with open(&quot;input.txt&quot;, &quot;r&quot;) as infile:
    # Open the output file
    with open(&quot;output.txt&quot;, &quot;w&quot;) as outfile:
        # Loop through each line in the input file
        for line in infile:
            # Write the line to the output file
            outfile.write(line)

  &lt;/code&gt;
  &lt;/pre&gt;
  
  &lt;p&gt;This code will open the file &quot;input.txt&quot; in read mode, read its contents line by line, and write each line to a new file called &quot;output.txt&quot; in write mode. If the output file already exists, it will be overwritten. If you want to append the contents to existing file, open the file in &quot;a&quot; mode instead of &quot;w&quot; mode.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
with open(&quot;input.txt&quot;, &quot;r&quot;) as infile:
    with open(&quot;output.txt&quot;, &quot;a&quot;) as outfile:
        for line in infile:
            outfile.write(line)
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;This code will open the input file in read mode, read its contents line 
by line, and append each line to a new file called &quot;output.txt&quot; in 
append mode. If the output file already exists, it will be preserved and
 new contents will be appended to it.&lt;/p&gt;&lt;pre&gt;&lt;/pre&gt;


&lt;h2&gt;python read file line by line until eof&lt;/h2&gt;
&lt;p&gt;You can use a &lt;code&gt;for&lt;/code&gt; loop to read a file line by line until the end of the file (EOF) is reached. Here&#39;s an example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
# Open the file
with open(&quot;example.txt&quot;, &quot;r&quot;) as f:
    # Loop through each line in the file
    for line in f:
        # Print the line
        print(line)
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;This code will open the file &quot;example.txt&quot; in read mode, read its contents line by line, and print each line to the console until the end of the file is reached. The &lt;code&gt;for&lt;/code&gt; loop will automatically stop iterating when there are no more lines left to read in the file.&lt;/p&gt;&lt;p&gt;You can also use &lt;code&gt;f.readline()&lt;/code&gt; method, it will read one line of the file and return it as a string. It will return empty string at the end of the file.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
with open(&quot;example.txt&quot;, &quot;r&quot;) as f:
    line = f.readline()
    while line:
        print(line)
        line = f.readline()
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;This code will open the file &quot;example.txt&quot; in read mode, read one line 
of the file at a time and print it to the console until the end of the 
file is reached. The while loop will continue to execute until the 
return value of &lt;code&gt;f.readline()&lt;/code&gt; is an empty string, indicating that the end of the file has been reached.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;

&lt;/code&gt;
&lt;/pre&gt;</description><link>https://coderpad.blogspot.com/2023/01/python-read-file.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-7787886282073994294</guid><pubDate>Wed, 07 Dec 2022 11:41:00 +0000</pubDate><atom:updated>2022-12-07T04:14:49.360-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">criminal justice degree online</category><title>25 Best Online Criminal Justice Degree Programs [2023 Guide]</title><description>&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Explore online Criminal Justice degree programs. Compare schools and see what you could be doing after you graduate.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Online Criminal Justice Degree&quot; class=&quot;alignnone wp-image-33498 size-full ls-is-cached lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/online-criminal-justice-degree-1.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/online-criminal-justice-degree-1.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/online-criminal-justice-degree-1-300x195.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/online-criminal-justice-degree-1-768x499.jpg 768w&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/online-criminal-justice-degree-1.jpg&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;A degree in Criminal Justice prepares you to work for the various 
levels of government in a wide range of roles. You could also work in 
the legal field.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
	
	&lt;/span&gt;&lt;section class=&quot;pullquote&quot;&gt;
		
			
						 			
		
	&lt;/section&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
	
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Criminal Justice graduates earn between $52,000 and $126,000 a year (Bureau of Labor Statistics) depending on their job.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Types of Online Criminal Justice Degrees&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Click on the area that interests you to jump to that part of the page.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a href=&quot;https://coderpad.blogspot.com/2022/12/criminal-justice-degree-online.html#online-bachelors-degree-criminal-justice&quot;&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;Criminal Justice&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a href=&quot;https://coderpad.blogspot.com/2022/12/criminal-justice-degree-online.html#online-corrections-bachelors-degree-program&quot;&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;Corrections&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a href=&quot;https://coderpad.blogspot.com/2022/12/criminal-justice-degree-online.html#crime-scene-investigation&quot;&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;Crime Scene Investigation (CSI)&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;&lt;a href=&quot;https://coderpad.blogspot.com/2022/12/criminal-justice-degree-online.html#online-bachelors-emergency-management&quot;&gt;Emergency Management&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a href=&quot;https://coderpad.blogspot.com/2022/12/criminal-justice-degree-online.html#homeland-security-online-bachelors&quot;&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;Homeland Security&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a href=&quot;https://coderpad.blogspot.com/2022/12/criminal-justice-degree-online.html#law-enforcement-online-bachelors-degree&quot;&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;Law Enforcement&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;While these areas are all related, each one will prepare you for a different career.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h3 id=&quot;online-bachelors-degree-criminal-justice&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Criminal Justice&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;police officers investigating the crime scene&quot; class=&quot;alignnone wp-image-33499 size-full lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/criminal-justice-1.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/criminal-justice-1.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/criminal-justice-1-300x195.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/criminal-justice-1-768x499.jpg 768w&quot; height=&quot;500&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/criminal-justice-1.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;If you are the type of person who dreams of protecting the innocent 
and sending offenders behind bars, then you might pursue a degree in 
criminal justice.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;This degree can help you learn what you need to know about the 
criminal justice system, particularly how its three major 
institutions—law enforcement, corrections system, and the 
courts—function.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
	
	&lt;/span&gt;&lt;section class=&quot;pullquote&quot;&gt;
		
			
						 			
		
	&lt;/section&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
	
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Students are typically trained to develop strong leadership and management skills and how to be analytical and diplomatic.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Upon graduation, criminal justice majors can find a host of 
employment opportunities. You might be a cool FBI special agent. You may
 also work as a crime scene investigator, a probation officer, or a 
police detective.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h3 id=&quot;online-corrections-bachelors-degree-program&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Corrections&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;corrections officer assisting an inmate&quot; class=&quot;alignnone wp-image-33500 size-full lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/corrections-1.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/corrections-1.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/corrections-1-300x195.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/corrections-1-768x499.jpg 768w&quot; height=&quot;500&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/corrections-1.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;If you believe that criminal offenders should be given the 
opportunity to rehabilitate themselves, then you should consider getting
 a corrections degree.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;You can not only get the chance to land a good-paying job but also 
test your conflict-resolution skills and even help convicts get back on 
the right track.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
	
	&lt;/span&gt;&lt;section class=&quot;pullquote&quot;&gt;
		
			
						 			
		
	&lt;/section&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
	
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;As you prepare yourself for work inside correctional facilities, 
common topics of study may include public safety and correctional 
methods. Most degrees in this field include training in conflict 
resolution skills, such as how to maintain your cool and composure, 
which can help you in enforcing rules.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Upon graduation, you will likely work in prisons or jails, but you 
may also find employment opportunities in private security firms and 
even hospital settings.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h3 id=&quot;crime-scene-investigation&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Crime Scene Investigation (CSI)&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;crime scene investigator taking pictures in a crime scene&quot; class=&quot;alignnone wp-image-33501 size-full lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/crime-scene-investigation-1.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/crime-scene-investigation-1.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/crime-scene-investigation-1-300x195.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/crime-scene-investigation-1-768x499.jpg 768w&quot; height=&quot;500&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/crime-scene-investigation-1.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;You’ve probably dreamt of becoming a crime scene investigator because
 of shows like CSI and NCIS. While the job is a lot more difficult than 
what TV often depicts, there is no denying that being a crime scene 
investigator is one of the more colorful jobs you can get.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The ideal candidate for a degree in CSI is analytical, organized, 
methodical, and hardworking. Common studies in CSI degrees include 
ethics, psychology, criminal justice, chemistry, physics, and legal 
studies.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
	
	&lt;/span&gt;&lt;section class=&quot;pullquote&quot;&gt;
		
			
						 			
		
	&lt;/section&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
	
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Upon graduation, you can find employment opportunities in law 
enforcement agencies. You may also find work in private detective firms.
 Your education should prepare you for the rigors of the job, including 
being investigating disturbing crime scenes.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Aside from being physically fit, you must also be able to handle stressful working environments.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h3 id=&quot;online-bachelors-emergency-management&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Emergency Management&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;first aid responders assisting a patient&quot; class=&quot;alignnone wp-image-33502 size-full lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/emergency-management-1.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/emergency-management-1.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/emergency-management-1-300x195.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/emergency-management-1-768x499.jpg 768w&quot; height=&quot;500&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/emergency-management-1.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Pursue a degree in emergency management if you dream of helping 
people during disasters such as tornadoes, wildfires, and storms.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;You may also enjoy this field if you like helping people prepare for natural or man-made disasters.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
	
	&lt;/span&gt;&lt;section class=&quot;pullquote&quot;&gt;
		
			
						 			
		
	&lt;/section&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
	
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;With a degree in emergency management, you may find yourself working 
in public and private organizations such as the Department of Homeland 
Security and the Red Cross.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;You may work as a firefighter, first aid responder, or an emergency 
systems specialist. As you gain more experience and earn the necessary 
education or accreditation, you may even take up more senior roles such 
as the emergency services system director.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h3 id=&quot;homeland-security-online-bachelors&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Homeland Security&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;SWAT officers preparing to enter a building&quot; class=&quot;alignnone wp-image-33503 size-full lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/homeland-security-1.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/homeland-security-1.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/homeland-security-1-300x195.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/homeland-security-1-768x499.jpg 768w&quot; height=&quot;500&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/homeland-security-1.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;You may find a degree in homeland security worth taking if you have 
an interest in identifying, mitigating, and controlling national 
security risks.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;While a homeland security degree can lead you to a job in law 
enforcement, it may also be your ticket to a job in criminal justice, 
emergency response, and cybersecurity, among others.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;A homeland security degree program can help give you a strong 
foundation in areas such as intelligence, counter-terrorism, border 
security, and emergency management. Other common studies include 
training in cyber warfare, terrorist groups, and transnational security,
 among others.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
	
	&lt;/span&gt;&lt;section class=&quot;pullquote&quot;&gt;
		
			
						 			
		
	&lt;/section&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
	
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Upon graduation, you are likely to find work in the federal 
government. One of the largest employers of homeland security degree 
holders is the Department of Homeland Security, with more than 240,000 
employees.&amp;nbsp;You may also find employment in law enforcement agencies, 
emergency management companies, and security firms.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;A growing number of universities offer both on-campus as well as &lt;span style=&quot;color: #333333;&quot;&gt;&lt;a href=&quot;https://www.mydegreeguide.com/homeland-security-degree-online/&quot; style=&quot;color: #333333;&quot;&gt;online homeland security degree&lt;/a&gt;&lt;/span&gt; programs.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h3 id=&quot;law-enforcement-online-bachelors-degree&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Law Enforcement&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;police officers wearing helmet and virus during a demonstration&quot; class=&quot;alignnone wp-image-33504 size-full lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/law-enforcement-1.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/law-enforcement-1.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/law-enforcement-1-300x195.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/law-enforcement-1-768x499.jpg 768w&quot; height=&quot;500&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/law-enforcement-1.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;You can help prepare yourself for a lucrative career in criminal justice by earning a degree in law enforcement.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;With a law enforcement degree, you can gain the knowledge, training, 
and qualification to become a police officer, detective, or probation or
 parole officer, among others.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
	
	&lt;/span&gt;&lt;section class=&quot;pullquote&quot;&gt;
		
			
						 			
		
	&lt;/section&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
	
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Some of the courses you’d likely take when pursuing a law enforcement
 degree are investigative techniques, modern policing, law enforcement 
operations, and criminal investigations.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Law enforcement degree candidates are trained to be analytical and 
organized. They are also expected to be physically fit and mentally 
tough.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Courses for an Online Criminal Justice Degree&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Courses for an Online Criminal Justice Degree&quot; class=&quot;alignnone wp-image-33505 size-full lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/courses-for-an-online-criminal-justice-degree-1.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/courses-for-an-online-criminal-justice-degree-1.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/courses-for-an-online-criminal-justice-degree-1-300x195.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/courses-for-an-online-criminal-justice-degree-1-768x499.jpg 768w&quot; height=&quot;500&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/courses-for-an-online-criminal-justice-degree-1.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The courses offered in an online criminal justice program differ 
depending on the school, educational path, and career goals of the 
students. However, below are some of the courses you are likely to take 
during the course of a criminal justice degree program:&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;b&gt;Criminal Justice&lt;/b&gt;— provides a deeper understanding 
of criminal laws, courtroom procedures, and the criminal process from 
arrest, detention, and incarceration.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;b&gt;Victimology&lt;/b&gt; – discusses the experiences of victims 
as they move through the criminal justice system to give a better 
understanding of victimization patterns, among others.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;b&gt;Ethics and Diversity&lt;/b&gt; — discusses the ethical practice of law enforcement, particularly in incorporating cultural awareness in various communities.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;b&gt;Terrorism &lt;/b&gt;— gives a closer look at the behavior and
 motivations of terrorist groups as well as the effects of terrorist 
activities at local and national levels&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;b&gt;Drugs and Crime&lt;/b&gt; — discusses the origins of drug 
addiction and how it is related to crime. Students also learn and 
analyze drug policies, drug treatment, and drug prevention programs.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;You’ll also take classes specific to your concentration.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Criminal Justice Degree Salary&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;picture class=&quot;alignnone wp-image-57732 size-full sp-no-webp&quot;&gt;&lt;source data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2022/09/criminal-justice-degree-salary-3.webp 770w,https://www.mydegreeguide.com/wp-content/uploads/2022/09/criminal-justice-degree-salary-3-300x195.webp 300w,https://www.mydegreeguide.com/wp-content/uploads/2022/09/criminal-justice-degree-salary-3-768x499.webp 768w&quot; type=&quot;image/webp&quot;&gt;&lt;/source&gt;&lt;source data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2022/09/criminal-justice-degree-salary-3.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2022/09/criminal-justice-degree-salary-3-300x195.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2022/09/criminal-justice-degree-salary-3-768x499.jpg 768w&quot; type=&quot;image/jpeg&quot;&gt;&lt;/source&gt;&lt;img alt=&quot;Criminal Justice Degree Salary&quot; class=&quot;alignnone wp-image-57732 size-full sp-no-webp lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2022/09/criminal-justice-degree-salary-3.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2022/09/criminal-justice-degree-salary-3.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2022/09/criminal-justice-degree-salary-3-300x195.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2022/09/criminal-justice-degree-salary-3-768x499.jpg 768w&quot; height=&quot;500&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2022/09/criminal-justice-degree-salary-3.jpg&quot; width=&quot;770&quot; /&gt;&lt;/picture&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;You may be surprised to learn that a criminal justice degree can open up a wide range of employment opportunities.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;According to the Bureau of Labor Statistics, some careers in the criminal justice field include:&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;table style=&quot;width: 436px;&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td width=&quot;298&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;b&gt;Careers&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot; width=&quot;138&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;b&gt;Annual Median Salary&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Lawyer&lt;/span&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;$126,930&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;FBI Agent&lt;/span&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;$92,080&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Detective and Criminal Investigator&lt;/span&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;$86,940&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Arbitrator&lt;/span&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;$66,130&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Police Officer&lt;/span&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;$65,540&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Forensic Analyst&lt;/span&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;$60,590&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Probation Officer&lt;/span&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;$55,690&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Private Detective and Investigator&lt;/span&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;$53,320&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Paralegal&lt;/span&gt;&lt;/td&gt;
&lt;td style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;$52,920&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;While education is the largest factor in determining your starting 
salary, performance and experience will be what moves you up in your 
organization.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Professional Organizations for Those with a Criminal Justice Degree&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Professional Organizations for Those with a Criminal Justice Degree&quot; class=&quot;alignnone wp-image-33507 size-full lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/professional-organizations-for-criminal-justice-degree-1.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/professional-organizations-for-criminal-justice-degree-1.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/professional-organizations-for-criminal-justice-degree-1-300x195.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/professional-organizations-for-criminal-justice-degree-1-768x499.jpg 768w&quot; height=&quot;500&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/professional-organizations-for-criminal-justice-degree-1.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The criminal justice field has become quite competitive in recent 
years. Joining professional organizations can help criminal justice 
degree holders build their credentials and expand their network.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.aafs.org/&quot;&gt;American Academy of Forensic Science&lt;/a&gt;&amp;nbsp;–
 Founded in 1948, the American Academy of Forensic Sciences is a group 
of forensic science professionals based in Colorado, USA. It has members
 from more than 70 countries. It promotes professionalism, competency, 
and integrity in the forensic science field.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://www.aca.org/&quot;&gt;American Correctional Association&lt;/a&gt;
 – A private and non-profit trade group, the American Correctional 
Association is the oldest and largest trade association for the 
corrections industry. Founded in 1870, it had played a significant role 
in prison reform in the United States. An accrediting body, it has 
accredited more than 900 prisons, jails, and other correctional 
facilities in the US.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.americanjail.org/&quot;&gt;American Jail Association&lt;/a&gt;&amp;nbsp;–
 The AJA offers a career resource for individuals looking to gain 
employment in the corrections field. This association has members from 
more than 3,500 jails and correctional institutions in the United 
States.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.ncja.org/&quot;&gt;National Criminal Justice Association&lt;/a&gt;&amp;nbsp;–
 This non-profit and non-partisan association has members from the law 
enforcement, corrections, academics, and justice communities.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Joining one or more of these organizations as a student can give you 
additional insights into the industry through publications, industry 
news, and job boards.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Accreditation for a Criminal Justice Degree Online&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Accreditation for a Criminal Justice Degree Online&quot; class=&quot;alignnone wp-image-33508 size-full lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/accreditation-for-criminal-justice-degree-online-1.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/accreditation-for-criminal-justice-degree-online-1.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/accreditation-for-criminal-justice-degree-online-1-300x195.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/accreditation-for-criminal-justice-degree-online-1-768x499.jpg 768w&quot; height=&quot;500&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/accreditation-for-criminal-justice-degree-online-1.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Accreditation is an important factor when searching for a criminal 
justice degree online. Consider enrolling in a college or university 
with a regional accreditation as this ensures that the institution 
provides quality education.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Employers also tend to give preference to candidates with criminal 
justice degrees from colleges and universities with regional 
accreditation.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
	
	&lt;/span&gt;&lt;section class=&quot;pullquote&quot;&gt;
		
			
						 			
		
	&lt;/section&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
	
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;US colleges and universities offering criminal justice programs may 
also have national accreditation, which is considered less prestigious 
than regional accreditation. Nationally-accredited schools, though, may 
offer more affordable criminal justice programs.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Financial Aid for a Criminal Justice Bachelors Degree Online&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Financial Aid for a Criminal Justice Bachelors Degree Online&quot; class=&quot;alignnone wp-image-33509 size-full lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/financial-aid-for-criminal-justice-bachelors-degree-online-1.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/financial-aid-for-criminal-justice-bachelors-degree-online-1.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/financial-aid-for-criminal-justice-bachelors-degree-online-1-300x195.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/financial-aid-for-criminal-justice-bachelors-degree-online-1-768x499.jpg 768w&quot; height=&quot;500&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/financial-aid-for-criminal-justice-bachelors-degree-online-1.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Some students apply for private or federal loans to help them finance
 their criminal justice education. If you take this route, you will have
 to repay your lender upon graduation.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;You can also look and apply for scholarships and grants, which don’t 
have to be repaid. You’ll have to meet strict requirements to qualify, 
though, such as submitting an essay detailing your achievements and 
compelling reasons why you should be given the scholarship.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;See what federal aid you qualify for by filling out the &lt;a class=&quot;external&quot; href=&quot;https://studentaid.gov/h/apply-for-aid/fafsa&quot;&gt;Free Application for Federal Student Aid (FAFSA)&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;You can then apply for private scholarships, including the &lt;a class=&quot;external&quot; href=&quot;https://www.collegesuccessfoundation.org/scholarship/martin-luther-king-jr-scholarship/#about&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;Martin Luther King, Jr. scholarship&lt;/a&gt;, which is open to minority students currently enrolled or about to be accepted to an undergraduate criminal justice program.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;You can also apply for a scholarship under the &lt;a class=&quot;external&quot; href=&quot;https://crimcheck.net/resources/criminal-justice-scholarship/&quot;&gt;Melissa Linville Criminal Justice program&lt;/a&gt;, which benefits freshmen planning to major in criminal justice.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Other scholarships that you may want to try applying to are the &lt;a class=&quot;external&quot; href=&quot;https://www.acfe.com/scholarship.aspx&quot;&gt;Ritchie-Jennings Memorial Scholarships&lt;/a&gt; and the &lt;a class=&quot;external&quot; href=&quot;https://noblenational.org/national-scholarship-application/&quot;&gt;National Organization of Black Law Enforcement Executives (NOBLE) scholarships&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Questions Related to Earning a Bachelor Degree in Criminal Justice Online&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;lawyers discussing in the office&quot; class=&quot;alignnone wp-image-33511 size-full lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/earning-a-bachelor-degree-in-criminal-justice-online.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/earning-a-bachelor-degree-in-criminal-justice-online.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/earning-a-bachelor-degree-in-criminal-justice-online-300x195.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/earning-a-bachelor-degree-in-criminal-justice-online-768x499.jpg 768w&quot; height=&quot;500&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/earning-a-bachelor-degree-in-criminal-justice-online.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Here are our answers to a few more questions you might have.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Can You Get a Criminal Justice Degree Online?&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Yes, you can earn a Criminal Justice degree online. There’s a good 
number of colleges and universities across the country offering online 
criminal justice degrees.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Coursework for these programs is of the same quality as on-campus 
classes. You will also have the same professional opportunities as those
 who earn criminal justice degrees on-campus.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;How Long Does It Take to Get a Criminal Justice Degree Online?&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;How long it takes to get a Criminal Justice degree online depends on 
the level of degree you want to take. You may earn a certificate program
 in criminal justice, which you can complete in 6 to 12 months. But this
 may not be enough to land you a job after graduation.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
	
	&lt;/span&gt;&lt;section class=&quot;pullquote&quot;&gt;
		
			
						 			
		
	&lt;/section&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
	
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;You may also take up an associate degree, which typically takes two years to complete. Bachelor’s and &lt;span style=&quot;color: #333333;&quot;&gt;&lt;a href=&quot;https://www.mydegreeguide.com/online-masters-criminal-justice-no-gre/&quot; style=&quot;color: #333333;&quot;&gt;master’s degrees in criminal justice&lt;/a&gt;&lt;/span&gt; typically take 3-4 years.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;As an alternate plan, you could explore programs that offer &lt;span style=&quot;color: #333333;&quot;&gt;&lt;a href=&quot;https://www.mydegreeguide.com/accelerated-classes/&quot; style=&quot;color: #333333;&quot;&gt;4 week online college credit courses&lt;/a&gt;&lt;/span&gt;, which may help you to finish your degree faster.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;How Much Does Criminal Justice Degree Cost?&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Criminal Justice Degree student studying online&quot; class=&quot;alignnone wp-image-33512 size-full lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/criminal-justice-degree-cost.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/criminal-justice-degree-cost.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/criminal-justice-degree-cost-300x195.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/criminal-justice-degree-cost-768x499.jpg 768w&quot; height=&quot;500&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/criminal-justice-degree-cost.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;How much a Criminal Justice degree costs depends on the level of 
degree you’ll be taking. An associate degree, which appeals to students 
who want to start a career in criminal justice in the shortest time 
possible, is the shortest to complete at 2 years on average.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The U.S. Department of Education says the average annual cost for an 
associate criminal justice degree is $21,141. Expect to spend at least 
$42,282 to complete this degree.&amp;nbsp;Double that amount for a bachelor 
degree.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;What Is the Best Online College for Criminal Justice?&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The best online college for a criminal justice degree is one that is regionally-accredited.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;You should also take into consideration other factors in choosing an 
online college for criminal justice degrees such as tuition fees, 
faculty longevity and credentials, and overall graduation rate.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;What Are the Cheapest Online Criminal Justice Degree Programs?&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Criminal Justice Degree student studying online at home&quot; class=&quot;alignnone wp-image-33513 size-full lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/cheapest-online-criminal-justice-degree-programs.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/cheapest-online-criminal-justice-degree-programs.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/cheapest-online-criminal-justice-degree-programs-300x195.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/cheapest-online-criminal-justice-degree-programs-768x499.jpg 768w&quot; height=&quot;500&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/cheapest-online-criminal-justice-degree-programs.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;You won’t have to pay thousands of dollars in tuition fees to get a criminal justice degree.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;There are educational institutions offering affordable online 
criminal justice degree programs. Some of the most affordable degree 
programs cost just $200 per credit hour.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Universities Offering Criminal Justice Degrees Online&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Methodology: The following school list is in alphabetical order. To 
be included, a college or university must be regionally accredited and 
offer degree programs online or in a hybrid format.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Arizona State University&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Arizona State University campus&quot; class=&quot;alignnone size-full wp-image-19381 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/arizona-state-university-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/arizona-state-university-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/12/arizona-state-university-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/12/arizona-state-university-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/arizona-state-university-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Arizona State University offers a BS in Criminology and Criminal 
Justice. The program is a 120-credit-hour program with a total of 40 
classes with each class lasting for 7.5&amp;nbsp; weeks.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Students who maintain a GPA of 3.40 and higher can apply to the &lt;span style=&quot;color: #333333;&quot;&gt;&lt;a href=&quot;https://www.mydegreeguide.com/accelerated-degrees/accelerated-criminal-justice-degree-online/&quot; style=&quot;color: #333333;&quot;&gt;accelerated criminal justice degree program&lt;/a&gt;&lt;/span&gt;, which can allow them to complete the BS and MA in just 5 years.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminology and Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://asuonline.asu.edu/online-degree-programs/undergraduate/bachelor-science-criminology-and-criminal-justice/&quot;&gt;Arizona State University&lt;/a&gt; is accredited&amp;nbsp;by the Higher Learning Committee.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Ball State University&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Ball State University campus&quot; class=&quot;alignnone size-full wp-image-17238 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/ball-state-university-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/ball-state-university-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/11/ball-state-university-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/11/ball-state-university-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/ball-state-university-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Ball State University offers a BS in Criminal Justice and Criminology
 that has the unique feature of allowing you to customize your degree 
based on the career path you want to enter.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;This program is ideal for persons working in criminology and criminal
 justice who wish to achieve their degree while juggling family and 
jobs.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice and Criminology&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.bsu.edu/academics/collegesanddepartments/online/academic-programs/bachelors/cjc&quot;&gt;BSU&lt;/a&gt; is&amp;nbsp;accredited&amp;nbsp;by the Higher Learning Commission.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Bellevue University&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Bellevue University campus&quot; class=&quot;alignnone size-full wp-image-19389 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/bellevue-university-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/bellevue-university-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/12/bellevue-university-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/12/bellevue-university-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/bellevue-university-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Bellevue University offers a BS in Criminal Justice and Emergency 
Management. The degree features a total of 127 credit hours and is 
offered on campus and online.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;This is ideal for people who have deep-rooted values as justice, 
integrity, and honesty. Students can learn corrections, law enforcement,
 and court systems.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Emergency Management&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.bellevue.edu/degrees/&quot;&gt;Bellevue University&lt;/a&gt;&amp;nbsp;is&amp;nbsp;accredited by the Higher Learning Commission.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Bemidji State University&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Bemidji State University campus&quot; class=&quot;alignnone size-full wp-image-22947 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/02/bemidji-state-university-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/02/bemidji-state-university-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/02/bemidji-state-university-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/02/bemidji-state-university-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/02/bemidji-state-university-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Bemidji State University offers a BS in Criminal Justice, which is 
provided partly online. The last two years of the BS are provided 
entirely online. Students pursuing this degree can choose to emphasize 
in Corrections, Law Enforcement, Victimology, and Tribal Justice.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The program is delivered entirely online, and there is the option to enroll for on-campus classes as well.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.bemidjistate.edu/academics/departments/criminal-justice/courses-and-programs/criminal-justice-b-s/&quot;&gt;Bemidji State University&lt;/a&gt;&amp;nbsp;is fully&amp;nbsp;accredited by the Higher Learning Commission.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Central Methodist University&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Central Methodist University campus&quot; class=&quot;alignnone size-full wp-image-20950 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/central-methodist-university-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/central-methodist-university-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/12/central-methodist-university-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/12/central-methodist-university-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/central-methodist-university-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Central Methodist University offers both a BA &amp;amp; BS in Criminal 
Justice. This program covers everything from profiling, serial crime, 
and American society law. Students get the opportunity to build the 
necessary skills for becoming a professional in the real world.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Courses covered include policing, criminal law, and the entire legal system.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BA in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.centralmethodist.edu/academics/undergraduate/criminal-justice/index.html&quot;&gt;CMU&lt;/a&gt; is accredited and/or recognized by&amp;nbsp;the Higher Learning Commission.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Colorado State University&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Colorado State University campus&quot; class=&quot;alignnone size-full wp-image-20334 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/colorado-state-university-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/colorado-state-university-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/12/colorado-state-university-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/12/colorado-state-university-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/colorado-state-university-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Colorado State University offers a Bachelor’s in Criminal Justice. 
This is a 120-credit-hour program that provides students with the 
knowledge and skills they need to perform in the criminal justice 
industry.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Students can learn law enforcement, managerial skills, and more to help with the smooth running of industry agencies.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Bachelor’s in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://learn.csuglobal.edu/bs-criminal-justice&quot;&gt;Colorado State&lt;/a&gt;&amp;nbsp;is&amp;nbsp;accredited by The Higher Learning Commission.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Crown College&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Crown College campus&quot; class=&quot;alignnone size-full wp-image-17288 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/crown-college-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/crown-college-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/11/crown-college-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/11/crown-college-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/crown-college-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Crown College offers a BS in Criminal Justice as well as a BS in 
Disaster and Emergency Management. This degree is ideal for anyone who 
wants to join the growing and exciting field of criminal justice.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The program here is a Christ-centered one with a broad overview of 
criminal justice, giving students multiple entry points to start their 
career.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Disaster and Emergency Management&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.crown.edu/online-grad/&quot;&gt;Crown College&lt;/a&gt;&amp;nbsp;is&amp;nbsp;accredited by the Higher Learning Commission.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Dallas Baptist University&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Dallas Baptist University campus&quot; class=&quot;alignnone size-full wp-image-17686 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2014/10/dallas-baptist-university-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2014/10/dallas-baptist-university-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2014/10/dallas-baptist-university-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2014/10/dallas-baptist-university-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2014/10/dallas-baptist-university-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Dallas Baptist University offers both a BA and a BS in Criminal 
Justice. Students of these programs are provided with a general scope of
 American crime and the criminal justice system.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Students enrolled in this program prepare for careers in the judicial
 system, in law enforcement, in corrections, juvenile justice, social 
services, and more.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BA in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.dbu.edu/online/programs/undergraduate-degrees&quot;&gt;Dallas Baptist University&lt;/a&gt;&amp;nbsp;is&amp;nbsp;accredited by the Southern Association of Colleges and Schools Commission on Colleges.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Drury University&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Drury University campus&quot; class=&quot;alignnone size-full wp-image-23280 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/01/drury-university-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/01/drury-university-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2020/01/drury-university-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2020/01/drury-university-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/01/drury-university-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Drury University offers three different options. There is a BS degree
 in Criminal Justice, one in Emergency Management, and One in Law 
Enforcement.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Students who are certain about which areas they want to pursue 
underneath the criminal justice umbrella may find these specific 
programs of interest. Students who are still unsure may find the 
Criminal Justice program ideal.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Emergency Management&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Law Enforcement&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.drury.edu/go/evening-and-online-degrees-and-certificates/&quot;&gt;Drury University&lt;/a&gt;&amp;nbsp;is&amp;nbsp;accredited by the Higher Learning Commission.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Granite State College&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Granite State College campus&quot; class=&quot;alignnone size-full wp-image-17863 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2014/10/granite-state-college-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2014/10/granite-state-college-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2014/10/granite-state-college-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2014/10/granite-state-college-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2014/10/granite-state-college-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Granite State College offers an online BS degree in Criminal Justice.
 The program is designed to prepare students to work in corrections, 
parole, advocacy, and probation roles, among others.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The program is unique in that it allows students to demonstrate their
 knowledge level and have this applied to their credit. Students who 
have work experience or volunteer-based experiences and training can 
earn credit hours for these.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.granite.edu/degree-programs/bachelors-degrees/criminal-justice/&quot;&gt;Granite State College&lt;/a&gt;&amp;nbsp;is&amp;nbsp;accredited by the New England Commission of Higher Education.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Liberty University&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Liberty University campus&quot; class=&quot;alignnone size-full wp-image-19094 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/liberty-university-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/liberty-university-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/12/liberty-university-campus-300x117.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/12/liberty-university-campus-768x299.jpg 768w&quot; height=&quot;300&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/liberty-university-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Liberty University offers a total of 9 online degrees that can help 
students prepare for a career in law enforcement, criminal justice, 
crime scene investigation, criminal psychology, and more.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Each degree program has a specific focus prepare students for particular jobs in a particular niche field of Criminal Justice.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice – Business Administration and Management&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice – Crime Scence Investigation&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice – Criminal Psychology&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice – Homeland Security&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice – Juvenile Justice&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice – Public Administration&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice – Strategic Intelligence&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Law and Policy&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Law and Policy – Pre-Law&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.liberty.edu/online/programs/&quot;&gt;Liberty University&lt;/a&gt;&amp;nbsp;is&amp;nbsp;accredited by the Southern Association of Colleges and Schools Commission on Colleges.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Regent University&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Regent University campus&quot; class=&quot;alignnone size-full wp-image-17245 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/regent-university-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/regent-university-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/11/regent-university-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/11/regent-university-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/regent-university-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Regent University offers a BS in Criminal Justice along with a BS in 
Professional Studies with an emphasis. Programs are offered on campus as
 well as online.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The BS in Criminal Justice has a focus on homeland security, making 
it a perfect fit for students who want to get into careers in that 
field.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Professional Studies – Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.regent.edu/academic-degrees/&quot;&gt;Regent University&lt;/a&gt; is accredited by the Southern Association of Colleges and Schools Commission on Colleges.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Sam Houston State University&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Sam Houston State University campus&quot; class=&quot;alignnone size-full wp-image-17248 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/sam-houston-state-university-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/sam-houston-state-university-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/11/sam-houston-state-university-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/11/sam-houston-state-university-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/sam-houston-state-university-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Sam Houston State University offers a BA in Criminal Justice and a BA
 in Homeland Security Studies. They also offer a BS in Criminal Justice 
and a BS in Homeland Security Studies.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;These courses provide students the ability to study at research 
institutes. The program also allows students to access world-renowned 
correctional and law enforcement training.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BA in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BA in Homeland Security Studies&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Homeland Security Studies&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.shsu.edu/academics/degrees.html?degTyp=bach&quot;&gt;Sam Houston State University&lt;/a&gt;&amp;nbsp;is&amp;nbsp;accredited by the Southern Association of Colleges and Schools Commission on Colleges.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Thomas Edison State University&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Thomas Edison State University campus&quot; class=&quot;alignnone size-full wp-image-17658 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/thomas-edison-state-university-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/thomas-edison-state-university-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/11/thomas-edison-state-university-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/11/thomas-edison-state-university-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/thomas-edison-state-university-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Thomas Edison State University offers both a BA in Criminal Justice 
and a BS in Homeland Security and Emergency Management. These programs 
are suitable for adult learners and persons who have experience in law 
enforcement.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The program is designed to allow these people the opportunity to step up the career ladder.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BA in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Homeland Security and Emergency Management&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.tesu.edu/academics/online-degrees&quot;&gt;Thomas Edison State University&lt;/a&gt; is regionally accredited by the&amp;nbsp;Middle States Commission on Higher Education.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;University of Central Florida&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;University of Central Florida campus&quot; class=&quot;alignnone size-full wp-image-21903 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/01/university-of-central-florida-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/01/university-of-central-florida-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/01/university-of-central-florida-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/01/university-of-central-florida-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/01/university-of-central-florida-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The University of Central Florida offers a BA and a BS degree in 
Criminal Justice. The programs are 120-credit-hour programs that are 
delivered entirely online. The program provides online, interactive 
coursework as well as hands-on training in some instances.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Students can learn the skills and knowledge they need to enter the various careers in the criminal justice system.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BA in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The&amp;nbsp;&lt;a class=&quot;external&quot; href=&quot;https://www.ucf.edu/online/programs/&quot;&gt;University of Central Florida&lt;/a&gt;&amp;nbsp;is&amp;nbsp;accredited by the Southern Association of Colleges and Schools Commission on Colleges.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;University of Mary&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;University of Mary campus&quot; class=&quot;alignnone size-full wp-image-20366 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/university-of-mary-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/university-of-mary-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/12/university-of-mary-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/12/university-of-mary-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/university-of-mary-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The University of Mary offers students a BS in Criminal Justice. The 
degree is offered entirely online and gives students the ability to take
 their criminal justice career to the next level. Students are allowed 
to transfer qualifying credits and can finish the program in as little 
as two years.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The&amp;nbsp;&lt;a class=&quot;external&quot; href=&quot;https://online.umary.edu/academics/bachelors-programs/criminal-justice&quot;&gt;University of Mary&lt;/a&gt;&amp;nbsp;is&amp;nbsp;accredited by The Higher Learning Commission.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;University of Maryland Global Campus&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;University of Maryland Global campus&quot; class=&quot;alignnone size-full wp-image-17737 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2014/10/university-of-maryland-university-college-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2014/10/university-of-maryland-university-college-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2014/10/university-of-maryland-university-college-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2014/10/university-of-maryland-university-college-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2014/10/university-of-maryland-university-college-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The University of Maryland Global campus offers a BS in Criminal 
Justice as well as a BS in Homeland Security. Both these programs are 
offered entirely online.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The programs give students the skills and knowledge they need to excel in a variety of careers in the field of Criminal Justice.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Homeland Security&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.umgc.edu/online-degrees/bachelors/criminal-justice&quot;&gt;UMGC&lt;/a&gt; is accredited by the Middle States Commission on Higher Education.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;University of Massachusetts – Global&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Brandman University campus&quot; class=&quot;alignnone size-full wp-image-19971 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/brandman-university-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/brandman-university-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/12/brandman-university-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/12/brandman-university-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/brandman-university-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The University of Massachusetts Global offers a BA in Criminal 
Justice. The program is designed to expose students to real-life 
experiences. The program covers legal strategies, ethical strategies, 
and knowledge for problem-solving.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;This is often a good choice for those interested in being able to fit
 into a wide variety of justice, court, and law enforcement careers.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BA in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The &lt;a class=&quot;external&quot; href=&quot;https://www.umassglobal.edu/academic-programs/arts-and-sciences/ba-in-criminal-justice&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;University of Massachusetts Global&lt;/a&gt; is accredited by the WSCUC Senior College and University Commission.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;University of Nebraska – Kearney&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;University of Nebraska at Kearney campus&quot; class=&quot;alignnone size-full wp-image-20756 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/university-of-nebraska-at-kearney-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/university-of-nebraska-at-kearney-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/12/university-of-nebraska-at-kearney-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/12/university-of-nebraska-at-kearney-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/university-of-nebraska-at-kearney-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The University of Nebraska at Kearney campus offers a fully online BS
 degree in Criminal Justice. The degree is a 120-credit program that 
provides students with the necessary knowledge and skills for jobs in 
the criminal justice fields.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The degree is suitable for persons already working in the area as well as is ideal for new high school grads.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The&amp;nbsp;&lt;a class=&quot;external&quot; href=&quot;https://www.unk.edu/academics/cj/criminal-justice.php&quot;&gt;University of Nebraska&amp;nbsp;at&amp;nbsp;Kearney&lt;/a&gt;&amp;nbsp;is&amp;nbsp;accredited by the Higher Learning Commission.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;University of Phoenix&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;University of Phoenix campus&quot; class=&quot;alignnone size-full wp-image-22453 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2017/07/university-of-phoenix-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2017/07/university-of-phoenix-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2017/07/university-of-phoenix-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2017/07/university-of-phoenix-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2017/07/university-of-phoenix-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The University of Phoenix offers online degrees including a BS in 
Correctional Program Support Services, a BS in Criminal Justice 
Administration and a BS in Security Management.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Each program has its definite focus, and as such, these degrees are 
ideal for students who know for a fact what fields they want to get into
 after school.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Correctional Program Support Services&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice Administration&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Security Management&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The &lt;a class=&quot;external&quot; href=&quot;https://www.phoenix.edu/degrees/bachelors.html&quot;&gt;University of Phoenix&lt;/a&gt; is regionally accredited by&amp;nbsp;the Higher Learning Commission.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;University of South Dakota&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;University of South Dakota campus&quot; class=&quot;alignnone size-full wp-image-17331 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/university-of-south-dakota-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/university-of-south-dakota-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/11/university-of-south-dakota-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/11/university-of-south-dakota-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/university-of-south-dakota-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The University of South Dakota offers both a BA and a BS degree in 
Criminal Justice. The beauty of these programs is that they do not focus
 only on Criminal Justice&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;They include course material from other disciplines so that the 
program prepares students to work in a variety of segments of the 
criminal justice system.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BA in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The&amp;nbsp;&lt;a class=&quot;external&quot; href=&quot;https://www.usd.edu/academics/undergraduate-programs/Criminal%20Justice&quot;&gt;University of South Dakota&lt;/a&gt; is accredited by the Higher Learning Commission.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;University of South Florida&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;University of South Florida campus&quot; class=&quot;alignnone size-full wp-image-19994 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/university-of-south-florida-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/university-of-south-florida-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/12/university-of-south-florida-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/12/university-of-south-florida-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/12/university-of-south-florida-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The University of South Florida main campus offers a BA in 
Criminology along with a BS in Applied Sciences with an emphasis in 
Criminal Justice.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The degrees are offered partially online as they are completion 
courses. The BA has an internship program, which, of course, cannot be 
completed online. The BS program is a capstone program, so students must
 have an ASC to enroll.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BA in Criminology&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Applied Sciences – Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.usf.edu/innovative-education/student-resources/online-programs/online-undergraduate-programs.aspx&quot;&gt;USF&lt;/a&gt;&amp;nbsp;is&amp;nbsp;accredited&amp;nbsp;by the&amp;nbsp;Southern Association of Colleges and Schools’ Commission on Colleges.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Washington State University&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Washington State University campus&quot; class=&quot;alignnone size-full wp-image-17739 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2014/10/washington-state-university-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2014/10/washington-state-university-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2014/10/washington-state-university-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2014/10/washington-state-university-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2014/10/washington-state-university-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Washington State University offers a BA in Criminal Justice and 
Criminology. This program is well suited for those who have a keen 
interest in criminal behavior and want to make a difference in the 
ridding society of these plagues.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The BA program accepts students for summer and fall semesters annually.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BA in Criminal Justice and Criminology&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://online.wsu.edu/online-degrees/criminal-justice/&quot;&gt;Washington State University&lt;/a&gt;&amp;nbsp;is&amp;nbsp;accredited&amp;nbsp;by the Northwest Commission on Colleges and&amp;nbsp;Universities.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Western Carolina University&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Western Carolina University campus&quot; class=&quot;alignnone size-full wp-image-17263 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/western-carolina-university-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/western-carolina-university-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/11/western-carolina-university-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/11/western-carolina-university-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/11/western-carolina-university-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Western Carolina University offers BS degrees in Criminal Justice and
 Emergency and Disaster Management. This program is one of the largest 
at WCU.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Graduates have a lot of career opportunity options upon completing 
this program, and those already working the field can look forward to 
moving up the career ladder.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Emergency and Disaster Management&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.wcu.edu/learn/programs/&quot;&gt;Western Carolina University&lt;/a&gt;&amp;nbsp;is&amp;nbsp;accredited by the Southern Association of Colleges and Schools Commission on Colleges.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;college list&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Wilmington University&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;Wilmington University campus&quot; class=&quot;alignnone size-full wp-image-22955 lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/02/wilmington-university-campus.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/02/wilmington-university-campus.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2019/02/wilmington-university-campus-300x118.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2019/02/wilmington-university-campus-768x303.jpg 768w&quot; height=&quot;304&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2019/02/wilmington-university-campus.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Wilmington University offers an online BS in Criminal Justice. The 
program is delivered by experience Criminal Justice instructors and 
provides relevant training for the field.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;The degree is not a “one size fits all option,” with its variety in 
course content and direction. Students get the opportunity to visit 
criminal justice agencies and to meet some of the industry 
practitioners.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;BS in Criminal Justice&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;https://www.wilmu.edu/behavioralscience/crimjust.aspx&quot;&gt;Wilmington University&lt;/a&gt; is accredited by the&amp;nbsp;Middle States Commission on Higher Education.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Is a Criminal Justice Degree Worth It?&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;img alt=&quot;police officers talking to each other in a parking lot&quot; class=&quot;alignnone wp-image-33514 size-full lazyloaded&quot; data-src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/criminal-justice-degree-1.jpg&quot; data-srcset=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/criminal-justice-degree-1.jpg 770w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/criminal-justice-degree-1-300x195.jpg 300w, https://www.mydegreeguide.com/wp-content/uploads/2020/09/criminal-justice-degree-1-768x499.jpg 768w&quot; height=&quot;500&quot; src=&quot;https://www.mydegreeguide.com/wp-content/uploads/2020/09/criminal-justice-degree-1.jpg&quot; width=&quot;770&quot; /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Yes, a Criminal Justice degree is worth it for many students. The 
Bureau of Labor Statistics is projecting 3% job growth in protective 
service occupations over the next 10 years.&amp;nbsp; Common careers in this 
sector include paralegal, probation officer, forensic analyst, detective
 and criminal investigator, and lawyer.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Earning a criminal justice degree is worth the time and effort as you
 have plenty of employment opportunities to choose from after 
graduation.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;You can work not only for the government but also for private 
entities. In short, a criminal justice degree can be your ticket to a 
decent-paying and noble job in the future. Apply to universities and 
colleges offering online criminal justice programs now.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
				
												 &lt;/span&gt;&lt;div itemprop=&quot;image&quot; itemscope=&quot;&quot; itemtype=&quot;https://schema.org/ImageObject&quot;&gt;
					
					
					
					
				  &lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
								&lt;/span&gt;&lt;div itemprop=&quot;publisher&quot; itemscope=&quot;&quot; itemtype=&quot;https://schema.org/Organization&quot;&gt;
					&lt;div itemprop=&quot;logo&quot; itemscope=&quot;&quot; itemtype=&quot;https://schema.org/ImageObject&quot;&gt;
					   
					  
					  
					  
					&lt;/div&gt;
					
				  &lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
				  
				
				

   
			
				
								



		
			
				&lt;/span&gt;</description><link>https://coderpad.blogspot.com/2022/12/criminal-justice-degree-online.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-8903320000977988311</guid><pubDate>Fri, 25 Nov 2022 05:59:00 +0000</pubDate><atom:updated>2022-11-24T22:46:05.551-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">python</category><title>Python - Variable Types</title><description>&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/yZKbNOITHAU&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.realpython.com/static/realpython.min.1a28062d0366.css&quot;/&gt;
&lt;p&gt;In the previous tutorial on &lt;a href=&quot;https://realpython.com/python-data-types/&quot;&gt;Basic Data Types in Python&lt;/a&gt;,
 you saw how values of various Python data types can be created.  But so
 far, all the values shown have been literal or constant values:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;5.3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;5.3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you’re writing more complex code, your program will need data that can change as program execution proceeds.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here’s what you’ll learn in this tutorial:&lt;/strong&gt; You will learn how every item of data in a Python program can be described by the abstract term &lt;strong&gt;object&lt;/strong&gt;,  and you’ll learn how to manipulate objects using symbolic names called &lt;strong&gt;variables&lt;/strong&gt;.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Free PDF Download:&lt;/strong&gt; &lt;a class=&quot;alert-link&quot; data-focus=&quot;false&quot; data-target=&quot;#modal-python-cheat-sheet-short&quot; data-toggle=&quot;modal&quot; href=&quot;https://realpython.com/bonus/python-cheat-sheet-short/&quot;&gt;Python 3 Cheat Sheet&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class=&quot;text-center my-2&quot;&gt;&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;Variable Assignment&lt;a class=&quot;headerlink&quot; href=&quot;https://realpython.com/python-variables/#variable-assignment&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Think of a variable as a name attached to a particular object. In 
Python, variables need not be declared or defined in advance, as is the 
case in many other programming languages.  To create a variable, you 
just assign it a value and then start using it.  Assignment is done with
 a single equals sign (&lt;code&gt;=&lt;/code&gt;):&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;300&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This is read or interpreted as “&lt;code&gt;n&lt;/code&gt; is assigned the value &lt;code&gt;300&lt;/code&gt;.”  Once this is done, &lt;code&gt;n&lt;/code&gt; can be used in a statement or expression, and its value will be substituted:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;300&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Just as a literal value can be displayed directly from the interpreter prompt in a REPL session without the need for &lt;a href=&quot;https://realpython.com/python-print/&quot;&gt;&lt;code&gt;print()&lt;/code&gt;&lt;/a&gt;, so can a variable:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;300&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Later, if you change the value of &lt;code&gt;n&lt;/code&gt; and use it again, the new value will be substituted instead:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1000&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1000&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Python also allows chained assignment, which makes it possible to assign the same value to several variables simultaneously:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;section class=&quot;section2&quot; id=&quot;variable-assignment&quot;&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;300&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;300 300 300&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The chained assignment above assigns &lt;code&gt;300&lt;/code&gt; to the variables &lt;code&gt;a&lt;/code&gt;, &lt;code&gt;b&lt;/code&gt;, and &lt;code&gt;c&lt;/code&gt; simultaneously.&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;&lt;/section&gt;&lt;section class=&quot;section2&quot; id=&quot;variable-types-in-python&quot;&gt;&lt;h2&gt;Variable Types in Python&lt;a class=&quot;headerlink&quot; href=&quot;https://realpython.com/python-variables/#variable-types-in-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In many programming languages, variables are statically typed.  That 
means a variable is initially declared to have a specific data type, and
 any value assigned to it during its lifetime must always have that 
type.&lt;/p&gt;
&lt;p&gt;Variables in Python are not subject to this restriction.  In Python, a
 variable may be assigned a value of one type and then later re-assigned
 a value of a different type:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;/section&gt;&lt;section class=&quot;section2&quot; id=&quot;variable-types-in-python&quot;&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;23.5&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;23.5&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Now I&#39;m a string&quot;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Now I&#39;m a string&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/section&gt;&lt;section class=&quot;section2&quot; id=&quot;object-references&quot;&gt;&lt;h2&gt;Object References&lt;a class=&quot;headerlink&quot; href=&quot;https://realpython.com/python-variables/#object-references&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;What is actually happening when you make a variable assignment?  This
 is an important question in Python, because the answer differs somewhat
 from what you’d find in many other programming languages.&lt;/p&gt;
&lt;p&gt;Python is a highly &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented language&lt;/a&gt;.
  In fact, virtually every item of data in a Python program is an object
 of a specific type or class. (This point will be reiterated many times 
over the course of these tutorials.)&lt;/p&gt;
&lt;p&gt;Consider this code:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;/section&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;300&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;300&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;When presented with the statement &lt;code&gt;print(300)&lt;/code&gt;, the interpreter does the following:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Creates an integer object&lt;/li&gt;&lt;li&gt;Gives it the value &lt;code&gt;300&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Displays it to the console&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;You can see that an integer object is created using the built-in &lt;code&gt;type()&lt;/code&gt; function:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;300&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt;class &#39;int&#39;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;A Python variable is a symbolic name that is a reference or &lt;a href=&quot;https://realpython.com/pointers-in-python/&quot;&gt;pointer&lt;/a&gt;
 to an object.  Once an object is assigned to a variable, you can refer 
to the object by that name.  But the data itself is still contained 
within the object.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;300&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This assignment creates an integer object with the value &lt;code&gt;300&lt;/code&gt; and assigns the variable &lt;code&gt;n&lt;/code&gt; to point to that object.&lt;/p&gt;
&lt;figure class=&quot;js-lightbox&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/t.2d7bcb9afaaf.png&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;Variable reference diagram&quot; class=&quot;img-fluid mx-auto d-block w-50&quot; data-asset=&quot;426&quot; height=&quot;186&quot; src=&quot;https://files.realpython.com/media/t.2d7bcb9afaaf.png&quot; width=&quot;636&quot; /&gt;&lt;/a&gt;&lt;figcaption class=&quot;figure-caption text-center&quot;&gt;Variable Assignment&lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;The following code verifies that &lt;code&gt;n&lt;/code&gt; points to an integer object:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;300&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt;class &#39;int&#39;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now consider the following statement:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;What happens when it is executed? Python does not create another object.  It simply creates a new symbolic name or reference, &lt;code&gt;m&lt;/code&gt;, which points to the same object that &lt;code&gt;n&lt;/code&gt; points to.&lt;/p&gt;
&lt;figure class=&quot;js-lightbox&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/t.d368386b8423.png&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;Python variable references to the same object (illustration)&quot; class=&quot;img-fluid mx-auto d-block w-50&quot; data-asset=&quot;427&quot; height=&quot;186&quot; src=&quot;https://files.realpython.com/media/t.d368386b8423.png&quot; width=&quot;1083&quot; /&gt;&lt;/a&gt;&lt;figcaption class=&quot;figure-caption text-center&quot;&gt;Multiple References to a Single Object&lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;Next, suppose you do this:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;400&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now Python creates a new integer object with the value &lt;code&gt;400&lt;/code&gt;, and &lt;code&gt;m&lt;/code&gt; becomes a reference to it.&lt;/p&gt;
&lt;figure class=&quot;js-lightbox&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/t.d476d91592cd.png&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;References to separate objects in Python (diagram)&quot; class=&quot;img-fluid mx-auto d-block w-50&quot; data-asset=&quot;428&quot; height=&quot;426&quot; src=&quot;https://files.realpython.com/media/t.d476d91592cd.png&quot; width=&quot;1083&quot; /&gt;&lt;/a&gt;&lt;figcaption class=&quot;figure-caption text-center&quot;&gt;References to Separate Objects&lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;Lastly, suppose this statement is executed next:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;section class=&quot;section2&quot; id=&quot;object-references&quot;&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;foo&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now Python creates a string object with the value &lt;code&gt;&quot;foo&quot;&lt;/code&gt; and makes &lt;code&gt;n&lt;/code&gt; reference that.&lt;/p&gt;
&lt;figure class=&quot;js-lightbox&quot;&gt;&lt;a href=&quot;https://files.realpython.com/media/t.344ab0b3aa8c.png&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;Python variable reference illustration&quot; class=&quot;img-fluid mx-auto d-block w-50&quot; data-asset=&quot;429&quot; height=&quot;666&quot; src=&quot;https://files.realpython.com/media/t.344ab0b3aa8c.png&quot; width=&quot;1083&quot; /&gt;&lt;/a&gt;&lt;figcaption class=&quot;figure-caption text-center&quot;&gt;Orphaned Object&lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;There is no longer any reference to the integer object &lt;code&gt;300&lt;/code&gt;.  It is orphaned, and there is no way to access it.&lt;/p&gt;
&lt;p&gt;Tutorials in this series will occasionally refer to the lifetime of 
an object.  An object’s life begins when it is created, at which time at
 least one reference to it is created.  During an object’s lifetime, 
additional references to it may be created, as you saw above, and 
references to it may be deleted as well.  An object stays alive, as it 
were, so long as there is at least one reference to it.&lt;/p&gt;
&lt;p&gt;When the number of references to an object drops to zero, it is no 
longer accessible.  At that point, its lifetime is over.  Python will 
eventually notice that it is inaccessible and reclaim the allocated 
memory so it can be used for something else.  In computer lingo, this 
process is referred to as &lt;a href=&quot;https://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29&quot;&gt;garbage collection&lt;/a&gt;.&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;&lt;/section&gt;&lt;section class=&quot;section2&quot; id=&quot;object-identity&quot;&gt;&lt;h2&gt;Object Identity&lt;a class=&quot;headerlink&quot; href=&quot;https://realpython.com/python-variables/#object-identity&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In Python, every object that is created is given a number that 
uniquely identifies it.  It is guaranteed that no two objects will have 
the same identifier during any period in which their lifetimes overlap. 
 Once an object’s reference count drops to zero and it is garbage 
collected, as happened to the &lt;code&gt;300&lt;/code&gt; object above, then its identifying number becomes available and may be used again.&lt;/p&gt;
&lt;p&gt;The built-in Python function &lt;code&gt;id()&lt;/code&gt; returns an object’s integer identifier.  Using the &lt;code&gt;id()&lt;/code&gt; function, you can verify that two variables indeed point to the same object:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;/section&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;300&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;60127840&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;60127840&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;400&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;60127872&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;After the assignment &lt;code&gt;m = n&lt;/code&gt;, &lt;code&gt;m&lt;/code&gt; and &lt;code&gt;n&lt;/code&gt; both point to the same object, confirmed by the fact that &lt;code&gt;id(m)&lt;/code&gt; and &lt;code&gt;id(n)&lt;/code&gt; return the same number.  Once &lt;code&gt;m&lt;/code&gt; is reassigned to &lt;code&gt;400&lt;/code&gt;, &lt;code&gt;m&lt;/code&gt; and &lt;code&gt;n&lt;/code&gt; point to different objects with different identities.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p class=&quot;h3&quot;&gt;Deep Dive: Caching Small Integer Values&lt;/p&gt;
&lt;p&gt;From what you now know about variable assignment and object references in Python, the following probably won’t surprise you:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;300&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;300&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;60062304&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;60062896&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;With the statement &lt;code&gt;m = 300&lt;/code&gt;, Python creates an integer object with the value &lt;code&gt;300&lt;/code&gt; and sets &lt;code&gt;m&lt;/code&gt; as a reference to it.  &lt;code&gt;n&lt;/code&gt; is then similarly assigned to an integer object with value &lt;code&gt;300&lt;/code&gt;—but not the same object.  Thus, they have different identities, which you can verify from the values returned by &lt;code&gt;id()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;But consider this:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;section class=&quot;section2&quot; id=&quot;object-identity&quot;&gt;&lt;blockquote&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;30&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;30&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;m&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1405569120&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1405569120&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Here, &lt;code&gt;m&lt;/code&gt; and &lt;code&gt;n&lt;/code&gt; are separately assigned to integer objects having value &lt;code&gt;30&lt;/code&gt;.  But in this case, &lt;code&gt;id(m)&lt;/code&gt; and &lt;code&gt;id(n)&lt;/code&gt; are identical!&lt;/p&gt;
&lt;p&gt;For purposes of optimization, the interpreter creates objects for the integers in the range &lt;code&gt;[-5, 256]&lt;/code&gt;
 at startup, and then reuses them during program execution.  Thus, when 
you assign separate variables to an integer value in this range, they 
will actually reference the same object.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/section&gt;&lt;section class=&quot;section2&quot; id=&quot;variable-names&quot;&gt;&lt;h2&gt;Variable Names&lt;a class=&quot;headerlink&quot; href=&quot;https://realpython.com/python-variables/#variable-names&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The examples you have seen so far have used short, terse variable names like &lt;code&gt;m&lt;/code&gt; and &lt;code&gt;n&lt;/code&gt;.
  But variable names can be more verbose.  In fact, it is usually 
beneficial if they are because it makes the purpose of the variable more
 evident at first glance.&lt;/p&gt;
&lt;p&gt;Officially, variable names in Python can be any length and can consist of uppercase and lowercase letters (&lt;code&gt;A-Z&lt;/code&gt;, &lt;code&gt;a-z&lt;/code&gt;), digits (&lt;code&gt;0-9&lt;/code&gt;), and the underscore character (&lt;code&gt;_&lt;/code&gt;).
  An additional restriction is that, although a variable name can 
contain digits, the first character of a variable name cannot be a 
digit.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; One of the additions to Python 3 was full &lt;a href=&quot;https://realpython.com/python-encodings-guide/&quot;&gt;Unicode support&lt;/a&gt;,
 which allows for Unicode characters in a variable name as well.  You 
will learn  about Unicode in greater depth in a future tutorial.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;For example, all of the following are valid variable names:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;/section&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Bob&quot;&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Age&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;54&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;has_W2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;True&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Age&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;has_W2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Bob 54 True&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;But this one is not, because a variable name can’t begin with a digit:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1099&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_filed&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;False&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;SyntaxError: invalid token&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Note that case is significant. Lowercase and uppercase letters are 
not the same.  Use of the underscore character is significant as well.  
Each of the following defines a different variable:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;age&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Age&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aGe&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AGE&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a_g_e&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_age&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;age_&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_AGE_&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;age&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Age&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;aGe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;AGE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a_g_e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_age&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;age_&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_AGE_&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1 2 3 4 5 6 7 8&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;There is nothing stopping you from creating two different variables in the same program called &lt;code&gt;age&lt;/code&gt; and &lt;code&gt;Age&lt;/code&gt;, or for that matter &lt;code&gt;agE&lt;/code&gt;.
  But it is probably ill-advised.  It would certainly be likely to 
confuse anyone trying to read your code, and even you yourself, after 
you’d been away from it awhile.&lt;/p&gt;
&lt;p&gt;It is worthwhile to give a variable a name that is descriptive enough
 to make clear what it is being used for.  For example, suppose you are 
tallying the number of people who have graduated college.  You could 
conceivably choose any of the following:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;section class=&quot;section2&quot; id=&quot;variable-names&quot;&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numberofcollegegraduates&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2500&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;NUMBEROFCOLLEGEGRADUATES&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2500&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numberOfCollegeGraduates&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2500&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;NumberOfCollegeGraduates&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2500&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;number_of_college_graduates&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2500&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numberofcollegegraduates&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;NUMBEROFCOLLEGEGRADUATES&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;numberOfCollegeGraduates&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;NumberOfCollegeGraduates&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;... &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;number_of_college_graduates&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;2500 2500 2500 2500 2500&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;All of them are probably better choices than &lt;code&gt;n&lt;/code&gt;, or &lt;code&gt;ncg&lt;/code&gt;, or the like.  At least you can tell from the name what the value of the variable is supposed to represent.&lt;/p&gt;
&lt;p&gt;On the other hand, they aren’t all necessarily equally legible.  As 
with many things, it is a matter of personal preference, but most people
 would find the first two examples, where the letters are all shoved 
together, to be harder to read, particularly the one in all capital 
letters.  The most commonly used methods of constructing a multi-word 
variable name are the last three examples:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Camel Case:&lt;/strong&gt; Second and subsequent words are 
capitalized, to make word boundaries easier to see.  (Presumably, it 
struck someone at some point that the capital letters strewn throughout 
the variable name vaguely resemble camel humps.)&lt;ul&gt;&lt;li&gt;Example: &lt;code&gt;numberOfCollegeGraduates&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Pascal Case:&lt;/strong&gt; Identical to Camel Case, except the first word is also capitalized.&lt;ul&gt;&lt;li&gt;Example: &lt;code&gt;NumberOfCollegeGraduates&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Snake Case:&lt;/strong&gt; Words are separated by underscores.&lt;ul&gt;&lt;li&gt;Example: &lt;code&gt;number_of_college_graduates&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Programmers debate hotly, with surprising fervor, which of these is 
preferable.  Decent arguments can be made for all of them.  Use 
whichever of the three is most visually appealing to you. Pick one and 
use it consistently.&lt;/p&gt;
&lt;p&gt;You will see later that variables aren’t the only things that can be 
given names. You can also name functions, classes, modules, and so on.  
The rules that apply to variable names also apply to identifiers, the 
more general term for names given to program objects.&lt;/p&gt;
&lt;p&gt;The Style Guide for Python Code, also known as &lt;strong&gt;PEP 8&lt;/strong&gt;, contains Naming Conventions that list suggested standards for names of different object types.  PEP 8 includes the following recommendations:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Snake Case should be used for functions and variable names.&lt;/li&gt;&lt;li&gt;Pascal Case should be used for class names.  (PEP 8 refers to this as the “CapWords” convention.)&lt;/li&gt;&lt;/ul&gt;
&lt;div&gt;&lt;/div&gt;&lt;/section&gt;&lt;section class=&quot;section2&quot; id=&quot;reserved-words-keywords&quot;&gt;&lt;h2&gt;Reserved Words (Keywords)&lt;a class=&quot;headerlink&quot; href=&quot;https://realpython.com/python-variables/#reserved-words-keywords&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;There is one more restriction on identifier names.  The Python language reserves a small set of keywords that designate special language functionality.  No object can have the same name as a reserved word.&lt;/p&gt;
&lt;p&gt;In Python 3.6, there are 33 reserved keywords:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Python&lt;br /&gt;Keywords&lt;/th&gt;
&lt;th&gt;&amp;nbsp;&lt;/th&gt;
&lt;th&gt;&amp;nbsp;&lt;/th&gt;
&lt;th&gt;&amp;nbsp;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;False&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;def&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;if&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;raise&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;None&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;del&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;import&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;return&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;True&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;elif&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;in&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;try&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;and&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;else&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;is&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;while&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;as&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;except&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;lambda&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;with&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;assert&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;finally&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nonlocal&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;yield&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;break&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;for&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;not&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;class&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;from&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;or&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;continue&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;global&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;pass&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;You can see this list any time by typing &lt;code&gt;help(&quot;keywords&quot;)&lt;/code&gt;
 to the Python interpreter.  Reserved words are case-sensitive and must 
be used exactly as shown.  They are all entirely lowercase, except for &lt;code&gt;False&lt;/code&gt;, &lt;code&gt;None&lt;/code&gt;, and &lt;code&gt;True&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Trying to create a variable with the same name as any reserved word results in an error:&lt;/p&gt;
&lt;div class=&quot;highlight python repl&quot;&gt;&lt;/div&gt;&lt;/section&gt;&lt;section class=&quot;section2&quot; id=&quot;reserved-words-keywords&quot;&gt;&lt;div class=&quot;highlight python repl&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;SyntaxError: invalid syntax&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/section&gt;&lt;h2&gt;Conclusion&lt;a class=&quot;headerlink&quot; href=&quot;https://realpython.com/python-variables/#conclusion&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This tutorial covered the basics of Python &lt;strong&gt;variables&lt;/strong&gt;, including object references and identity, and naming of Python identifiers.&lt;/p&gt;
&lt;p&gt;You now have a good understanding of some of Python’s data types and 
know how to create variables that reference objects of those types.&lt;/p&gt;
&lt;p&gt;Next, you will see how to combine data objects into &lt;strong&gt;expressions&lt;/strong&gt; involving various &lt;strong&gt;operations&lt;/strong&gt;.&lt;/p&gt;</description><link>https://coderpad.blogspot.com/2022/11/python-variable-types.html</link><author>noreply@blogger.com (Nick)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/yZKbNOITHAU/default.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-467726364953675913</guid><pubDate>Wed, 23 Nov 2022 15:00:00 +0000</pubDate><atom:updated>2022-11-24T00:01:25.956-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">python</category><title>How to install Python on Ubuntu 20.04 LTS?</title><description>&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/IbSXF7eT-AU&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;How to install Python on Ubuntu 20.04 LTS?&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h3 class=&quot;h3&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Introduction&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Python is a high level, dynamic and general purpose programming 
language. It was designed and developed by Python Software Foundation. &lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Python is a cross-platform language and was first released on 20, February 1991.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;In this tutorial, we are working on the installation process of Python that includes the following steps.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Although Python 2.7 is installed by default in Ubuntu, but we can install other Python versions like python3.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;To install python3, just type the following command in the terminal and it will be installed automatically.&lt;/span&gt;&lt;/p&gt;&lt;h2 class=&quot;h2&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Python Installation&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;1) &lt;b&gt;Update the APT Repository&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;div class=&quot;dp-highlighter&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-py&quot; start=&quot;1&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;span&gt;$&amp;nbsp;apt-get&amp;nbsp;update&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;2) &lt;b&gt;Install Python&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;div class=&quot;dp-highlighter&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-py&quot; start=&quot;1&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;span&gt;$&amp;nbsp;apt-get&amp;nbsp;install&amp;nbsp;python3.&lt;/span&gt;&lt;span class=&quot;number&quot;&gt;6&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;2) &lt;b&gt;Verify Python&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt; When we type &lt;b&gt;python&lt;/b&gt; it shows default installed python that is 2.7.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;div class=&quot;dp-highlighter&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-py&quot; start=&quot;1&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;span&gt;$&amp;nbsp;python&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;img alt=&quot;Software Python 1&quot; src=&quot;https://static.javatpoint.com/installation/images/python1.png&quot; /&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;For Python3 type the following command, then it will show the other version as well.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;div class=&quot;dp-highlighter&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-py&quot; start=&quot;1&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;span&gt;$&amp;nbsp;python3&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;img alt=&quot;Software Python 2&quot; src=&quot;https://static.javatpoint.com/installation/images/python2.png&quot; /&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Well, on the basis of these commands, we can test application for both Python versions.&lt;/span&gt;&lt;/p&gt;&lt;h2 class=&quot;h3&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Installation on Mac&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;To install python3 on MacOS, visit the link &lt;a href=&quot;https://coderpad.blogspot.com/2022/11/how-to-install-python3-on-macos.html&quot;&gt;&lt;i&gt;https://coderpad.blogspot.com/2022/11/how-to-install-python3-on-macos.html&lt;/i&gt;&lt;/a&gt; and follow the instructions given in the tutorial.&lt;/span&gt;&lt;/p&gt;&lt;h2 class=&quot;h3&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Installation on CentOS&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;To install Python3 on CentOS, visit the link &lt;a href=&quot;https://coderpad.blogspot.com/2022/11/how-to-install-python-3-on-centos.html&quot;&gt;https://coderpad.blogspot.com/2022/11/how-to-install-python-3-on-centos.html&lt;/a&gt; and follow the instructions given in the tutorial.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;/span&gt;&lt;h2 class=&quot;h3&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Installation on Windows&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;To install Python3 on Ubuntu, visit the link &lt;a href=&quot;https://coderpad.blogspot.com/2022/11/how-to-install-python-on-windows.html&quot;&gt;&lt;i&gt;https://coderpad.blogspot.com/2022/11/how-to-install-python-on-windows.html&lt;/i&gt;&lt;/a&gt; and follow the instructions given in the tutorial.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;</description><link>https://coderpad.blogspot.com/2022/11/how-to-install-python-on-ubuntu-2004-lts.html</link><author>noreply@blogger.com (Nick)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/IbSXF7eT-AU/default.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-6382697815626231046</guid><pubDate>Wed, 23 Nov 2022 14:59:00 +0000</pubDate><atom:updated>2022-11-24T00:01:40.283-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">python</category><title>How to Install Python 3 on CentOS</title><description>&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/IbSXF7eT-AU&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;How to Install Python 3 on CentOS&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h2 class=&quot;h3&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Introduction&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Python is a high level, dynamic, general purpose language. It was developed by &lt;b&gt;Guido Van Rossum&lt;/b&gt; in &lt;b&gt;1991&lt;/b&gt;.
 Python&#39;s syntax allows developers to use fewer lines of code than any 
other programming language. It basically focuses on the code readability
 of program. Python 2.7 is installed by default on CentOS but we can 
install other versions like Python 3.9 and 3.10 . In this tutorial, we are
 learning how to install Python 3.6.3 on CentOS.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h3 class=&quot;h3&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Prerequisites&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul class=&quot;points&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;CentOS&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Login as an administrator on the terminal&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Yum must be configured on the system.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h2 class=&quot;h3&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Installation&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Installation includes following steps.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;1. &lt;b&gt;Install IUS community Repository&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;In order to install Python 3.6 on CentOS, we need to first install 
IUS community repository which provides extra packages for Enterprise 
Linux. Execute the following command to install IUS community 
repository. &lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;div class=&quot;dp-highlighter&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-j&quot; start=&quot;1&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;span&gt;$&amp;nbsp;sudo&amp;nbsp;yum&amp;nbsp;-y&amp;nbsp;install&amp;nbsp;https:&lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;//centos7.iuscommunity.org/ius-release.rpm&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;img alt=&quot;CentOS How to Install Python 3 on CentOS&quot; src=&quot;https://static.javatpoint.com/centos/images/how-to-install-Python3-on-centos.png&quot; /&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;2. &lt;b&gt;Install Python 3&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Execute the following command to install python 3.6 on CentOS. &lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;div class=&quot;dp-highlighter&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-j&quot; start=&quot;1&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;span&gt;$&amp;nbsp;sudo&amp;nbsp;yum&amp;nbsp;install&amp;nbsp;python36u&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;img alt=&quot;CentOS How to Install Python 3 on CentOS 1&quot; src=&quot;https://static.javatpoint.com/centos/images/how-to-install-Python3-on-centos1.png&quot; /&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;3. &lt;b&gt;Verify Python&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;To verify if we have installed correct version of python, we just need to type &lt;b&gt;python3.6 -V&lt;/b&gt; on the terminal. The command will show the version installed which is 3.6.4 in my case.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;img alt=&quot;CentOS How to Install Python 3 on CentOS 2&quot; src=&quot;https://static.javatpoint.com/centos/images/how-to-install-Python3-on-centos2.png&quot; /&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;4. &lt;b&gt;Working on Python&#39;s script mode&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Just type python3.6 on the terminal to enter the Python&#39;s script 
mode. We can execute the python statements on this shell. Since, python 2
 is by default installed on CentOS, hence typing python on the terminal 
takes us to the python2 shell, hence we have to type python3.6 to work 
on the desired python shell.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;img alt=&quot;CentOS How to Install Python 3 on CentOS 3&quot; src=&quot;https://static.javatpoint.com/centos/images/how-to-install-Python3-on-centos3.png&quot; /&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Execute the valid python statements which get interpreted and show the desired output on the terminal as shown below. &lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;img alt=&quot;CentOS How to Install Python 3 on CentOS 4&quot; src=&quot;https://static.javatpoint.com/centos/images/how-to-install-Python3-on-centos4.png&quot; /&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Hence, we have installed and get started with Python 3.&lt;/span&gt;&lt;/p&gt;&lt;h2 class=&quot;h3&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Installation on MacOS&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;To install python3 on MacOS, visit the link &lt;a href=&quot;https://coderpad.blogspot.com/2022/11/how-to-install-python3-on-macos.html&quot;&gt;&lt;i&gt;https://coderpad.blogspot.com/2022/11/how-to-install-python3-on-macos.html&lt;/i&gt;&lt;/a&gt; and follow the instructions given in the tutorial.&lt;/span&gt;&lt;/p&gt;&lt;h2 class=&quot;h3&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Installation on Windows&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;To install Python3 on CentOS, visit the link &lt;a href=&quot;https://coderpad.blogspot.com/2022/11/how-to-install-python-on-windows.html&quot;&gt;&lt;i&gt;https://coderpad.blogspot.com/2022/11/how-to-install-python-on-windows.html&lt;/i&gt;&lt;/a&gt; and follow the instructions given in the tutorial.&lt;/span&gt;&lt;/p&gt;&lt;h2 class=&quot;h3&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Installation on Ubuntu&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;To install Python3 on Ubuntu, visit the link &lt;a href=&quot;https://coderpad.blogspot.com/2022/11/how-to-install-python-on-ubuntu-2004-lts.html&quot;&gt;&lt;i&gt;https://coderpad.blogspot.com/2022/11/how-to-install-python-on-ubuntu-2004-lts.html&lt;/i&gt;&lt;/a&gt; and follow the instructions given in the tutorial.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;</description><link>https://coderpad.blogspot.com/2022/11/how-to-install-python-3-on-centos.html</link><author>noreply@blogger.com (Nick)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/IbSXF7eT-AU/default.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-410743332115955969</guid><pubDate>Wed, 23 Nov 2022 14:57:00 +0000</pubDate><atom:updated>2022-11-24T00:01:53.447-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">python</category><title>  How to Install Python3 on MacOS </title><description>&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/IbSXF7eT-AU&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;
&lt;p&gt;&lt;/p&gt;&lt;h1 class=&quot;h1&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;How to Install Python3 on MacOS &lt;/span&gt;&lt;/h1&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h3 class=&quot;h3&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Introduction&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Python is a high level, dynamic, general purpose language. It was developed by &lt;b&gt;Guido Van Rossum&lt;/b&gt; in &lt;b&gt;1991&lt;/b&gt;.
 Python&#39;s syntax allows developers to use fewer lines of code than any 
other programming language. It basically focuses on the code readability
 of program. Python 2.7 is installed by default on MacOS but we can 
install other versions like python 3.5 and 3.6. &lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;In this tutorial, we are learning how to install Python 3.6.3 on the MAC Operating system. &lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h3 class=&quot;h3&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Prerequisites&lt;/span&gt;&lt;/h3&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;ul class=&quot;points&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;MacOS&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Login as an administrator on terminal&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h2 class=&quot;h2&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Installation&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;There are following steps which are used while installing Python3 on MacOS. &lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;1) &lt;b&gt;Checking python&#39;s version on the system&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;We can check which version of the Python is currently installed on our system. Generally, Python 2.7 is installed by default.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Let&#39;s see how can we do it.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;div class=&quot;dp-highlighter&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-py&quot; start=&quot;1&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;span&gt;$&amp;nbsp;python&amp;nbsp;-version&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;img alt=&quot;Macos Python 1&quot; src=&quot;https://static.javatpoint.com/macos/images/python1.png&quot; /&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;It shows &lt;b&gt;Python 2.7.10&lt;/b&gt; is installed on the computer which is quite often. &lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;2) &lt;b&gt;Download Python 3.6.3&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;In order to install Python 3.6.3, we must download the latest version from its official website &lt;a href=&quot;https://www.python.org/downloads/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://www.python.org/downloads/&lt;/a&gt; . The file is downloaded in &lt;b&gt;.pkg&lt;/b&gt; format which can be directly installed by using &lt;b&gt;Installer&lt;/b&gt; command.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;3) &lt;b&gt;Install Python 3.6.3&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Since the downloaded file already is in &lt;b&gt;.pkg&lt;/b&gt; format hence no mounting is required and We can use installer command to install Python 3.6.3.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Let&#39;s see how can we do it. &lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;img alt=&quot;Macos Python 2&quot; src=&quot;https://static.javatpoint.com/macos/images/python2.png&quot; /&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Since The installer is used with super user permissions hence &lt;b&gt;sudo&lt;/b&gt;
 forces terminal to prompt the user to fill the admin password. The 
process installs the Python 3.6.3 to the root directory which is 
mentioned with the target option.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;4) &lt;b&gt;Verify Python3&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;To check which Python version is installed on the machine, we can use &lt;b&gt;python -version&lt;/b&gt;
 command. Since by default installed version is Python 2.7.10 hence it 
shows python 2.7.10. but it gives us flexibility to check the version of
 Python 3 on our computer. &lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Let&#39;s see how can we use python 3 to check which version of python 3 is running.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;div class=&quot;dp-highlighter&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;div class=&quot;tools&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;ol class=&quot;dp-py&quot; start=&quot;1&quot;&gt;&lt;li class=&quot;alt&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;span&gt;$&amp;nbsp;python&amp;nbsp;-version&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;5) &lt;b&gt;Working on Python&#39;s script mode&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;To work on Python command line, we simply type &lt;b&gt;python3 on the terminal. Python shell open where we can run Python statements such as print statements as we did here.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;img alt=&quot;Macos Python 3&quot; src=&quot;https://static.javatpoint.com/macos/images/python3.png&quot; /&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;To run a Python file &lt;b&gt;(.py)&lt;/b&gt; on the terminal, we simply type the file name and the file will be interpreted. &lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Well, we have installed Python3 on our MacOS. &lt;/span&gt;&lt;/p&gt;&lt;h2 class=&quot;h3&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Installation on Windows&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;To install python3 on Windows OS , visit the link &lt;a href=&quot;https://coderpad.blogspot.com/2022/11/how-to-install-python-on-windows.html&quot;&gt;https://coderpad.blogspot.com/2022/11/how-to-install-python-on-windows.html&lt;/a&gt; and follow the instructions given in the tutorial.&lt;/span&gt;&lt;/p&gt;&lt;h2 class=&quot;h3&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Installation on CentOS&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;To install Python3 on CentOS, visit the link &lt;a href=&quot;https://coderpad.blogspot.com/2022/11/how-to-install-python-3-on-centos.html&quot;&gt;&lt;i&gt;https://coderpad.blogspot.com/2022/11/how-to-install-python-3-on-centos.html&lt;/i&gt;&lt;/a&gt; and follow the instructions given in the tutorial.&lt;/span&gt;&lt;/p&gt;&lt;h2 class=&quot;h3&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Installation on Ubuntu&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;To install Python3 on Ubuntu, visit the link &lt;a href=&quot;https://coderpad.blogspot.com/2022/11/how-to-install-python-on-ubuntu-2004-lts.html&quot;&gt;https://coderpad.blogspot.com/2022/11/how-to-install-python-on-ubuntu-2004-lts.html&lt;/a&gt; and follow the instructions given in the tutorial.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;</description><link>https://coderpad.blogspot.com/2022/11/how-to-install-python3-on-macos.html</link><author>noreply@blogger.com (Nick)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/IbSXF7eT-AU/default.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-4559075088909165692</guid><pubDate>Wed, 23 Nov 2022 14:55:00 +0000</pubDate><atom:updated>2022-11-24T00:02:04.453-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">python</category><title>How to Install Python on Windows (Environment Set-up)</title><description>&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/IbSXF7eT-AU&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;How to Install Python (Environment Set-up)&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;In order to become Python developer, the first step is to learn how 
to install or update Python on a local machine or computer. In this 
tutorial, we will discuss the installation of Python on various 
operating systems. &lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;h2 class=&quot;h2&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Installation on Windows&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Visit the link &lt;a href=&quot;https://www.python.org/downloads/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;i&gt;https://www.python.org/downloads/&lt;/i&gt;&lt;/a&gt; to download the latest release of Python. In this process, we will install Python 3.8.6 on our Windows operating system. When we click on the above link, it will bring us the following page.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;b&gt;Step - 1: Select the Python&#39;s version to download.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Click on the download button.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;img alt=&quot;Python Environment Set-up&quot; src=&quot;https://static.javatpoint.com/python/images/python-environment-set-up.png&quot; /&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;b&gt;Step - 2: Click on the Install Now&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Double-click the executable file, which is downloaded; the following 
window will open. Select Customize installation and proceed. Click on 
the Add Path check box, it will set the Python path automatically.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;img alt=&quot;Python Environment Set-up&quot; src=&quot;https://static.javatpoint.com/python/images/python-environment-set-up2.png&quot; /&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;We can also click on the customize installation to choose desired 
location and features. Other important thing is install launcher for the
 all user must be checked.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;&lt;b&gt;Step - 3 Installation in Process&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;img alt=&quot;Python Environment Set-up&quot; src=&quot;https://static.javatpoint.com/python/images/python-environment-set-up3.png&quot; /&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Now, try to run python on the command prompt. Type the command python -version in case of python3.&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;img alt=&quot;Python Environment Set-up&quot; src=&quot;https://static.javatpoint.com/python/images/python-environment-set-up4.png&quot; /&gt;

&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;We are ready to work with the Python.&lt;/span&gt;&lt;/p&gt;&lt;h2 class=&quot;h3&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Installation on Mac&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;To install python3 on MacOS, visit the link &lt;a href=&quot;https://coderpad.blogspot.com/2022/11/how-to-install-python3-on-macos.html&quot;&gt;&lt;i&gt;https://coderpad.blogspot.com/2022/11/how-to-install-python3-on-macos.html&lt;/i&gt;&lt;/a&gt; and follow the instructions given in the tutorial.&lt;/span&gt;&lt;/p&gt;&lt;h2 class=&quot;h3&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Installation on CentOS&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;To install Python3 on CentOS, visit the link &lt;a href=&quot;https://coderpad.blogspot.com/2022/11/how-to-install-python-3-on-centos.html&quot;&gt;&lt;i&gt;https://coderpad.blogspot.com/2022/11/how-to-install-python-3-on-centos.html&lt;/i&gt;&lt;/a&gt; and follow the instructions given in the tutorial.&lt;/span&gt;&lt;/p&gt;&lt;h2 class=&quot;h3&quot;&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;Installation on Ubuntu&lt;/span&gt;&lt;/h2&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;span style=&quot;font-family: arial;&quot;&gt;To install Python3 on Ubuntu, visit the link &lt;a href=&quot;https://coderpad.blogspot.com/2022/11/how-to-install-python-on-ubuntu-2004-lts.html&quot;&gt;https://coderpad.blogspot.com/2022/11/how-to-install-python-on-ubuntu-2004-lts.html&lt;/a&gt; and follow the instructions given in the tutorial.&lt;/span&gt;&lt;/p&gt;</description><link>https://coderpad.blogspot.com/2022/11/how-to-install-python-on-windows.html</link><author>noreply@blogger.com (Nick)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/IbSXF7eT-AU/default.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-8232393480477755729</guid><pubDate>Wed, 02 Nov 2022 15:16:00 +0000</pubDate><atom:updated>2022-11-02T08:16:42.493-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">How to Kill Zombie Processes in Ubuntu</category><title>How to Kill Zombie Processes in Ubuntu</title><description>&lt;article class=&quot;post-833 post type-post status-publish format-standard has-post-thumbnail hentry category-linux category-ubuntu&quot; id=&quot;post-833&quot;&gt;
&lt;div class=&quot;entry-content clearfix&quot;&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;Kill Zombie Process in Ubuntu&quot; class=&quot;alignnone size-full wp-image-19304&quot; height=&quot;512&quot; sizes=&quot;(max-width: 1024px) 100vw, 1024px&quot; src=&quot;https://vitux.com/wp-content/uploads/ubuntu-kill-zombie-process-22.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/ubuntu-kill-zombie-process-22.png 1024w, https://vitux.com/wp-content/uploads/ubuntu-kill-zombie-process-22-300x150.png 300w, https://vitux.com/wp-content/uploads/ubuntu-kill-zombie-process-22-768x384.png 768w&quot; width=&quot;1024&quot;/&gt;&lt;/p&gt;
&lt;p&gt;A &lt;strong&gt;zombie&lt;/strong&gt; or a &lt;strong&gt;defunct process&lt;/strong&gt; in Linux is a process that has been completed, but its entry still remains in the process table due to a lack of correspondence between the parent and child processes. Usually, a parent process keeps a check on the status of its child processes through the wait() function. When the child process has finished, the wait function signals the parent to completely exit the process from the memory. However, if the parent fails to call the wait function for any of its children, the child process remains alive in the system as a dead or zombie process. These zombie processes might accumulate, in large numbers, on your system and affect its performance. In that case, you might have to kill these zombies manually through the ways and commands described in this tutorial.&lt;/p&gt;
&lt;p&gt;This tutorial is compatible with all recent Ubuntu versions including Ubuntu 22.04.&lt;/p&gt;
&lt;h2&gt;Viewing Zombie Processes&lt;/h2&gt;
&lt;p&gt;You can check your system�s performance by looking at the various processes running on your system, including efficiency-altering zombie processes. Ubuntu allows you to view these processes in the following way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Through the Graphical User Interface&lt;/li&gt;
&lt;li&gt;Through the Command Line&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Through the GUI&lt;/h3&gt;
&lt;p&gt;In order to graphically view any zombie processes running on your system, open the &lt;strong&gt;System Monitor&lt;/strong&gt; utility through your Ubuntu Dash. In the following screenshot of my System Monitor, you can view that there are two zombies running on my system. It is also possible that the number of zombie processes on your system might be less or more than the ones running on mine.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;View Zombie Processes in GUI&quot; class=&quot;aligncenter wp-image-834 size-full&quot; height=&quot;554&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 972px) 100vw, 972px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/07/word-image-124.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/07/word-image-124.png 972w, https://vitux.com/wp-content/uploads/2018/07/word-image-124-300x171.png 300w, https://vitux.com/wp-content/uploads/2018/07/word-image-124-768x438.png 768w&quot; width=&quot;972&quot;/&gt;&lt;/p&gt;
&lt;h3&gt;Through the Command Line&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;top&lt;/strong&gt; command displays a detailed view of the processes running on your system along with the memory and CPU resources they are using. It also gives you information about any zombie processes running on your system. Open the Terminal by pressing &lt;strong&gt;Ctrl+Alt+T&lt;/strong&gt; and then type &lt;strong&gt;top&lt;/strong&gt;. I got the following output after running this command.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;$ top&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Find Zombie Processes on the command line&quot; class=&quot;aligncenter wp-image-835&quot; height=&quot;374&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 736px) 100vw, 736px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/07/word-image-125.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/07/word-image-125.png 736w, https://vitux.com/wp-content/uploads/2018/07/word-image-125-300x152.png 300w&quot; width=&quot;736&quot;/&gt;&lt;/p&gt;
&lt;p&gt;You can see in the second line that there is 1 zombie process running on my system.&lt;/p&gt;
&lt;p&gt;If you want further details about the zombie process, use the following command:&lt;/p&gt;
&lt;pre&gt;$ ps axo stat,ppid,pid,comm | grep -w defunct&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Get details about a zombie process on Linux&quot; class=&quot;aligncenter wp-image-836&quot; height=&quot;56&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 518px) 100vw, 518px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/07/word-image-126.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/07/word-image-126.png 518w, https://vitux.com/wp-content/uploads/2018/07/word-image-126-300x32.png 300w&quot; width=&quot;518&quot;/&gt;&lt;/p&gt;
&lt;p&gt;This command will give you the state, parentID, the process ID, the program that is running the zombie process(a dummy program by the name �zombie� on my system). The defunct flag tells you that this is a dead, zombie process.&lt;/p&gt;
&lt;h2&gt;Killing a Zombie-Process&lt;/h2&gt;
&lt;p&gt;First, let us understand how zombie processes are a threat to our system�s performance. It is important to learn that zombies are dead and mostly complete processes that do not take memory or CPU resources. However, each of these processes has a unique process ID assigned to them which comes from a limited pool of PIDs reserved for your processor. If a large number of zombies gather, they will eat up most part of the PID pool and the new processes will not be able to launch due to the lack of a process ID.&lt;/p&gt;
&lt;p&gt;A small number of defunct programs occupying your system is not a big threat but that means that their parent programs have not been able to call them off due to a bug or a missing wait() function.&lt;/p&gt;
&lt;p&gt;When a parent process has not been able to call the wait() function automatically, we need to manually signal the parent process to run the wait function on all its children so the ones with a complete state can be called back. We can do this by running the SIGCHLD command. When that doesn�t work, we can manually kill the parent process so that all its zombie children are also killed, freeing the process IDs for the new processes.&lt;/p&gt;
&lt;p&gt;You can kill the zombie processes through the following ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Through the Graphical User Interface&lt;/li&gt;
&lt;li&gt;Through the Command Line&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Through the GUI&lt;/h3&gt;
&lt;p&gt;You can kill a zombie process graphically through the System Monitor Utility as follows:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open the &lt;strong&gt;System Monitor&lt;/strong&gt; utility through Ubuntu Dash.&lt;/li&gt;
&lt;li&gt;Search for the term &lt;strong&gt;Zombie&lt;/strong&gt; through the &lt;strong&gt;Search&lt;/strong&gt; button.&lt;/li&gt;
&lt;li&gt;Select the zombie process, right-click and then select &lt;strong&gt;Kill&lt;/strong&gt; from the menu.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img alt=&quot;How to kill a zombie process on Linux desktop&quot; class=&quot;wp-image-837 size-large aligncenter&quot; height=&quot;422&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 750px) 100vw, 750px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/07/word-image-127-1024x576.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/07/word-image-127-1024x576.png 1024w, https://vitux.com/wp-content/uploads/2018/07/word-image-127-300x169.png 300w, https://vitux.com/wp-content/uploads/2018/07/word-image-127-768x432.png 768w, https://vitux.com/wp-content/uploads/2018/07/word-image-127.png 1366w&quot; width=&quot;750&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The zombie process will be removed from your system.&lt;/p&gt;
&lt;h3&gt;Through the Command Line&lt;/h3&gt;
&lt;p&gt;After you know that there are any zombie processes running on your system through the top command. This is how to view the details of the processes.&lt;/p&gt;
&lt;p&gt;The usual way is to use the following command that signals the zombie�s parent process to kill the command.&lt;/p&gt;
&lt;pre&gt;$ kill -s SIGCHLD PID&lt;/pre&gt;
&lt;p&gt;This command may not work in a few cases as not all parent processes are programmed properly in order to check upon the child processes. In that case, you can kill the parent process through the following command:&lt;/p&gt;
&lt;pre&gt;$ sudo kill -9 3376&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Kill a zombie process on the commandline&quot; class=&quot;aligncenter wp-image-838&quot; height=&quot;73&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 528px) 100vw, 528px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/07/word-image-128.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/07/word-image-128.png 528w, https://vitux.com/wp-content/uploads/2018/07/word-image-128-300x41.png 300w&quot; width=&quot;528&quot;/&gt;&lt;/p&gt;
&lt;p&gt;When you have killed all the zombie processes this way and run the top command, you will be able to see that there are no zombie processes running on your system anymore:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Zombie process killed&quot; class=&quot;aligncenter wp-image-839&quot; height=&quot;287&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 733px) 100vw, 733px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/07/word-image-129.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/07/word-image-129.png 733w, https://vitux.com/wp-content/uploads/2018/07/word-image-129-300x117.png 300w&quot; width=&quot;733&quot;/&gt;&lt;/p&gt;
&lt;p&gt;After working along with this tutorial, you can optimize your operating system by looking for any zombie processes on your system and killing them manually through the command line or the graphical user interface. This act will free up process IDs for the new processes that you want to run on your system.&lt;/p&gt;
&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;How to Kill Zombie Processes in Ubuntu&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;

&lt;/article&gt;
&lt;span class=&quot;entry-title&quot;&gt;read coderpad profiles:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;http://www.lawrence.com/users/coderpad/&quot;&gt;http://www.lawrence.com/users/coderpad/&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;https://www.scribd.com/document/601722224/Coderpad&quot;&gt;https://www.scribd.com/document/601722224/Coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&quot;&gt;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://linktr.ee/coderpad&quot;&gt;https://linktr.ee/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.pearltrees.com/coderpad&quot;&gt;https://www.pearltrees.com/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.akonter.com/user/profile/coderpad&quot;&gt;https://www.akonter.com/user/profile/coderpad&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;</description><link>https://coderpad.blogspot.com/2022/11/how-to-kill-zombie-processes-in-ubuntu.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-5648579874617696760</guid><pubDate>Wed, 02 Nov 2022 15:15:00 +0000</pubDate><atom:updated>2022-11-02T08:15:48.477-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">How to Install LAMP Stack on Linux Mint</category><title>How to Install LAMP Stack on Linux Mint</title><description>&lt;article class=&quot;post-15956 post type-post status-publish format-standard has-post-thumbnail hentry category-linux category-shell&quot; id=&quot;post-15956&quot;&gt;
&lt;div class=&quot;entry-content clearfix&quot;&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-19308&quot; height=&quot;512&quot; sizes=&quot;(max-width: 1024px) 100vw, 1024px&quot; src=&quot;https://vitux.com/wp-content/uploads/lamp-linux-mint-1.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/lamp-linux-mint-1.png 1024w, https://vitux.com/wp-content/uploads/lamp-linux-mint-1-300x150.png 300w, https://vitux.com/wp-content/uploads/lamp-linux-mint-1-768x384.png 768w&quot; width=&quot;1024&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Installing Apache requires the installation of a complete LAMP package (Linux, Apache, MySQL and, PHP). To do development, users require a complete set of these open-source software and a locally set up machine before they can host their websites to test it out.� We will go through the complete installation of the LAMP stack on Linux Mint 20.&lt;/p&gt;
&lt;h2&gt;Updating the Linux mint 20 system&lt;/h2&gt;
&lt;p&gt;The first step is to update the OS by running the following command through the terminal window:&lt;/p&gt;
&lt;pre&gt;$ sudo apt-get update&lt;/pre&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15957 aligncenter&quot; height=&quot;30&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 612px) 100vw, 612px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1921.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1921.png 612w, https://vitux.com/wp-content/uploads/word-image-1921-300x15.png 300w&quot; width=&quot;612&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The system will prompt to enter the password.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15958 aligncenter&quot; height=&quot;56&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 648px) 100vw, 648px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1922.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1922.png 648w, https://vitux.com/wp-content/uploads/word-image-1922-300x26.png 300w, https://vitux.com/wp-content/uploads/word-image-1922-642x56.png 642w&quot; width=&quot;648&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Now, check for the available apt updates and get them in the Linux system using:&lt;/p&gt;
&lt;pre&gt;$ sudo apt-get upgrade&lt;/pre&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15959 aligncenter&quot; height=&quot;28&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 640px) 100vw, 640px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1923.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1923.png 640w, https://vitux.com/wp-content/uploads/word-image-1923-300x13.png 300w&quot; width=&quot;640&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Next, update the packages using the following command:&lt;/p&gt;
&lt;pre&gt;$ sudo apt-get dist-upgrade&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;img class=&quot;wp-image-15960 aligncenter&quot; height=&quot;30&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 724px) 100vw, 724px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1924.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1924.png 724w, https://vitux.com/wp-content/uploads/word-image-1924-300x12.png 300w&quot; width=&quot;724&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This upgrade might take some time. Once done, you need to reboot the system to get the updates done using:&lt;/p&gt;
&lt;pre&gt;$ sudo reboot&lt;/pre&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15961 aligncenter&quot; height=&quot;28&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 502px) 100vw, 502px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1925.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1925.png 502w, https://vitux.com/wp-content/uploads/word-image-1925-300x17.png 300w&quot; width=&quot;502&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Installation of the LAMP server&lt;/h2&gt;
&lt;p&gt;After that, install the LAMP server in the system. Type the command given below to start the process of installation:&lt;/p&gt;
&lt;pre&gt;$ sudo apt-get install lamp-server^&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;img class=&quot;wp-image-15962 aligncenter&quot; height=&quot;28&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1926.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1926.png 800w, https://vitux.com/wp-content/uploads/word-image-1926-300x11.png 300w, https://vitux.com/wp-content/uploads/word-image-1926-768x27.png 768w&quot; width=&quot;800&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You need to end it with the &lt;strong&gt;caret (^)&lt;/strong&gt;. The system will prompt and ask for the permission of the user. Append Y and then press enter from the keyboard.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15963 aligncenter&quot; height=&quot;664&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1038px) 100vw, 1038px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1927.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1927.png 1038w, https://vitux.com/wp-content/uploads/word-image-1927-300x192.png 300w, https://vitux.com/wp-content/uploads/word-image-1927-1024x655.png 1024w, https://vitux.com/wp-content/uploads/word-image-1927-768x491.png 768w&quot; width=&quot;1038&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Testing the installation of Apache webserver&lt;/h2&gt;
&lt;p&gt;Apache is the webserver of the LAMP stack and once installed to confirm the installation type the following in the terminal window:&lt;/p&gt;
&lt;pre&gt;$ sudo systemctl status apache2&lt;/pre&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15964 aligncenter&quot; height=&quot;28&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 742px) 100vw, 742px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1928.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1928.png 742w, https://vitux.com/wp-content/uploads/word-image-1928-300x11.png 300w&quot; width=&quot;742&quot;/&gt;&lt;/p&gt;
&lt;p&gt;This command will tell whether Apache is running or not. If you see an output like this one then it means it is installed correctly.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15965 aligncenter&quot; height=&quot;536&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1056px) 100vw, 1056px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1929.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1929.png 1056w, https://vitux.com/wp-content/uploads/word-image-1929-300x152.png 300w, https://vitux.com/wp-content/uploads/word-image-1929-1024x520.png 1024w, https://vitux.com/wp-content/uploads/word-image-1929-768x390.png 768w&quot; width=&quot;1056&quot;/&gt;&lt;/p&gt;
&lt;p&gt;We can also check the installation confirmation from the browser. Type &lt;strong&gt;http://localhost&lt;/strong&gt; on the window of your browser. Once done, you will see an output like the one shown below. It will confirm that the Apache server is installed correctly. You can add more web pages. &lt;strong&gt;Apache2&lt;/strong&gt; web page runs in the path /&lt;strong&gt;var/www/html&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15966 aligncenter&quot; height=&quot;1090&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1510px) 100vw, 1510px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1930.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1930.png 1510w, https://vitux.com/wp-content/uploads/word-image-1930-300x217.png 300w, https://vitux.com/wp-content/uploads/word-image-1930-1024x739.png 1024w, https://vitux.com/wp-content/uploads/word-image-1930-768x554.png 768w&quot; width=&quot;1510&quot;/&gt;&lt;/p&gt;
&lt;p&gt;To update the content, make changes in the &lt;strong&gt;index.html &lt;/strong&gt;page.&lt;/p&gt;
&lt;h2&gt;Testing the installation of PHP&lt;/h2&gt;
&lt;p&gt;PHP is the scripting language used in the LAMP stack. Now we need to verify the installation of PHP by creating a file info.php in /&lt;strong&gt;var/www/html &lt;/strong&gt;path.&lt;/p&gt;
&lt;pre&gt;$ sudo nano /var/www/html/info.php&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;img class=&quot;wp-image-15967 aligncenter&quot; height=&quot;34&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 778px) 100vw, 778px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1931.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1931.png 778w, https://vitux.com/wp-content/uploads/word-image-1931-300x13.png 300w, https://vitux.com/wp-content/uploads/word-image-1931-768x34.png 768w, https://vitux.com/wp-content/uploads/word-image-1931-750x34.png 750w&quot; width=&quot;778&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The nano text editor will open up an empty file &lt;strong&gt;info.php,&lt;/strong&gt; type the following script in the file. and then press Ctl+O to save the file. To exit use Ctl+X.&lt;/p&gt;
&lt;pre&gt;&amp;lt;?php phpinfo(); ?&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;img class=&quot;wp-image-15968 aligncenter&quot; height=&quot;670&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1048px) 100vw, 1048px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1932.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1932.png 1048w, https://vitux.com/wp-content/uploads/word-image-1932-300x192.png 300w, https://vitux.com/wp-content/uploads/word-image-1932-1024x655.png 1024w, https://vitux.com/wp-content/uploads/word-image-1932-768x491.png 768w&quot; width=&quot;1048&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Once done, restart the &lt;strong&gt;Apache2 &lt;/strong&gt;server to ensure that the changes have been done.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img class=&quot;wp-image-15969&quot; height=&quot;24&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 760px) 100vw, 760px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1933.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1933.png 760w, https://vitux.com/wp-content/uploads/word-image-1933-300x9.png 300w, https://vitux.com/wp-content/uploads/word-image-1933-750x24.png 750w&quot; width=&quot;760&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Type &lt;a href=&quot;http://localhost/info.php&quot;&gt;&lt;strong&gt;http://localhost/info.php&lt;/strong&gt;&lt;/a&gt; in the browser window. If PHP is installed correctly and output like this one will appear. This output will have the information about the Linyx environment and has configuration files.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15970 aligncenter&quot; height=&quot;1080&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1614px) 100vw, 1614px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1934.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1934.png 1614w, https://vitux.com/wp-content/uploads/word-image-1934-300x201.png 300w, https://vitux.com/wp-content/uploads/word-image-1934-1024x685.png 1024w, https://vitux.com/wp-content/uploads/word-image-1934-768x514.png 768w, https://vitux.com/wp-content/uploads/word-image-1934-1536x1028.png 1536w&quot; width=&quot;1614&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Setting up MySQL root password&lt;/h2&gt;
&lt;p&gt;Go to the terminal and then log in to MySQL. Set up the password and then exit it.&lt;/p&gt;
&lt;p&gt;Enter the command:&lt;/p&gt;
&lt;pre&gt;$ sudo mysql -u root&lt;/pre&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15971 aligncenter&quot; height=&quot;26&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 672px) 100vw, 672px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1935.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1935.png 672w, https://vitux.com/wp-content/uploads/word-image-1935-300x12.png 300w, https://vitux.com/wp-content/uploads/word-image-1935-642x26.png 642w&quot; width=&quot;672&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The terminal has now changed the prompt sign from $ to &amp;lt;. This means users have entered mysql and can make changes in the database.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15972 aligncenter&quot; height=&quot;368&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1040px) 100vw, 1040px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1936.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1936.png 1040w, https://vitux.com/wp-content/uploads/word-image-1936-300x106.png 300w, https://vitux.com/wp-content/uploads/word-image-1936-1024x362.png 1024w, https://vitux.com/wp-content/uploads/word-image-1936-768x272.png 768w&quot; width=&quot;1040&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Once updates have been done, type &lt;strong&gt;quit&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15973 aligncenter&quot; height=&quot;28&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 154px) 100vw, 154px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1937.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1937.png 154w, https://vitux.com/wp-content/uploads/word-image-1937-150x28.png 150w&quot; width=&quot;154&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Now, restart MySQL to save any changes made (like password) etc by using:&lt;/p&gt;
&lt;pre&gt;$ sudo systemctl restart mysql&lt;/pre&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15974 aligncenter&quot; height=&quot;32&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 728px) 100vw, 728px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1938.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1938.png 728w, https://vitux.com/wp-content/uploads/word-image-1938-300x13.png 300w&quot; width=&quot;728&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Installing phpMyAdmin&lt;/h2&gt;
&lt;p&gt;MySQL command line is the tool for people who have hands-on experience of MySQL commands. On the other hand, PhpMyAdmin is GUI based method for the management of different databases. It is not part of our LAMP stack but is used to manage MySQL database. Return to the terminal window and use this command to install phpMyAdmin:&lt;/p&gt;
&lt;pre&gt;$ sudo apt-get install phpMyAdmin&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;img class=&quot;wp-image-15975 aligncenter&quot; height=&quot;28&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 774px) 100vw, 774px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1939.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1939.png 774w, https://vitux.com/wp-content/uploads/word-image-1939-300x11.png 300w, https://vitux.com/wp-content/uploads/word-image-1939-768x28.png 768w, https://vitux.com/wp-content/uploads/word-image-1939-750x28.png 750w&quot; width=&quot;774&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Press the enter key when prompted. You need to press&lt;strong&gt; spacebar &lt;/strong&gt;from the keyboard to select &lt;strong&gt;apache2.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15976 aligncenter&quot; height=&quot;740&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1060px) 100vw, 1060px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1940.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1940.png 1060w, https://vitux.com/wp-content/uploads/word-image-1940-300x209.png 300w, https://vitux.com/wp-content/uploads/word-image-1940-1024x715.png 1024w, https://vitux.com/wp-content/uploads/word-image-1940-768x536.png 768w&quot; width=&quot;1060&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Once you have selected the web server, the system will ask for your permission to configure the database. Press the enter key from the keyboard to choose &lt;strong&gt;Yes.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15977 aligncenter&quot; height=&quot;686&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1056px) 100vw, 1056px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1941.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1941.png 1056w, https://vitux.com/wp-content/uploads/word-image-1941-300x195.png 300w, https://vitux.com/wp-content/uploads/word-image-1941-1024x665.png 1024w, https://vitux.com/wp-content/uploads/word-image-1941-768x499.png 768w&quot; width=&quot;1056&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Users will then be prompted to provide phpMyAdmin password. Provide the password then confirm the password in the next dialogue box.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15978 aligncenter&quot; height=&quot;616&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1052px) 100vw, 1052px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1942.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1942.png 1052w, https://vitux.com/wp-content/uploads/word-image-1942-300x176.png 300w, https://vitux.com/wp-content/uploads/word-image-1942-1024x600.png 1024w, https://vitux.com/wp-content/uploads/word-image-1942-768x450.png 768w&quot; width=&quot;1052&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Once you have provided the password, you need to confirm it. Renter the password and then hit enter. The process of installation will continue.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15979 aligncenter&quot; height=&quot;752&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1060px) 100vw, 1060px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1943.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1943.png 1060w, https://vitux.com/wp-content/uploads/word-image-1943-300x213.png 300w, https://vitux.com/wp-content/uploads/word-image-1943-1024x726.png 1024w, https://vitux.com/wp-content/uploads/word-image-1943-768x545.png 768w&quot; width=&quot;1060&quot;/&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Accessing PhpMyAdmin portal&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To access PhpMyAdmin, type &lt;strong&gt;localhost/phpmyadmin&lt;/strong&gt;. This will open up the login page. Provide the credentials and continue. The password is the one that was set earlier.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img class=&quot;wp-image-15980 aligncenter&quot; height=&quot;1034&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1450px) 100vw, 1450px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1944.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1944.png 1450w, https://vitux.com/wp-content/uploads/word-image-1944-300x214.png 300w, https://vitux.com/wp-content/uploads/word-image-1944-1024x730.png 1024w, https://vitux.com/wp-content/uploads/word-image-1944-768x548.png 768w&quot; width=&quot;1450&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;After you have logged in to &lt;strong&gt;phpmyadmin dashboard&lt;/strong&gt; you can create and manage all databases.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15981 aligncenter&quot; height=&quot;1194&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 2226px) 100vw, 2226px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1945.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1945.png 2226w, https://vitux.com/wp-content/uploads/word-image-1945-300x161.png 300w, https://vitux.com/wp-content/uploads/word-image-1945-1024x549.png 1024w, https://vitux.com/wp-content/uploads/word-image-1945-768x412.png 768w, https://vitux.com/wp-content/uploads/word-image-1945-1536x824.png 1536w, https://vitux.com/wp-content/uploads/word-image-1945-2048x1099.png 2048w&quot; width=&quot;2226&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Uninstalling Apache from the system&lt;/h2&gt;
&lt;p&gt;To uninstall Apache, simply type the following command in the system:&lt;/p&gt;
&lt;pre&gt;dpkg-l *apache* *mysql* phpmyadmin | grep ^ii | awk &#39;{print $2 }&#39; | xargs sudo apt-get -y purge --auto-remove&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;img class=&quot;wp-image-15982 aligncenter&quot; height=&quot;30&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1820px) 100vw, 1820px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1946.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1946.png 1820w, https://vitux.com/wp-content/uploads/word-image-1946-300x5.png 300w, https://vitux.com/wp-content/uploads/word-image-1946-1024x17.png 1024w, https://vitux.com/wp-content/uploads/word-image-1946-768x13.png 768w, https://vitux.com/wp-content/uploads/word-image-1946-1536x25.png 1536w&quot; width=&quot;1820&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The uninstallation will begin similar to the one given below:&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15983 aligncenter&quot; height=&quot;508&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1074px) 100vw, 1074px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1947.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1947.png 1074w, https://vitux.com/wp-content/uploads/word-image-1947-300x142.png 300w, https://vitux.com/wp-content/uploads/word-image-1947-1024x484.png 1024w, https://vitux.com/wp-content/uploads/word-image-1947-768x363.png 768w&quot; width=&quot;1074&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;The tutorial covered the entire method of installation of the Apache web server. We tested the entire LAMP stack in the system and executed the testing for each of the steps. At last, we tested it on PhpMyAdmin and then went through the method of uninstallation of the system.&lt;/p&gt;
&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;How to Install LAMP Stack on Linux Mint&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;

&lt;/article&gt;
&lt;span class=&quot;entry-title&quot;&gt;read coderpad profiles:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;http://www.lawrence.com/users/coderpad/&quot;&gt;http://www.lawrence.com/users/coderpad/&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;https://www.scribd.com/document/601722224/Coderpad&quot;&gt;https://www.scribd.com/document/601722224/Coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&quot;&gt;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://linktr.ee/coderpad&quot;&gt;https://linktr.ee/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.pearltrees.com/coderpad&quot;&gt;https://www.pearltrees.com/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.akonter.com/user/profile/coderpad&quot;&gt;https://www.akonter.com/user/profile/coderpad&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;</description><link>https://coderpad.blogspot.com/2022/11/how-to-install-lamp-stack-on-linux-mint.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-8407310529774988</guid><pubDate>Wed, 02 Nov 2022 15:14:00 +0000</pubDate><atom:updated>2022-11-02T08:14:49.348-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">How to Create Aliases for Customizing Commands in Ubuntu 22.04</category><title>How to Create Aliases for Customizing Commands in Ubuntu 22.04</title><description>&lt;article class=&quot;post-965 post type-post status-publish format-standard has-post-thumbnail hentry category-shell category-ubuntu&quot; id=&quot;post-965&quot;&gt;
&lt;div class=&quot;entry-content clearfix&quot;&gt;
&lt;p&gt;With Ubuntu, you can customize your long Bash commands by using short and pleasant aliases as replacements. When working on the command line, you can simply use an alias in place of the entire command you don�t want to type. The alias works exactly like the command it was created for.&lt;/p&gt;
&lt;p&gt;In this tutorial, you will learn how to create and use an alias for a command in Ubuntu. We use a simple example to demonstrate this process to you. We will perform the steps and commands described in this article on an Ubuntu 22.04 system.&lt;/p&gt;
&lt;h2&gt;Example: Setting up an alias for the ��&lt;em&gt;sudo apt-get install �&lt;/em&gt; command&lt;/h2&gt;
&lt;p&gt;If you do a lot of installations on your system and wish to avoid using the entire &lt;strong&gt;&lt;em&gt;sudo apt-get install &lt;/em&gt;&lt;/strong&gt;command, you can create a short alias for it using the following method:&lt;/p&gt;
&lt;p&gt;Through the file manager, open the &lt;em&gt;&lt;strong&gt;.bashrc&lt;/strong&gt;&lt;/em&gt; file located in your home folder. This file is usually a hidden file so you will need to use the &lt;em&gt;&lt;strong&gt;Ctrl+H&lt;/strong&gt;&lt;/em&gt; control to view all the hidden files located in the folder. You can use your favorite text editor through the command line or UI to edit this file. We are using the default graphical text editor to open and edit this file.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Bashrc file in editor&quot; class=&quot;aligncenter wp-image-966&quot; height=&quot;284&quot; sizes=&quot;(max-width: 893px) 100vw, 893px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/08/word-image-83.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/08/word-image-83.png 893w, https://vitux.com/wp-content/uploads/2018/08/word-image-83-300x95.png 300w, https://vitux.com/wp-content/uploads/2018/08/word-image-83-768x244.png 768w&quot; width=&quot;893&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Move to the end of the file and paste the following line:&lt;/p&gt;
&lt;pre&gt;alias agi=&#39;sudo apt-get install&#39;&lt;/pre&gt;
&lt;p&gt;Here �agi� is the new alias we are setting up.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Syntax for creating an alias:&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;alias [aliasName]=�old_command&#39;&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Alias in .bashrc file&quot; class=&quot;aligncenter wp-image-967&quot; height=&quot;198&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 507px) 100vw, 507px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/08/word-image-84.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/08/word-image-84.png 507w, https://vitux.com/wp-content/uploads/2018/08/word-image-84-300x117.png 300w&quot; width=&quot;507&quot;/&gt;&lt;/p&gt;
&lt;p&gt;You can also add other aliases to customize your apt-get commands by adding the following lines to this file:&lt;/p&gt;
&lt;pre&gt;alias agr=&#39;sudo apt-get remove&#39;&lt;/pre&gt;
&lt;pre&gt;alias agu=&#39;sudo apt-get update&#39;&lt;/pre&gt;
&lt;pre&gt;alias acs=&#39;apt-cache search&#39;&lt;/pre&gt;
&lt;p&gt;Save the file by clicking the Save button located at the top right corner.&lt;/p&gt;
&lt;p&gt;Open the Terminal through Ubuntu Dash or by pressing &lt;em&gt;&lt;strong&gt;Ctrl+Alt+T&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Run the following command in order to start using the new bashrc file.&lt;/p&gt;
&lt;pre&gt;$ source ~/.bashrc&lt;/pre&gt;
&lt;p&gt;The new .bashrc file is installed every time you log out and then log in. The above command enables you to use the changes without restarting your system.&lt;/p&gt;
&lt;p&gt;The alias has been set-up; you can now run the following command in order to install a new package to your system:&lt;/p&gt;
&lt;pre&gt;$ agi [package name]&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;Example:&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;$ agi nautilus-admin&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;Instead of&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;$ sudo apt-get install nautilus-admin&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;&lt;img alt=&quot;Newly created command alis in action&quot; class=&quot;aligncenter wp-image-968&quot; height=&quot;112&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 504px) 100vw, 504px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/08/word-image-85.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/08/word-image-85.png 504w, https://vitux.com/wp-content/uploads/2018/08/word-image-85-300x67.png 300w&quot; width=&quot;504&quot;/&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;You can see how in the above image I was able to install Nautilus by using the new command alias that I set up in this example.&lt;/p&gt;
&lt;h2&gt;Points to consider&lt;/h2&gt;
&lt;p&gt;While creating an alias please note the following points:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You cannot use an already existing command as an alias name. If you do this, your alias will not work, instead, the default ubuntu command will be executed.&lt;/li&gt;
&lt;li&gt;The alias name cannot contain any spaces. If the new alias you want to set up contains two or more words, you can use the �-� character to separate those words.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now you can get rid of the dry and rugged bash commands and use your own customized aliases to run the frequently used operations.&lt;/p&gt;

&lt;/article&gt;
&lt;span class=&quot;entry-title&quot;&gt;read coderpad profiles:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;http://www.lawrence.com/users/coderpad/&quot;&gt;http://www.lawrence.com/users/coderpad/&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;https://www.scribd.com/document/601722224/Coderpad&quot;&gt;https://www.scribd.com/document/601722224/Coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&quot;&gt;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://linktr.ee/coderpad&quot;&gt;https://linktr.ee/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.pearltrees.com/coderpad&quot;&gt;https://www.pearltrees.com/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.akonter.com/user/profile/coderpad&quot;&gt;https://www.akonter.com/user/profile/coderpad&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;</description><link>https://coderpad.blogspot.com/2022/11/how-to-create-aliases-for-customizing.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-7188058380401243141</guid><pubDate>Wed, 02 Nov 2022 15:13:00 +0000</pubDate><atom:updated>2022-11-02T08:13:41.898-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">How to use the Linux mtr (My Traceroute) command</category><title>How to use the Linux mtr (My Traceroute) command</title><description>&lt;article class=&quot;post-2696 post type-post status-publish format-standard has-post-thumbnail hentry category-linux category-ubuntu&quot; id=&quot;post-2696&quot;&gt;
&lt;div class=&quot;entry-content clearfix&quot;&gt;
&lt;h2&gt;What is the mtr command?&lt;/h2&gt;
&lt;p&gt;Mtr (my traceroute) is a command-line network diagnostic tool that provides the functions of the ping and traceroute commands. It is a simple and cross-platform tool that outputs information about the entire route that network packets take from the host system to the specified destination system. The mtr command is superior to the traceroute command because it also outputs the response percentage and response times for all network hops between the two systems.&lt;/p&gt;
&lt;p&gt;As a network administrator, you must know how to use the mtr command and the flags that you can use to customize the output in order to perform productive network diagnostics. This article explains the use of the mtr command in detail and provides examples to show you how to use specific flags with this command.&lt;/p&gt;
&lt;p&gt;We have run the commands and procedures described in this article on an Ubuntu 20.04 and Ubuntu 22.04 LTS system, but it should work on Debian 11 as well.&lt;/p&gt;
&lt;p&gt;Since mtr is a command-line program, we will use it in the Ubuntu command line, the terminal. You can open the terminal application using either the System Dash or the key combination Ctrl +Alt+t.&lt;/p&gt;
&lt;h2&gt;Installing mtr Command&lt;/h2&gt;
&lt;p&gt;The mtr command is probably not installed as a default on your system. you can install it easily with apt though.&lt;/p&gt;
&lt;pre&gt;sudo apt install mtr&lt;/pre&gt;
&lt;h2&gt;Usage of the mtr Command&lt;/h2&gt;
&lt;h3&gt;1. View traceroute report in real-time&lt;/h3&gt;
&lt;p&gt;The mtr command is primarily used to display the traceroute report for a remote machine. All you have to do is enter the domain name or IP address of the remote system using the mtr command and the output will display the traceroute report in real-time. When you�re done viewing the report, you can exit the command with either q or the Ctrl+C key combination.&lt;/p&gt;
&lt;h4&gt;Display Hostnames&lt;/h4&gt;
&lt;p&gt;The following syntax of the mtr command displays the hostnames in the traceroute report.&lt;/p&gt;
&lt;p&gt;Syntax:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;$ mtr [domainName/IP]&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;$ mtr google.com&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;use mtr command&quot; class=&quot;aligncenter wp-image-2697&quot; height=&quot;160&quot; sizes=&quot;(max-width: 736px) 100vw, 736px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/12/word-image-36.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/12/word-image-36.png 736w, https://vitux.com/wp-content/uploads/2018/12/word-image-36-300x65.png 300w&quot; width=&quot;736&quot;/&gt;&lt;/p&gt;
&lt;h4&gt;Display Numeric IP addresses&lt;/h4&gt;
&lt;p&gt;When you use the g flag with the mtr command, it displays the numeric IP addresses instead of the hostnames in the traceroute report.&lt;/p&gt;
&lt;p&gt;Syntax:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;$ mtr -g [domainName/IP]&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;$ mtr -g google.com&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;traceroute with mtr&quot; class=&quot;aligncenter wp-image-2698&quot; height=&quot;161&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 738px) 100vw, 738px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/12/word-image-37.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/12/word-image-37.png 738w, https://vitux.com/wp-content/uploads/2018/12/word-image-37-300x65.png 300w&quot; width=&quot;738&quot;/&gt;&lt;/p&gt;
&lt;h4&gt;Both hostnames and numeric IP addresses&lt;/h4&gt;
&lt;p&gt;When you use the b flag with the mtr command, it displays both the numeric IP addresses and the hostnames in the traceroute report.&lt;/p&gt;
&lt;p&gt;Syntax:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;$ mtr -b [domainName/IP]&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;$ mtr -b google.com&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Show hostnames and IP addresses&quot; class=&quot;aligncenter wp-image-2699&quot; height=&quot;165&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 736px) 100vw, 736px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/12/word-image-38.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/12/word-image-38.png 736w, https://vitux.com/wp-content/uploads/2018/12/word-image-38-300x67.png 300w&quot; width=&quot;736&quot;/&gt;&lt;/p&gt;
&lt;h3&gt;2. Specify a limit for the number of pings&lt;/h3&gt;
&lt;p&gt;You can configure the mtr command to quit after printing the traceroute report for a specific number of pings. In the output, you can easily view the number of pings under the Snt column; when Snt reaches the number you specified in your command through the c flag, mtr will automatically exit.&lt;/p&gt;
&lt;p&gt;Syntax:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;$ &lt;/em&gt;mtr&lt;em&gt; -c [n] �&lt;/em&gt;domainname&lt;em&gt;/IP�&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;$ mtr -c 10 google.com&lt;/pre&gt;
&lt;h3&gt;3. Enable Report Mode&lt;/h3&gt;
&lt;p&gt;Instead of printing the output of the mtr command on the screen, you can enable the report mode that will instead print the output in a text file. This way you can record the network analysis for later use and observation. All you need to do is enable the report mode through the r flag, specify a ping count for which you want to limit the report through the c flag, and also specify the report filename in which the report will be saved.&lt;/p&gt;
&lt;p&gt;Syntax:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;$ &lt;/em&gt;mtr&lt;em&gt; -r -c [n] �&lt;/em&gt;domainname&lt;em&gt;/IP� &amp;gt;�report-name�&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;$ mtr -r -c 10 google.com &amp;gt;mtr-report-google&lt;/pre&gt;
&lt;p&gt;The report is saved in the current user�s home folder by default. You can, however, specify a proper path for the report to be saved in.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Report mode enabled in mtr command&quot; class=&quot;aligncenter wp-image-2700&quot; height=&quot;165&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 895px) 100vw, 895px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/12/word-image-39.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/12/word-image-39.png 895w, https://vitux.com/wp-content/uploads/2018/12/word-image-39-300x55.png 300w, https://vitux.com/wp-content/uploads/2018/12/word-image-39-768x142.png 768w&quot; width=&quot;895&quot;/&gt;&lt;/p&gt;
&lt;h4&gt;Clear output in Report&lt;/h4&gt;
&lt;p&gt;Adding a w flag with the r flag will enable mtr to print a rather clear and more readable report for the traceroute.&lt;/p&gt;
&lt;p&gt;Syntax:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;$ &lt;/em&gt;mtr&lt;em&gt; �&lt;/em&gt;rw&lt;em&gt; -c [n] �&lt;/em&gt;domainname&lt;em&gt;/IP� &amp;gt;�report-name�&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;mtr -rw -c 10 google.com &amp;gt;mtr-report-google&lt;/pre&gt;
&lt;h3&gt;4. Rearrange the output fields&lt;/h3&gt;
&lt;p&gt;When you see the output of the mtr report, you will observe that the columns are arranged in a specific default manner. The o flag enables you to re-arrange the output in a customized manner to make it more useful and productive.&lt;/p&gt;
&lt;p&gt;Syntax:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;$ &lt;/em&gt;mtr&lt;em&gt; -o �[Output Format]� �&lt;/em&gt;domainname&lt;em&gt;/IP�&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The mtr manpage can help you with what options you have while customizing the mtr report columns.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;$ mtr -o &quot;LSDR NBAW JMXI&quot; google.com&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Rearrange the output fields&quot; class=&quot;aligncenter wp-image-2701&quot; height=&quot;155&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 734px) 100vw, 734px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/12/word-image-40.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/12/word-image-40.png 734w, https://vitux.com/wp-content/uploads/2018/12/word-image-40-300x63.png 300w&quot; width=&quot;734&quot;/&gt;&lt;/p&gt;
&lt;h3&gt;5. Specify Time Interval between ICMP ECHO requests&lt;/h3&gt;
&lt;p&gt;Although the default time interval between each ICMP and ECHO request is 1 second in the mtr command, you can change it by using the i flag to specify a new time interval.&lt;/p&gt;
&lt;p&gt;Syntax:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;$ &lt;/em&gt;mtr&lt;em&gt; -i [time-in-seconds] �&lt;/em&gt;domainName&lt;em&gt;/IP�&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;$ mtr -i 10 google.com&lt;/pre&gt;
&lt;h3&gt;6. Use TCP SYN packets or UDP datagrams&lt;/h3&gt;
&lt;p&gt;If you want to use the TCP SYN or the UDP datagrams for requesting mtr instead of the default ICMP ECHO requests, you can do so by using the tcp and udp flags respectively.&lt;/p&gt;
&lt;p&gt;Syntax:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;$ mtr �tcp �domainName/IP�&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;$ mtr �udp �domainName/IP�&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;$ mtr --tcp google.com&lt;/pre&gt;
&lt;pre&gt;$ mtr --udp google.com&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Use TCP SYN packets or UDP datagrams&quot; class=&quot;aligncenter wp-image-2702&quot; height=&quot;304&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 738px) 100vw, 738px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/12/word-image-41.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/12/word-image-41.png 738w, https://vitux.com/wp-content/uploads/2018/12/word-image-41-300x124.png 300w&quot; width=&quot;738&quot;/&gt;&lt;/p&gt;
&lt;h3&gt;7. Specify the maximum number of hops between the local system and the remote machine&lt;/h3&gt;
&lt;p&gt;You can customize the maximum number of hops to be probed between your local system and the remote machine by specifying the time, in seconds, with the m flag. The default time limit between two hops is 30 seconds for the mtr command.&lt;/p&gt;
&lt;p&gt;Syntax:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;$ &lt;/em&gt;mtr&lt;em&gt; -m [timeInSeconds] �&lt;/em&gt;domainName&lt;em&gt;/IP�&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;$ mtr -m 35 216.58.223.78&lt;/pre&gt;
&lt;h3&gt;8. Specify packet size&lt;/h3&gt;
&lt;p&gt;Through the s flag in the mtr command, you can specify the size, in bytes, of the IP packet for diagnosing network quality.&lt;/p&gt;
&lt;p&gt;Syntax:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;$ &lt;/em&gt;mtr&lt;em&gt; �&lt;/em&gt;r -s&lt;em&gt; [packetsize] �&lt;/em&gt;domainName&lt;em&gt;/IP�&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;mtr -r -s 50 google.com&lt;/pre&gt;
&lt;h3&gt;9. Print CSV Output&lt;/h3&gt;
&lt;p&gt;The CSV output of the mtr report delimits the columns with a �,�. With the csv flag, you can customize the mtr command to output the report in a CSV format.&lt;/p&gt;
&lt;p&gt;Syntax:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;$ mtr �csv �domainName/IP�&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;$ mtr --csv google.com&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Print CSV Output&quot; class=&quot;aligncenter wp-image-2703&quot; height=&quot;312&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 733px) 100vw, 733px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/12/word-image-42.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/12/word-image-42.png 733w, https://vitux.com/wp-content/uploads/2018/12/word-image-42-300x128.png 300w&quot; width=&quot;733&quot;/&gt;&lt;/p&gt;
&lt;h3&gt;10. Print XML Output&lt;/h3&gt;
&lt;p&gt;The mtr command can also support the XML format for printing traceroute reports. The XML report is a good option for automated processing of the output and can be printed by specifying the xml flag with the mtr command.&lt;/p&gt;
&lt;p&gt;Syntax:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;$ mtr �xml �domainName/IP�&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;$ mtr --xml google.com&lt;/pre&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-2704 aligncenter&quot; height=&quot;568&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 769px) 100vw, 769px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/12/word-image-43.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/12/word-image-43.png 769w, https://vitux.com/wp-content/uploads/2018/12/word-image-43-300x222.png 300w, https://vitux.com/wp-content/uploads/2018/12/word-image-43-768x567.png 768w&quot; width=&quot;769&quot;/&gt;&lt;/p&gt;
&lt;h3&gt;11. Accessing the mtr help and man page&lt;/h3&gt;
&lt;p&gt;Finally, you can get further options for usage and customization of the mtr command by reading its help and man page through the following commands.&lt;/p&gt;
&lt;pre&gt;$ man mtr&lt;/pre&gt;
&lt;pre&gt;$ mtr --help&lt;/pre&gt;
&lt;p&gt;Here is a list of all mtr command-line options&lt;/p&gt;
&lt;pre&gt;Usage:
mtr [options] hostname

-F, --filename FILE read hostname(s) from a file
-4 use IPv4 only
-6 use IPv6 only
-u, --udp use UDP instead of ICMP echo
-T, --tcp use TCP instead of ICMP echo
-I, --interface NAME use named network interface
-a, --address ADDRESS bind the outgoing socket to ADDRESS
-f, --first-ttl NUMBER set what TTL to start
-m, --max-ttl NUMBER maximum number of hops
-U, --max-unknown NUMBER maximum unknown host
-P, --port PORT target port number for TCP, SCTP, or UDP
-L, --localport LOCALPORT source port number for UDP
-s, --psize PACKETSIZE set the packet size used for probing
-B, --bitpattern NUMBER set bit pattern to use in payload
-i, --interval SECONDS ICMP echo request interval
-G, --gracetime SECONDS number of seconds to wait for responses
-Q, --tos NUMBER type of service field in IP header
-e, --mpls display information from ICMP extensions
-Z, --timeout SECONDS seconds to keep probe sockets open
-M, --mark MARK mark each sent packet
-r, --report output using report mode
-w, --report-wide output wide report
-c, --report-cycles COUNT set the number of pings sent
-j, --json output json
-x, --xml output xml
-C, --csv output comma separated values
-l, --raw output raw format
-p, --split split output
-t, --curses use curses terminal interface
--displaymode MODE select initial display mode
-g, --gtk use GTK+ xwindow interface
-n, --no-dns do not resolve host names
-b, --show-ips show IP numbers and host names
-o, --order FIELDS select output fields
-y, --ipinfo NUMBER select IP information in output
-z, --aslookup display AS number
-h, --help display this help and exit
-v, --version output version information and exit&lt;/pre&gt;
&lt;p&gt;After reading this article, you are better equipped with running network diagnostics between your machine and a remote system. You also have an alternative to the ping and traceroute commands, with many more customization options for better productivity and usefulness.&lt;/p&gt;
&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;How to use the Linux mtr (My Traceroute) command&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;

&lt;/article&gt;
&lt;span class=&quot;entry-title&quot;&gt;read coderpad profiles:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;http://www.lawrence.com/users/coderpad/&quot;&gt;http://www.lawrence.com/users/coderpad/&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;https://www.scribd.com/document/601722224/Coderpad&quot;&gt;https://www.scribd.com/document/601722224/Coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&quot;&gt;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://linktr.ee/coderpad&quot;&gt;https://linktr.ee/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.pearltrees.com/coderpad&quot;&gt;https://www.pearltrees.com/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.akonter.com/user/profile/coderpad&quot;&gt;https://www.akonter.com/user/profile/coderpad&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;</description><link>https://coderpad.blogspot.com/2022/11/how-to-use-linux-mtr-my-traceroute.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-863766994848899944</guid><pubDate>Wed, 02 Nov 2022 15:12:00 +0000</pubDate><atom:updated>2022-11-02T08:12:45.217-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">How to Format a USB drive in Ubuntu</category><title>How to Format a USB drive in Ubuntu</title><description>&lt;article class=&quot;post-1495 post type-post status-publish format-standard has-post-thumbnail hentry category-linux category-ubuntu&quot; id=&quot;post-1495&quot;&gt;
&lt;div class=&quot;entry-content clearfix&quot;&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;Format USB Drive on Ubuntu&quot; class=&quot;alignnone size-large wp-image-1851&quot; height=&quot;375&quot; sizes=&quot;(max-width: 750px) 100vw, 750px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/10/ubuntu-format-usb-drive-1024x512.jpg&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/10/ubuntu-format-usb-drive.jpg 1024w, https://vitux.com/wp-content/uploads/2018/10/ubuntu-format-usb-drive-300x150.jpg 300w, https://vitux.com/wp-content/uploads/2018/10/ubuntu-format-usb-drive-768x384.jpg 768w&quot; width=&quot;750&quot;/&gt;&lt;/p&gt;
&lt;p&gt;It happens every now and then that we need to format a USB drive to change the file system, delete the data completely or get rid of a virus that has infected it. There are several ways to format a USB drive, and we�ve listed a few of them in this article so you can see which one works for you. You can format a USB drive both from the command line and from the graphical user interface, whichever you prefer.&lt;/p&gt;
&lt;h2&gt;Format USB Drive Through the Command Line&lt;/h2&gt;
&lt;p&gt;Formatting a USB drive is very easy via the command line. Even a beginner can format a USB drive using the commands described here.&lt;/p&gt;
&lt;p&gt;1. the first step is to identify the USB drive correctly to avoid formatting another drive by mistake. Open the Terminal application via Dash or the &lt;em&gt;&lt;strong&gt;Ctrl+Alt+T&lt;/strong&gt;&lt;/em&gt; key combination and type the following command:&lt;/p&gt;
&lt;pre&gt;$ df -h&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Identify USB Drive name&quot; class=&quot;aligncenter wp-image-1496&quot; height=&quot;116&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 541px) 100vw, 541px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-28.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-28.png 541w, https://vitux.com/wp-content/uploads/2018/09/word-image-28-300x64.png 300w&quot; width=&quot;541&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The last line in the output lists /dev/sdb1 as our USB drive.&lt;/p&gt;
&lt;p&gt;2. Use the following command in order to format the USB as per the VFAT file system:&lt;/p&gt;
&lt;pre&gt;$ sudo mkfs.vfat /dev/sdb1&lt;/pre&gt;
&lt;p&gt;You will be using the location as per the output you got from the df -h command.&lt;/p&gt;
&lt;p&gt;3. You can only format an unmounted USB drive, otherwise, you will get the following message:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Make file system with mkfs command&quot; class=&quot;aligncenter wp-image-1497&quot; height=&quot;126&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 470px) 100vw, 470px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-29.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-29.png 470w, https://vitux.com/wp-content/uploads/2018/09/word-image-29-300x80.png 300w&quot; width=&quot;470&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Therefore, please unmount the drive through the following command:&lt;/p&gt;
&lt;pre&gt;$ sudo umount /dev/sdb1&lt;/pre&gt;
&lt;p&gt;Now when you run the formatting command as a root user, your USB drive will be successfully formatted.&lt;/p&gt;
&lt;h2&gt;Format USB Drive Through the GUI&lt;/h2&gt;
&lt;h3&gt;Format Directly from the File Manager&lt;/h3&gt;
&lt;p&gt;You can format a USB drive through the graphical interface of your Ubuntu system as follows:&lt;/p&gt;
&lt;p&gt;1. Open the file manager and then right-click the USB drive name that you want to format, from the left pane.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Right-Click on USB drive in File Manager&quot; class=&quot;aligncenter wp-image-1498&quot; height=&quot;391&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 205px) 100vw, 205px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-30.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-30.png 238w, https://vitux.com/wp-content/uploads/2018/09/word-image-30-157x300.png 157w&quot; width=&quot;205&quot;/&gt;&lt;/p&gt;
&lt;p&gt;2. Click the Format option from the right-click menu. The following dialog will open.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Format option&quot; class=&quot;aligncenter wp-image-1499&quot; height=&quot;321&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 528px) 100vw, 528px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-31.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-31.png 625w, https://vitux.com/wp-content/uploads/2018/09/word-image-31-300x182.png 300w&quot; width=&quot;528&quot;/&gt;&lt;/p&gt;
&lt;p&gt;3. Enter a volume name for your USB drive. In the figure above we have entered USB as the volume name.&lt;/p&gt;
&lt;p&gt;You can delete the existing data on your USB drive by clicking the Delete button. In this case the existing data on your system will be overwritten and the formatting process will take a little longer. You can also specify the file system you want the USB drive to have. 4.&lt;/p&gt;
&lt;p&gt;4. Click the Next button in the upper right corner, which becomes active only after you have entered all the details.&lt;/p&gt;
&lt;p&gt;The following Confirm Details dialog will open so you can confirm the formatting details. Please make sure you format the correct volume by looking at the location information. This will prevent you from formatting an unwanted storage and damaging your system.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Confirm USB Drive to be formatted&quot; class=&quot;aligncenter wp-image-1500&quot; height=&quot;316&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 622px) 100vw, 622px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-32.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-32.png 622w, https://vitux.com/wp-content/uploads/2018/09/word-image-32-300x152.png 300w&quot; width=&quot;622&quot;/&gt;&lt;/p&gt;
&lt;p&gt;4. Click the Format button after confirming the details.&lt;/p&gt;
&lt;p&gt;Your USB drive will be formatted and ready for use, based on the volume name, file system, and data erasing options you specified.&lt;/p&gt;
&lt;h3&gt;Format USB Drive through the GParted tool&lt;/h3&gt;
&lt;p&gt;You can also format your USB drive through a tool called Gparted. Gparted in an open source partition editor for Linux systems. Follow these steps to install and use this tool:&lt;/p&gt;
&lt;h4&gt;Installation&lt;/h4&gt;
&lt;p&gt;1. Open the Terminal through &lt;em&gt;&lt;strong&gt;CTRL+ALT+T&lt;/strong&gt;&lt;/em&gt; or through your Ubuntu Dash.&lt;/p&gt;
&lt;p&gt;2. Enter the following command in order to install the open-source tool GParted:&lt;/p&gt;
&lt;pre&gt;$ sudo apt-get install gparted&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Install GParted&quot; class=&quot;aligncenter wp-image-1501&quot; height=&quot;287&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 659px) 100vw, 659px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-33.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-33.png 659w, https://vitux.com/wp-content/uploads/2018/09/word-image-33-300x131.png 300w&quot; width=&quot;659&quot;/&gt;&lt;/p&gt;
&lt;p&gt;3. Enter y when prompted by a y/n option for continuing installation.&lt;/p&gt;
&lt;p&gt;The GParted tool will be installed on your system.&lt;/p&gt;
&lt;h4&gt;Formating&lt;/h4&gt;
&lt;p&gt;4. In order to access the GParted from your desktop, search for it through the Dash as follows:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Start Gparted&quot; class=&quot;aligncenter wp-image-1502&quot; height=&quot;212&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 396px) 100vw, 396px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-34.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-34.png 396w, https://vitux.com/wp-content/uploads/2018/09/word-image-34-300x161.png 300w&quot; width=&quot;396&quot;/&gt;&lt;/p&gt;
&lt;p&gt;5. Click on the GParted icon to open the application.&lt;/p&gt;
&lt;p&gt;6. You will be asked to provide authentication for root user as only a root user can access and use this application. Provide the password and then click Authenticate.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Autenticate as admin user&quot; class=&quot;aligncenter wp-image-1503&quot; height=&quot;347&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 451px) 100vw, 451px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-35.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-35.png 451w, https://vitux.com/wp-content/uploads/2018/09/word-image-35-300x231.png 300w&quot; width=&quot;451&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The tool will open, displaying the /dev/sda partitions of the hard disk by default.&lt;/p&gt;
&lt;p&gt;7. Since we want to view details of removable media, select that from the drop-down option located at the top-right corner. You will now be able to see the partitions of removable media as follows:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Select removable media&quot; class=&quot;aligncenter wp-image-1504&quot; height=&quot;255&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 506px) 100vw, 506px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-36.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-36.png 506w, https://vitux.com/wp-content/uploads/2018/09/word-image-36-300x151.png 300w&quot; width=&quot;506&quot;/&gt;&lt;/p&gt;
&lt;p&gt;8. You need to unmount a USB drive before formatting it. Select the USB partition that you want to format, right-click and then click Unmount.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Unmount USB Drive&quot; class=&quot;aligncenter wp-image-1505&quot; height=&quot;346&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 575px) 100vw, 575px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-37.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-37.png 575w, https://vitux.com/wp-content/uploads/2018/09/word-image-37-300x181.png 300w&quot; width=&quot;575&quot;/&gt;&lt;/p&gt;
&lt;p&gt;9. Now when you right-click the USB partition, the �&lt;em&gt;&lt;strong&gt;Format to&lt;/strong&gt;&lt;/em&gt;� option will become active. Click the Format to option and then select a file system you want to use for your USB drive.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Format To&quot; class=&quot;aligncenter wp-image-1506&quot; height=&quot;464&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 536px) 100vw, 536px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-38.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-38.png 536w, https://vitux.com/wp-content/uploads/2018/09/word-image-38-300x260.png 300w&quot; width=&quot;536&quot;/&gt;&lt;/p&gt;
&lt;p&gt;We have selected ntfs in this example. This operation will be added as a pending operation.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Fomat with ntfs File System&quot; class=&quot;aligncenter wp-image-1507&quot; height=&quot;149&quot; loading=&quot;lazy&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-39.png&quot; width=&quot;217&quot;/&gt;&lt;/p&gt;
&lt;p&gt;10. In order to apply this operation, click the tick icon from the top bar to apply all operations.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Apply changes&quot; class=&quot;aligncenter wp-image-1508&quot; height=&quot;176&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 383px) 100vw, 383px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-40.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-40.png 383w, https://vitux.com/wp-content/uploads/2018/09/word-image-40-300x138.png 300w&quot; width=&quot;383&quot;/&gt;&lt;/p&gt;
&lt;p&gt;11. The following dialog will appear, asking you for confirmation about applying all the pending operations. Click the Apply button when you are sure about your choice.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Confirm Window&quot; class=&quot;aligncenter wp-image-1509&quot; height=&quot;150&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 491px) 100vw, 491px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-41.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-41.png 550w, https://vitux.com/wp-content/uploads/2018/09/word-image-41-300x92.png 300w&quot; width=&quot;491&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The formatting process will begin:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Formatting begins&quot; class=&quot;aligncenter wp-image-1510&quot; height=&quot;234&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 562px) 100vw, 562px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-42.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-42.png 699w, https://vitux.com/wp-content/uploads/2018/09/word-image-42-300x125.png 300w&quot; width=&quot;562&quot;/&gt;&lt;/p&gt;
&lt;p&gt;You will be notified when the operations have been completed as follows:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Formatting operation completed successfully&quot; class=&quot;aligncenter wp-image-1511&quot; height=&quot;223&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 535px) 100vw, 535px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-43.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/09/word-image-43.png 696w, https://vitux.com/wp-content/uploads/2018/09/word-image-43-300x125.png 300w&quot; width=&quot;535&quot;/&gt;&lt;/p&gt;
&lt;p&gt;12. Click the Close button; you now have a formatted USB drive with the file system you specified.&lt;/p&gt;
&lt;p&gt;After reading this article, you may have found a way to format your USB drive for better use. You can use both the command line and the user interface to format a USB drive after you unmount it. The powerful partition editing tool GParted will also help you format your drive based on a long list of file types.&lt;/p&gt;
&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;How to Format a USB drive in Ubuntu&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;

&lt;/article&gt;
&lt;span class=&quot;entry-title&quot;&gt;read coderpad profiles:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;http://www.lawrence.com/users/coderpad/&quot;&gt;http://www.lawrence.com/users/coderpad/&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;https://www.scribd.com/document/601722224/Coderpad&quot;&gt;https://www.scribd.com/document/601722224/Coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&quot;&gt;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://linktr.ee/coderpad&quot;&gt;https://linktr.ee/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.pearltrees.com/coderpad&quot;&gt;https://www.pearltrees.com/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.akonter.com/user/profile/coderpad&quot;&gt;https://www.akonter.com/user/profile/coderpad&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;</description><link>https://coderpad.blogspot.com/2022/11/how-to-format-usb-drive-in-ubuntu.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-7289135423437955048</guid><pubDate>Wed, 02 Nov 2022 15:11:00 +0000</pubDate><atom:updated>2022-11-02T08:11:41.115-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">How to Install AWS-CLI on Ubuntu</category><title>How to Install AWS-CLI on Ubuntu</title><description>&lt;article class=&quot;post-19315 post type-post status-publish format-standard has-post-thumbnail hentry category-linux category-shell category-ubuntu&quot; id=&quot;post-19315&quot;&gt;
&lt;div class=&quot;entry-content clearfix&quot;&gt;
&lt;p&gt;Since Linux users are more comfortable working with command line interfaces, Amazon Web Services introduced the AWS CLI to manage all these services from a single platform. With this tool, you can manage multiple services at once, easily and conveniently. In this guide, we�ll show you how to install the AWS CLI on Ubuntu Linux.&lt;/p&gt;
&lt;h2&gt;Install the AWS CLI on Ubuntu&lt;/h2&gt;
&lt;p&gt;In order to install the AWS CLI on an Ubuntu server or Desktop, you need to proceed with the following steps:&lt;/p&gt;
&lt;h3&gt;Step # 1: Prepare the Target Machine for the AWS CLI Installation&lt;/h3&gt;
&lt;p&gt;First, you need to prepare your target machine for the AWS CLI installation by updating it as shown below:&lt;/p&gt;
&lt;pre&gt;$ sudo apt-get update&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=&quot;Update packages&quot; class=&quot;aligncenter wp-image-19316&quot; height=&quot;26&quot; sizes=&quot;(max-width: 403px) 100vw, 403px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-19315-1.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-19315-1.png 403w, https://vitux.com/wp-content/uploads/word-image-19315-1-300x19.png 300w&quot; width=&quot;403&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This command will not only update the required packages but will also remove all the unnecessary ones.&lt;/p&gt;
&lt;h3&gt;Step # 2: Install the AWS CLI on the Target Machine&lt;/h3&gt;
&lt;p&gt;Then, you can install the AWS CLI on your target machine by running the following command:&lt;/p&gt;
&lt;pre&gt;$ sudo apt-get install awscli&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=&quot;Install AWS CLI&quot; class=&quot;aligncenter wp-image-19317&quot; height=&quot;26&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 468px) 100vw, 468px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-19315-2.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-19315-2.png 468w, https://vitux.com/wp-content/uploads/word-image-19315-2-300x17.png 300w&quot; width=&quot;468&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Step # 3: Confirm the installation of the AWS CLI on the Target Machine&lt;/h3&gt;
&lt;p&gt;After that, you can confirm the installation of the AWS CLI on your target system by executing the command shown below:&lt;/p&gt;
&lt;pre&gt;$ aws --version&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=&quot;Check AWScli version&quot; class=&quot;aligncenter wp-image-19318&quot; height=&quot;25&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 353px) 100vw, 353px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-19315-3.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-19315-3.png 353w, https://vitux.com/wp-content/uploads/word-image-19315-3-300x21.png 300w&quot; width=&quot;353&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The appearance of the AWS CLI version on the terminal confirms its installation on the target machine as shown in the following image:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;AWS-CLI installed successfully&quot; class=&quot;aligncenter wp-image-19319&quot; height=&quot;60&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 565px) 100vw, 565px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-19315-4.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-19315-4.png 565w, https://vitux.com/wp-content/uploads/word-image-19315-4-300x32.png 300w&quot; width=&quot;565&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Remove the AWS CLI&lt;/h2&gt;
&lt;p&gt;To remove the AWS CLI along with all of its associated packages from your target system, you can simply run the command shown below:&lt;/p&gt;
&lt;pre&gt;$ sudo apt-get purge --autoremove awscli&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;img class=&quot;wp-image-19320 aligncenter&quot; height=&quot;22&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 551px) 100vw, 551px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-19315-5.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-19315-5.png 551w, https://vitux.com/wp-content/uploads/word-image-19315-5-300x12.png 300w&quot; width=&quot;551&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;The installation of the AWS CLI Ubuntu Linux and Linux Mint is extremely simple as we have seen in this article. Once you have this tool installed on your target system, you can conveniently manage as many Amazon Web Services as you want with the help of this unified tool.&lt;/p&gt;
&lt;p&gt;�&lt;/p&gt;
&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;How to Install AWS-CLI on Ubuntu&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;

&lt;/article&gt;
&lt;span class=&quot;entry-title&quot;&gt;read coderpad profiles:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;http://www.lawrence.com/users/coderpad/&quot;&gt;http://www.lawrence.com/users/coderpad/&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;https://www.scribd.com/document/601722224/Coderpad&quot;&gt;https://www.scribd.com/document/601722224/Coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&quot;&gt;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://linktr.ee/coderpad&quot;&gt;https://linktr.ee/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.pearltrees.com/coderpad&quot;&gt;https://www.pearltrees.com/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.akonter.com/user/profile/coderpad&quot;&gt;https://www.akonter.com/user/profile/coderpad&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;</description><link>https://coderpad.blogspot.com/2022/11/how-to-install-aws-cli-on-ubuntu.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-69185463284223844</guid><pubDate>Wed, 02 Nov 2022 15:10:00 +0000</pubDate><atom:updated>2022-11-02T08:10:38.871-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">How to Change sudo Password in Ubuntu 22.04</category><title>How to Change sudo Password in Ubuntu 22.04</title><description>&lt;article class=&quot;post-2608 post type-post status-publish format-standard has-post-thumbnail hentry category-linux category-ubuntu&quot; id=&quot;post-2608&quot;&gt;
&lt;div class=&quot;entry-content clearfix&quot;&gt;
&lt;p&gt;If you are a new Ubuntu admin user, you may want to know how to change the password in Ubuntu Linux Server from the bash shell or command line. After all, it is a good security practice to change passwords for every user, especially the SuperUser who can perform all sensitive operations in Ubuntu. Only a SuperUser or root can change the password for any user account. Other users can only change their own passwords.&lt;/p&gt;
&lt;p&gt;User passwords are changed in Ubuntu using the passwd command.&lt;/p&gt;
&lt;p&gt;In this article, we explain how a root user can change their own password on an Ubuntu server.&lt;/p&gt;
&lt;p&gt;We have run the commands and procedures mentioned in this article on an Ubuntu 22.04 LTS system.&lt;/p&gt;
&lt;p&gt;Need help in creating a strong password? Then take a look here: &lt;a href=&quot;https://vitux.com/7-methods-to-generate-a-strong-password-in-ubuntu/&quot; title=&quot;7 Methods to Generate a Strong Password in Ubuntu&quot;&gt;7 Methods to Generate a Strong Password in Ubuntu&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Step 1: Open the Ubuntu command line&lt;/h2&gt;
&lt;p&gt;We need to use the Ubuntu command line, the Terminal, in order to change the sudo password. Open the Terminal either through the system Dash or the Ctrl+Alt+T shortcut.&lt;/p&gt;
&lt;h2&gt;Step 2: Log in as root user&lt;/h2&gt;
&lt;p&gt;Only a root user can change his/her own password. Therefore you need to log in as root first. Enter the following command to do so:&lt;/p&gt;
&lt;pre&gt;@ sudo -i&lt;/pre&gt;
&lt;p&gt;The system will prompt you to enter the current sudo password. Please enter the password and hit Enter.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Become root user on Ubuntu&quot; class=&quot;aligncenter wp-image-2609&quot; height=&quot;62&quot; sizes=&quot;(max-width: 309px) 100vw, 309px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/11/word-image-187.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/11/word-image-187.png 309w, https://vitux.com/wp-content/uploads/2018/11/word-image-187-300x60.png 300w&quot; width=&quot;309&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Now you will be logged in as root user; you can see that indication in the command prompt.&lt;/p&gt;
&lt;h2&gt;Step 3: Change the sudo password through the passwd command&lt;/h2&gt;
&lt;p&gt;Now that you are logged in as root, you can change the passwd for the current (root) user by using the passwd command as follows:&lt;/p&gt;
&lt;pre&gt;$ passwd&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Change root password on Ubuntu&quot; class=&quot;aligncenter wp-image-2610&quot; height=&quot;96&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 341px) 100vw, 341px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/11/word-image-188.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/11/word-image-188.png 341w, https://vitux.com/wp-content/uploads/2018/11/word-image-188-300x84.png 300w&quot; width=&quot;341&quot;/&gt;&lt;/p&gt;
&lt;p&gt;When you enter the passwd command, the system will prompt you to enter the new UNIX root password. When you enter the new password and hit enter, the system will prompt you to retype the new UNIX root password. After doing so, the system will confirm that the password is updated successfully.&lt;/p&gt;
&lt;p&gt;Now whenever you need to log in as root or perform any installation and configuration operation that requires root authorization, you will be using this new password.&lt;/p&gt;
&lt;h2&gt;Step 4: Exit the root login and then the Terminal&lt;/h2&gt;
&lt;p&gt;When you are done with changing the password, you can log out of the root prompt by entering the following command.&lt;/p&gt;
&lt;pre&gt;$ exit&lt;/pre&gt;
&lt;p&gt;Once you are logged out, type the exit command again to exit the Terminal application.&lt;/p&gt;
&lt;h2&gt;An Alternative&lt;/h2&gt;
&lt;p&gt;A simple alternative is to enter the following command that lets you log in as root and enter the password-changing command for root, in a single command:&lt;/p&gt;
&lt;pre&gt;$ sudo passwd root&lt;/pre&gt;
&lt;p&gt;When you enter the above command, the system will prompt you to enter the new UNIX root password. When you enter the new password and hit enter, the system will prompt you to retype the new UNIX root password. After doing so, the system will confirm that the password is updated successfully.&lt;/p&gt;
&lt;p&gt;With the help of this article, you can change the password for sudo and make your system secure from any malicious activity time and again.&lt;/p&gt;
&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;How to Change sudo Password in Ubuntu 22.04&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;

&lt;/article&gt;
&lt;span class=&quot;entry-title&quot;&gt;read coderpad profiles:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;http://www.lawrence.com/users/coderpad/&quot;&gt;http://www.lawrence.com/users/coderpad/&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;https://www.scribd.com/document/601722224/Coderpad&quot;&gt;https://www.scribd.com/document/601722224/Coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&quot;&gt;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://linktr.ee/coderpad&quot;&gt;https://linktr.ee/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.pearltrees.com/coderpad&quot;&gt;https://www.pearltrees.com/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.akonter.com/user/profile/coderpad&quot;&gt;https://www.akonter.com/user/profile/coderpad&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;</description><link>https://coderpad.blogspot.com/2022/11/how-to-change-sudo-password-in-ubuntu.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-2652516367729892876</guid><pubDate>Wed, 02 Nov 2022 15:09:00 +0000</pubDate><atom:updated>2022-11-02T08:09:44.923-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">8 Ways to Generate a Random Password on Linux Shell</category><title>8 Ways to Generate a Random Password on Linux Shell</title><description>&lt;article class=&quot;post-578 post type-post status-publish format-standard has-post-thumbnail hentry category-shell category-ubuntu&quot; id=&quot;post-578&quot;&gt;
&lt;div class=&quot;entry-content clearfix&quot;&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;Linux random password generator&quot; class=&quot;alignnone size-full wp-image-19326&quot; height=&quot;512&quot; sizes=&quot;(max-width: 1024px) 100vw, 1024px&quot; src=&quot;https://vitux.com/wp-content/uploads/linux-random-password.jpg&quot; srcset=&quot;https://vitux.com/wp-content/uploads/linux-random-password.jpg 1024w, https://vitux.com/wp-content/uploads/linux-random-password-300x150.jpg 300w, https://vitux.com/wp-content/uploads/linux-random-password-768x384.jpg 768w&quot; width=&quot;1024&quot;/&gt;&lt;/p&gt;
&lt;p&gt;A strong password is very important when you authenticate to a service with a username and password. Sometimes you need to protect your account or server and try to keep your data safe. It is often said that a strong password must have at least 14 characters, with variations such as lower and upper case letters and alphabets. Most of the time, a long password is considered much more secure than a short one because it is hard to get. In this tutorial, we will learn many ways to create a secure password using the Linux command line. We will look at many different ways you can create a stronger and more secure password using the Linux command line. If you want to create a strong password using the command line, there are several methods and utilities available to you. We will discuss many of these methods and you can choose one of the methods to create a password depending on your needs.&lt;/p&gt;
&lt;h2&gt;Generation of a password with OpenSSL&lt;/h2&gt;
&lt;p&gt;Several methods, exist in Linux to create and generate the passwords for the Linux command line. The first one we are trying is by using OpenSSL. Following are the steps that need to be followed for this purpose.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;: First of all, open Terminal by clicking on the Ubuntu launcher and searching for Terminal.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Search Linux Terminal application&quot; class=&quot;wp-image-579 size-large aligncenter&quot; height=&quot;396&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 750px) 100vw, 750px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-309-1024x540.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-309-1024x540.png 1024w, https://vitux.com/wp-content/uploads/2018/06/word-image-309-300x158.png 300w, https://vitux.com/wp-content/uploads/2018/06/word-image-309-768x405.png 768w, https://vitux.com/wp-content/uploads/2018/06/word-image-309.png 1168w&quot; width=&quot;750&quot;/&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;: Now click on the Terminal and wait for the terminal to open.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Open the Terminal&quot; class=&quot;wp-image-580 size-large aligncenter&quot; height=&quot;396&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 750px) 100vw, 750px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-310-1024x540.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-310-1024x540.png 1024w, https://vitux.com/wp-content/uploads/2018/06/word-image-310-300x158.png 300w, https://vitux.com/wp-content/uploads/2018/06/word-image-310-768x405.png 768w, https://vitux.com/wp-content/uploads/2018/06/word-image-310.png 1168w&quot; width=&quot;750&quot;/&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;: Once the terminal is opened, you will have a screen like this:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Linux Terminal ready for use&quot; class=&quot;aligncenter wp-image-582&quot; height=&quot;468&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 725px) 100vw, 725px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-312.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-312.png 725w, https://vitux.com/wp-content/uploads/2018/06/word-image-312-300x194.png 300w&quot; width=&quot;725&quot;/&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The command that is used to generate a stronger password includes the OpenSSL rand function. This will help us generate 14 random characters in a string. The command is:&lt;/p&gt;
&lt;pre&gt;openssl rand -base64 14&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Create a random password with OpenSSL&quot; class=&quot;aligncenter wp-image-583&quot; height=&quot;23&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 483px) 100vw, 483px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-313.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-313.png 483w, https://vitux.com/wp-content/uploads/2018/06/word-image-313-300x14.png 300w&quot; width=&quot;483&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The outcome will be a strong password of 14 characters as shown below.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Password created with OpenSSL&quot; class=&quot;aligncenter wp-image-584&quot; height=&quot;20&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 317px) 100vw, 317px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-314.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-314.png 317w, https://vitux.com/wp-content/uploads/2018/06/word-image-314-300x19.png 300w&quot; width=&quot;317&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Generation of a password using urandom&lt;/h2&gt;
&lt;p&gt;The second command which we are using to generate a password has filtered /dev/urandom�output with�tr. This will allow us to delete all of the unwanted characters and then help us to print the first 14 characters only.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Create a password with urandom device&quot; class=&quot;aligncenter wp-image-585&quot; height=&quot;19&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 688px) 100vw, 688px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-315.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-315.png 688w, https://vitux.com/wp-content/uploads/2018/06/word-image-315-300x8.png 300w, https://vitux.com/wp-content/uploads/2018/06/word-image-315-642x19.png 642w&quot; width=&quot;688&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The output of the above command is as follows:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;urandom password&quot; class=&quot;aligncenter wp-image-586&quot; height=&quot;20&quot; loading=&quot;lazy&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-316.png&quot; width=&quot;224&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The output has allowed us to print the first 14 characters only by deleting all of the unwanted ones.&lt;/p&gt;
&lt;h2&gt;Generation of a password using pwgen&lt;/h2&gt;
&lt;p&gt;For using pwgen we need to install this tool first. This tool will help us generate some random yet meaningless passwords. Although the passwords generated by it are random still are pronounceable. So, we will now install the tool using the following command.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;install pwgen&quot; class=&quot;aligncenter wp-image-587&quot; height=&quot;22&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 529px) 100vw, 529px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-317.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-317.png 529w, https://vitux.com/wp-content/uploads/2018/06/word-image-317-300x12.png 300w&quot; width=&quot;529&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Enter the credentials as asked&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Enter password&quot; class=&quot;aligncenter wp-image-588&quot; height=&quot;26&quot; loading=&quot;lazy&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-318.png&quot; width=&quot;261&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The installation will eventually begin. The command line will look just like the screen below.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;pwgen gets installed&quot; class=&quot;aligncenter wp-image-589&quot; height=&quot;416&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 561px) 100vw, 561px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-319.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-319.png 561w, https://vitux.com/wp-content/uploads/2018/06/word-image-319-300x222.png 300w&quot; width=&quot;561&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Once the installation has been done, we will generate a random string having 14 characters in it.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Use pwgen to create a password&quot; class=&quot;aligncenter wp-image-590&quot; height=&quot;20&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 341px) 100vw, 341px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-320.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-320.png 341w, https://vitux.com/wp-content/uploads/2018/06/word-image-320-300x18.png 300w&quot; width=&quot;341&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The string we got randomly is this one.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;password&quot; class=&quot;aligncenter wp-image-591&quot; height=&quot;22&quot; loading=&quot;lazy&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-321.png&quot; width=&quot;183&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Generation of a password using gpg&lt;/h2&gt;
&lt;p&gt;Gpg can also be used to generate a strong password of 14 characters. The gpg tool uses the following command to generate the 14 characters.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Using gpg to create a random password&quot; class=&quot;aligncenter wp-image-592&quot; height=&quot;14&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 529px) 100vw, 529px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-322.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-322.png 529w, https://vitux.com/wp-content/uploads/2018/06/word-image-322-300x8.png 300w&quot; width=&quot;529&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The outcome of this command is&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;gpg result&quot; class=&quot;aligncenter wp-image-593&quot; height=&quot;109&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 700px) 100vw, 700px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-323.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-323.png 700w, https://vitux.com/wp-content/uploads/2018/06/word-image-323-300x47.png 300w&quot; width=&quot;700&quot;/&gt;&lt;/p&gt;
&lt;p&gt;And in the end, we have a password generated which is.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;The password&quot; class=&quot;aligncenter wp-image-594&quot; height=&quot;18&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 240px) 100vw, 240px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-324.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-324.png 240w, https://vitux.com/wp-content/uploads/2018/06/word-image-324-230x18.png 230w&quot; width=&quot;240&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Generation of a password using SHA&lt;/h2&gt;
&lt;p&gt;We will use SHA in this method, we can also hash the date. It runs through the base64. As a result, we get an output as the top of the 32 characters.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Use sha to create a password&quot; class=&quot;aligncenter wp-image-595&quot; height=&quot;23&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 689px) 100vw, 689px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-325.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-325.png 689w, https://vitux.com/wp-content/uploads/2018/06/word-image-325-300x10.png 300w&quot; width=&quot;689&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Here is the outcome containing the 32 characters yet a strong password to keep the system safe.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;The resulting password&quot; class=&quot;aligncenter wp-image-596&quot; height=&quot;18&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 338px) 100vw, 338px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-326.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-326.png 338w, https://vitux.com/wp-content/uploads/2018/06/word-image-326-300x16.png 300w&quot; width=&quot;338&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Generation of a password via an easy way&lt;/h2&gt;
&lt;p&gt;The generation of a password is quite easy using the command line. Although it is not random still it is useful if we utilize the whole password. The easiest command for this purpose is as follows:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;password string created with md5sum&quot; class=&quot;aligncenter wp-image-597&quot; height=&quot;22&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 377px) 100vw, 377px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-327.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-327.png 377w, https://vitux.com/wp-content/uploads/2018/06/word-image-327-300x18.png 300w&quot; width=&quot;377&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The outcome of the above command is a string as shown below.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;The md5sum password&quot; class=&quot;aligncenter wp-image-598&quot; height=&quot;23&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 384px) 100vw, 384px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-328.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-328.png 384w, https://vitux.com/wp-content/uploads/2018/06/word-image-328-300x18.png 300w&quot; width=&quot;384&quot;/&gt;&lt;/p&gt;
&lt;p&gt;And this command is very easy, and simple enough to remember.&lt;/p&gt;
&lt;h2&gt;Generation of a password using apg&lt;/h2&gt;
&lt;p&gt;APG is an Automatic Password Generator, it is already installed on all Ubuntu systems. It is also an easily used utility. It helps us generate various passwords that are random input.&lt;/p&gt;
&lt;p&gt;In order to generate entire random passwords, we can run�apg -a 1, which will give us the passwords with 8-10 random characters. The command we used for this purpose is apg �a 1. We will run and see various passwords generated in the output.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;random password from apg&quot; class=&quot;aligncenter wp-image-599&quot; height=&quot;21&quot; loading=&quot;lazy&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-329.png&quot; width=&quot;291&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The output has many random passwords.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;List of created passwords&quot; class=&quot;aligncenter wp-image-600&quot; height=&quot;125&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 336px) 100vw, 336px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-330.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-330.png 336w, https://vitux.com/wp-content/uploads/2018/06/word-image-330-300x112.png 300w&quot; width=&quot;336&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Generation of a password using makepasswd&lt;/h2&gt;
&lt;p&gt;�&lt;strong&gt;makepasswd&lt;/strong&gt;� can also be used to generate passwords. For using this utility, we install it at first. We will use the command�&lt;strong&gt;sudo apt-get install makepasswd. &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Install makepasswd&quot; class=&quot;aligncenter wp-image-601&quot; height=&quot;19&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 525px) 100vw, 525px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-331.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-331.png 525w, https://vitux.com/wp-content/uploads/2018/06/word-image-331-300x11.png 300w&quot; width=&quot;525&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Enter the required credentials.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Enter admin password&quot; class=&quot;aligncenter wp-image-602&quot; height=&quot;25&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 322px) 100vw, 322px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-332.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-332.png 322w, https://vitux.com/wp-content/uploads/2018/06/word-image-332-300x23.png 300w&quot; width=&quot;322&quot;/&gt;&lt;/p&gt;
&lt;p&gt;On writing the credentials, the installation will begin.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Installation of makepasswd&quot; class=&quot;aligncenter wp-image-603&quot; height=&quot;212&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 618px) 100vw, 618px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-333.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-333.png 618w, https://vitux.com/wp-content/uploads/2018/06/word-image-333-300x103.png 300w&quot; width=&quot;618&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Press Y to continue&lt;/p&gt;
&lt;p&gt;Once the utility has been installed, we will write the command which is &lt;strong&gt;makepasswd �count NumberOfPasswords �minchars MinLengthOfPassword&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;At first, we tell how many passwords we are aiming to generate and what must be the length of each of the password. Here we have asked to generate 4 passwords with length as eight for each of it.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Using makepasswd&quot; class=&quot;aligncenter wp-image-604&quot; height=&quot;21&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 478px) 100vw, 478px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-334.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-334.png 478w, https://vitux.com/wp-content/uploads/2018/06/word-image-334-300x13.png 300w&quot; width=&quot;478&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The outcome is shown below. We have a total of 4 passwords with 8 characters in each of them.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;List of created passwords&quot; class=&quot;aligncenter wp-image-605&quot; height=&quot;101&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 347px) 100vw, 347px&quot; src=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-335.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2018/06/word-image-335.png 347w, https://vitux.com/wp-content/uploads/2018/06/word-image-335-300x87.png 300w&quot; width=&quot;347&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The command is responsible for generating a list of random passwords based on the number of passwords we want to generate and the length is also defined by us.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In this tutorial, we have discussed many ways to generate passwords from the Linux command line. There are many methods that already exist. Some of the utilities are already present in the Linux command line, while the others are easy to install with the available commands. In this tutorial, we have discussed the utilities openssh, urandom, pwegn, gpg, sha, date, apg and makepasswd. All of these commands guarantee the generation of a stronger password from the Linux command line and are useful for users to ensure the security of their systems.&lt;/p&gt;
&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;8 Ways to Generate a Random Password on Linux Shell&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;

&lt;/article&gt;
&lt;span class=&quot;entry-title&quot;&gt;read coderpad profiles:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;http://www.lawrence.com/users/coderpad/&quot;&gt;http://www.lawrence.com/users/coderpad/&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;https://www.scribd.com/document/601722224/Coderpad&quot;&gt;https://www.scribd.com/document/601722224/Coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&quot;&gt;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://linktr.ee/coderpad&quot;&gt;https://linktr.ee/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.pearltrees.com/coderpad&quot;&gt;https://www.pearltrees.com/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.akonter.com/user/profile/coderpad&quot;&gt;https://www.akonter.com/user/profile/coderpad&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;</description><link>https://coderpad.blogspot.com/2022/11/8-ways-to-generate-random-password-on.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-8635198874457037315</guid><pubDate>Wed, 02 Nov 2022 15:08:00 +0000</pubDate><atom:updated>2022-11-02T08:08:42.712-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">How to keep Rocky Linux 8 up to date</category><title>How to keep Rocky Linux 8 up to date</title><description>&lt;article class=&quot;post-13265 post type-post status-publish format-standard has-post-thumbnail hentry category-centos category-linux category-shell&quot; id=&quot;post-13265&quot;&gt;
&lt;div class=&quot;entry-content clearfix&quot;&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;Rocky Linux Update&quot; class=&quot;alignnone size-full wp-image-19331&quot; height=&quot;512&quot; sizes=&quot;(max-width: 1024px) 100vw, 1024px&quot; src=&quot;https://vitux.com/wp-content/uploads/rocky-linux-update.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/rocky-linux-update.png 1024w, https://vitux.com/wp-content/uploads/rocky-linux-update-300x150.png 300w, https://vitux.com/wp-content/uploads/rocky-linux-update-768x384.png 768w&quot; width=&quot;1024&quot;/&gt;&lt;/p&gt;
&lt;p&gt;As a system administrator, it is your job to keep the system up to date with the latest packages to increase system stability and reduce security risks. If you haven�t configured your server to check for updates automatically, you�ll have to update them manually.&lt;/p&gt;
&lt;p&gt;In this tutorial, we�ll learn how to keep Rocky Linux 8 Server up to date. So, let�s get started.&lt;/p&gt;
&lt;h2&gt;&lt;strong&gt;Manual Rocky Linux update using dnf&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;To check if there is any update available for your installed packages, navigate to the terminal and type the following command.&lt;/p&gt;
&lt;pre&gt;# sudo dnf check-update&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;dnf check update&quot; class=&quot;wp-image-13266 aligncenter&quot; height=&quot;24&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 400px) 100vw, 400px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-410.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-410.png 400w, https://vitux.com/wp-content/uploads/word-image-410-300x18.png 300w&quot; width=&quot;400&quot;/&gt;&lt;/p&gt;
&lt;p&gt;If there is any update available, it will list down the updated available packages, update the single package, and use the following command.&lt;/p&gt;
&lt;pre&gt;# sudo dnf update httpd&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;update a single app&quot; class=&quot;wp-image-13267 aligncenter&quot; height=&quot;27&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 387px) 100vw, 387px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-411.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-411.png 387w, https://vitux.com/wp-content/uploads/word-image-411-300x21.png 300w&quot; width=&quot;387&quot;/&gt;&lt;/p&gt;
&lt;p&gt;To update the system development tools, use the following command.&lt;/p&gt;
&lt;pre&gt;# sudo dnf update &quot;Development Tools&quot;&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;update a group of apps&quot; class=&quot;wp-image-13268 aligncenter&quot; height=&quot;20&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 514px) 100vw, 514px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-412.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-412.png 514w, https://vitux.com/wp-content/uploads/word-image-412-300x12.png 300w&quot; width=&quot;514&quot;/&gt;&lt;/p&gt;
&lt;p&gt;To update all of your system packages at a time, execute the following command.&lt;/p&gt;
&lt;pre&gt;# sudo dnf update&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;update all packages using dnf command&quot; class=&quot;wp-image-13269 aligncenter&quot; height=&quot;31&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 336px) 100vw, 336px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-413.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-413.png 336w, https://vitux.com/wp-content/uploads/word-image-413-300x28.png 300w&quot; width=&quot;336&quot;/&gt;&lt;/p&gt;
&lt;p&gt;It�s a good practice to keep your software packages updated with the latest version to minimize the security risk.&lt;/p&gt;
&lt;h2&gt;Automatic Rocky Linux updates with dnf&lt;/h2&gt;
&lt;p&gt;It�s a difficult task for a system admin to check system updates manually daily, when you have a large number of Infrastructure you won�t be able to check one by one. To set the system updates automatically, install the following package using the following command.&lt;/p&gt;
&lt;pre&gt;# sudo dnf install dnf-automatic&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;automatic Rocky Linux updates with dnf-automatic&quot; class=&quot;wp-image-13270 aligncenter&quot; height=&quot;30&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 463px) 100vw, 463px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-414.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-414.png 463w, https://vitux.com/wp-content/uploads/word-image-414-300x19.png 300w&quot; width=&quot;463&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The Next step is to configure the automatic update, for this navigate to the dnf-automatic configuration file located at &lt;strong&gt;/etc/dnf/automatic.conf, &lt;/strong&gt;and set the values for update.&lt;/p&gt;
&lt;pre&gt;# sudo vim /etc/dnf/automatic.conf&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;dnf config&quot; class=&quot;wp-image-13271 aligncenter&quot; height=&quot;27&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 482px) 100vw, 482px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-415.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-415.png 482w, https://vitux.com/wp-content/uploads/word-image-415-300x17.png 300w&quot; width=&quot;482&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Set the &lt;strong&gt;download_updates&lt;/strong&gt; and &lt;strong&gt;apply_updates&lt;/strong&gt; parameters to &lt;strong&gt;YES, &lt;/strong&gt;so every time the new updates come, it will install and notify through an email.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Enable automatic updates&quot; class=&quot;aligncenter wp-image-13272&quot; height=&quot;326&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 680px) 100vw, 680px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-416.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-416.png 680w, https://vitux.com/wp-content/uploads/word-image-416-300x144.png 300w&quot; width=&quot;680&quot;/&gt;&lt;/p&gt;
&lt;p&gt;To set up an email notification, set the &lt;strong&gt;email_from&lt;/strong&gt; and &lt;strong&gt;email_to &lt;/strong&gt;parameters so it will notify you about the latest updates.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;update notice via email&quot; class=&quot;aligncenter wp-image-13273&quot; height=&quot;130&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 505px) 100vw, 505px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-417.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-417.png 505w, https://vitux.com/wp-content/uploads/word-image-417-300x77.png 300w&quot; width=&quot;505&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In this tutorial, we learned how to update a Rocky Linux 8 server with the latest software packages to reduce the security risk using automatically and manually.&lt;/p&gt;
&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;How to keep Rocky Linux 8 up to date&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;


&lt;/article&gt;
&lt;span class=&quot;entry-title&quot;&gt;read coderpad profiles:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;http://www.lawrence.com/users/coderpad/&quot;&gt;http://www.lawrence.com/users/coderpad/&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;https://www.scribd.com/document/601722224/Coderpad&quot;&gt;https://www.scribd.com/document/601722224/Coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&quot;&gt;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://linktr.ee/coderpad&quot;&gt;https://linktr.ee/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.pearltrees.com/coderpad&quot;&gt;https://www.pearltrees.com/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.akonter.com/user/profile/coderpad&quot;&gt;https://www.akonter.com/user/profile/coderpad&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;</description><link>https://coderpad.blogspot.com/2022/11/how-to-keep-rocky-linux-8-up-to-date.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-1671774584181882169</guid><pubDate>Wed, 02 Nov 2022 15:07:00 +0000</pubDate><atom:updated>2022-11-02T08:07:36.542-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CentOS 8 and Rocky Linux 8</category><category domain="http://www.blogger.com/atom/ns#">How to Install Postfix on AlmaLinux 8</category><title>How to Install Postfix on AlmaLinux 8, CentOS 8 and Rocky Linux 8</title><description>&lt;article class=&quot;post-14875 post type-post status-publish format-standard has-post-thumbnail hentry category-centos category-linux category-shell&quot; id=&quot;post-14875&quot;&gt;
&lt;div class=&quot;entry-content clearfix&quot;&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;Postfix on Linux&quot; class=&quot;alignnone size-full wp-image-19335&quot; height=&quot;512&quot; sizes=&quot;(max-width: 1024px) 100vw, 1024px&quot; src=&quot;https://vitux.com/wp-content/uploads/postfix-rhel-8.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/postfix-rhel-8.png 1024w, https://vitux.com/wp-content/uploads/postfix-rhel-8-300x150.png 300w, https://vitux.com/wp-content/uploads/postfix-rhel-8-768x384.png 768w&quot; width=&quot;1024&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Postfix is an efficient Mail Transfer Agent used for routing and sending receiving emails which is available as OpenSource software. It is the most well-known email server used in different Linux distributions. This is actually the replacement of an old Sendmail MTA that is pre-installed on the latest Rocky Linux versions as well. You may need to install the postfix mail server on your system. Today, we will explain the installation process of the postfix server on the Rocky Linux 8 system using the Terminal.&lt;/p&gt;
&lt;p&gt;All commands will run on the terminal application in this article. To access the terminal, click on the Activities option located at the top left corner of Rocky Linux 8 environment, and then click on the Terminal from the left pane of your desktop.&lt;/p&gt;
&lt;h2&gt;Installation of Postfix on Rocky Linux 8&lt;/h2&gt;
&lt;p&gt;To install the Postfix on Rocky Linux 8, you need to follow the following steps:&lt;/p&gt;
&lt;h2&gt;Remove Sendmail&lt;/h2&gt;
&lt;p&gt;First, you need to remove the Sendmail from your system. Therefore, you can easily check that Sendmail is pre-installed on your system or not by using the following command:&lt;/p&gt;
&lt;pre&gt;$ rpm -qa | grep sendmail&lt;/pre&gt;
&lt;p&gt;If it is already installed, then you will see the installed version will display on the terminal. Otherwise, it will show any output on the screen. In this situation, you can leave this step.&lt;/p&gt;
&lt;p&gt;You can remove the Sendmail by typing the following command on the terminal:&lt;/p&gt;
&lt;pre&gt;$ yum remove sendmail*&lt;/pre&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;pre&gt;$ dnf remove sendmail&lt;/pre&gt;
&lt;h2&gt;Update system&lt;/h2&gt;
&lt;p&gt;After removing the Sendmail, you will update your system by executing the following command:&lt;/p&gt;
&lt;pre&gt;$ dnf update&lt;/pre&gt;
&lt;h2&gt;Install Postfix&lt;/h2&gt;
&lt;p&gt;Once you verify that there is no other MTA is running on your system then, you will install the postfix server by typing the following command:&lt;/p&gt;
&lt;pre&gt;$ sudo dnf install postfix&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Install Postfix&quot; class=&quot;aligncenter wp-image-14876&quot; height=&quot;744&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1099px) 100vw, 1099px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1259.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1259.png 1099w, https://vitux.com/wp-content/uploads/word-image-1259-300x203.png 300w, https://vitux.com/wp-content/uploads/word-image-1259-1024x693.png 1024w, https://vitux.com/wp-content/uploads/word-image-1259-768x520.png 768w&quot; width=&quot;1099&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The confirmation prompt will interrupt the installation and ask for the confirmation to install the postfix server on the CentOS system. Press �y� in case of yes and then, hit �Enter� key to proceed with the further installation process.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Confirm installation&quot; class=&quot;aligncenter wp-image-14877&quot; height=&quot;744&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1098px) 100vw, 1098px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1260.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1260.png 1098w, https://vitux.com/wp-content/uploads/word-image-1260-300x203.png 300w, https://vitux.com/wp-content/uploads/word-image-1260-1024x694.png 1024w, https://vitux.com/wp-content/uploads/word-image-1260-768x520.png 768w&quot; width=&quot;1098&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Once the installation of the Postfix server is completed, you can verify that either it is now installed on your system or not by running the following command on the terminal:&lt;/p&gt;
&lt;pre&gt;$ rpm -qa|grep postfix&lt;/pre&gt;
&lt;p&gt;The following output should display on your system:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Check postfix version&quot; class=&quot;aligncenter wp-image-14878&quot; height=&quot;81&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1100px) 100vw, 1100px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1261.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1261.png 1100w, https://vitux.com/wp-content/uploads/word-image-1261-300x22.png 300w, https://vitux.com/wp-content/uploads/word-image-1261-1024x75.png 1024w, https://vitux.com/wp-content/uploads/word-image-1261-768x57.png 768w&quot; width=&quot;1100&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Enable Postfix Service&lt;/h2&gt;
&lt;p&gt;Now, the postfix server has been installed on your system. Enable and restart the Postfix services by running the below-mentioned commands:&lt;/p&gt;
&lt;pre&gt;$ systemctl enable postfix&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Enable Postfix&quot; class=&quot;aligncenter wp-image-14879&quot; height=&quot;498&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 747px) 100vw, 747px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1262.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1262.png 747w, https://vitux.com/wp-content/uploads/word-image-1262-300x200.png 300w&quot; width=&quot;747&quot;/&gt;&lt;/p&gt;
&lt;p&gt;After executing the above command, it will ask you to enter the login password for authentication. Enter the password and click on the �Authenticate� button. You will see the following output with symlink creation on the Terminal window:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Uses systemctl to enable postfix service&quot; class=&quot;aligncenter wp-image-14880&quot; height=&quot;109&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1236px) 100vw, 1236px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1263.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1263.png 1236w, https://vitux.com/wp-content/uploads/word-image-1263-300x26.png 300w, https://vitux.com/wp-content/uploads/word-image-1263-1024x90.png 1024w, https://vitux.com/wp-content/uploads/word-image-1263-768x68.png 768w&quot; width=&quot;1236&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Now, start the postfix services by running the following command:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Start postfix&quot; class=&quot;aligncenter wp-image-14881&quot; height=&quot;78&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 776px) 100vw, 776px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1264.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1264.png 776w, https://vitux.com/wp-content/uploads/word-image-1264-300x30.png 300w, https://vitux.com/wp-content/uploads/word-image-1264-768x77.png 768w&quot; width=&quot;776&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Again, you need to authenticate the user. Enter the password and then hit on the �Authenticate� button.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Authentcate yourself as admin user&quot; class=&quot;aligncenter wp-image-14882&quot; height=&quot;441&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 763px) 100vw, 763px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1265.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1265.png 763w, https://vitux.com/wp-content/uploads/word-image-1265-300x173.png 300w&quot; width=&quot;763&quot;/&gt;&lt;/p&gt;
&lt;p&gt;After that run the following command to check the postfix services status:&lt;/p&gt;
&lt;pre&gt;$ systemctl status postfix&lt;/pre&gt;
&lt;p&gt;The following output will show on the Terminal window:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Check postfix status&quot; class=&quot;aligncenter wp-image-14883&quot; height=&quot;511&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1236px) 100vw, 1236px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1266.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1266.png 1236w, https://vitux.com/wp-content/uploads/word-image-1266-300x124.png 300w, https://vitux.com/wp-content/uploads/word-image-1266-1024x423.png 1024w, https://vitux.com/wp-content/uploads/word-image-1266-768x318.png 768w&quot; width=&quot;1236&quot;/&gt;&lt;/p&gt;
&lt;p&gt;As you can see in the above image the Postfix services are running on this system.&lt;/p&gt;
&lt;p&gt;Next, configure the postfix mail server to send emails to your local server. To exit from the current window press �Ctrl + c�.&lt;/p&gt;
&lt;h2&gt;Install Email Client mailx&lt;/h2&gt;
&lt;p&gt;Before start the configuration of the postfix server, you need to first install mailx email client on the system by typing the following command:&lt;/p&gt;
&lt;pre&gt;$ sudo dnf install mailx&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Install mailx&quot; class=&quot;aligncenter wp-image-14884&quot; height=&quot;741&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1236px) 100vw, 1236px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1267.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1267.png 1236w, https://vitux.com/wp-content/uploads/word-image-1267-300x180.png 300w, https://vitux.com/wp-content/uploads/word-image-1267-1024x614.png 1024w, https://vitux.com/wp-content/uploads/word-image-1267-768x460.png 768w&quot; width=&quot;1236&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Confirm the installation of the mailx package by pressing �y� and then hit �Enter�. Now the installation of mailx will be started and once completed, you will be notified as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;proceed with the package installation&quot; class=&quot;aligncenter wp-image-14885&quot; height=&quot;745&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1239px) 100vw, 1239px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1268.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1268.png 1239w, https://vitux.com/wp-content/uploads/word-image-1268-300x180.png 300w, https://vitux.com/wp-content/uploads/word-image-1268-1024x616.png 1024w, https://vitux.com/wp-content/uploads/word-image-1268-768x462.png 768w&quot; width=&quot;1239&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Now, you can easily send emails to your local email server. For example, we are sending an email subject test mail to the recipient admin. For this purpose, we have typed the below-mentioned command on the Terminal:&lt;/p&gt;
&lt;pre&gt;$ mail kbuzdar&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;send an email&quot; class=&quot;aligncenter wp-image-14886&quot; height=&quot;192&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1257px) 100vw, 1257px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1269.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1269.png 1257w, https://vitux.com/wp-content/uploads/word-image-1269-300x46.png 300w, https://vitux.com/wp-content/uploads/word-image-1269-1024x156.png 1024w, https://vitux.com/wp-content/uploads/word-image-1269-768x117.png 768w&quot; width=&quot;1257&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The term �mail� in the above command is referring to a client and the recipient is �kbuzdar� here. The �.� sign at the end of the emails sends the signal to the mail client that the email is ended now. Now, it will be sent to the postfix server for email delivery.&lt;/p&gt;
&lt;p&gt;To check whether the email reached its destination or not, log in as the root user from the recipient side, and then write �mail� on the Terminal.&lt;/p&gt;
&lt;p&gt;# mail&lt;/p&gt;
&lt;p&gt;The following list of emails will display on the terminal including the last email that you have sent will show at the end.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Email successfully delivered&quot; class=&quot;aligncenter wp-image-14887&quot; height=&quot;250&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1242px) 100vw, 1242px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1270.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1270.png 1242w, https://vitux.com/wp-content/uploads/word-image-1270-300x60.png 300w, https://vitux.com/wp-content/uploads/word-image-1270-1024x206.png 1024w, https://vitux.com/wp-content/uploads/word-image-1270-768x155.png 768w&quot; width=&quot;1242&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;That�s all about the Postfix server installation on Rocky Linux 8 using the command line. Moreover, you have seen how to send emails to the local server via the Postfix services. You can send emails to a particular domain by changing the name of your machine. I hope you liked this article and it may help you in the future.&lt;/p&gt;
&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;How to Install Postfix on AlmaLinux 8, CentOS 8 and Rocky Linux 8&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;

&lt;/article&gt;
&lt;span class=&quot;entry-title&quot;&gt;read coderpad profiles:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;http://www.lawrence.com/users/coderpad/&quot;&gt;http://www.lawrence.com/users/coderpad/&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;https://www.scribd.com/document/601722224/Coderpad&quot;&gt;https://www.scribd.com/document/601722224/Coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&quot;&gt;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://linktr.ee/coderpad&quot;&gt;https://linktr.ee/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.pearltrees.com/coderpad&quot;&gt;https://www.pearltrees.com/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.akonter.com/user/profile/coderpad&quot;&gt;https://www.akonter.com/user/profile/coderpad&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;</description><link>https://coderpad.blogspot.com/2022/11/how-to-install-postfix-on-almalinux-8.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-4516940497697027939</guid><pubDate>Wed, 02 Nov 2022 15:06:00 +0000</pubDate><atom:updated>2022-11-02T08:06:37.352-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">How to Change the Keyboard Layout in Debian Desktop</category><title>How to Change the Keyboard Layout in Debian Desktop</title><description>&lt;article class=&quot;post-9514 post type-post status-publish format-standard has-post-thumbnail hentry category-debian category-linux category-shell&quot; id=&quot;post-9514&quot;&gt;
&lt;div class=&quot;entry-content clearfix&quot;&gt;
&lt;p&gt;The keyboard in Linux operating system comes in a variety of layouts for different languages. Even for a single language, there are several layouts. When using our systems, many of us like to use our native language as the main input language. The Debian operating system allows us to add any language as the primary input language and set it as the default language. It also allows us to add multiple keyboard layouts and switch between them whenever we want.&lt;/p&gt;
&lt;p&gt;In this tutorial, we will explain step by step how you can change the keyboard layout in your Debian system to match your desired input language.&lt;/p&gt;
&lt;p&gt;We have used GNOME Desktop on Debian to execute the commands and procedures mentioned in this article. This has been tested on Debian 10 and Debian 11.&lt;/p&gt;
&lt;h2&gt;Add Keyboard Layout language as Input Resource&lt;/h2&gt;
&lt;p&gt;We can change the keyboard layout from the Linux Settings utility. Settings utility can be opened via the following method:&lt;/p&gt;
&lt;p&gt;Click the downward arrow at the top right corner of your Debian desktop. From the menu that appears, click the System settings icon as shown in the following screenshot.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Settings Icon&quot; class=&quot;aligncenter wp-image-9515&quot; height=&quot;283&quot; sizes=&quot;(max-width: 335px) 100vw, 335px&quot; src=&quot;https://vitux.com/wp-content/uploads/2019/12/word-image-171.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2019/12/word-image-171.png 388w, https://vitux.com/wp-content/uploads/2019/12/word-image-171-300x254.png 300w&quot; width=&quot;335&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Alternatively, you can open settings utility by searching it from the Application�s menu.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Desktop Settings&quot; class=&quot;aligncenter wp-image-9516&quot; height=&quot;181&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 504px) 100vw, 504px&quot; src=&quot;https://vitux.com/wp-content/uploads/2019/12/word-image-172.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2019/12/word-image-172.png 741w, https://vitux.com/wp-content/uploads/2019/12/word-image-172-300x108.png 300w&quot; width=&quot;504&quot;/&gt;&lt;/p&gt;
&lt;p&gt;When the Settings window opens, go to the&lt;strong&gt; Region &amp;amp; Language&lt;/strong&gt; tab. Then on the corresponding right pane, click the &lt;strong&gt;+&lt;/strong&gt; button under &lt;strong&gt;Input Sources&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Region and Language&quot; class=&quot;aligncenter wp-image-9517&quot; height=&quot;287&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 678px) 100vw, 678px&quot; src=&quot;https://vitux.com/wp-content/uploads/2019/12/word-image-173.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2019/12/word-image-173.png 968w, https://vitux.com/wp-content/uploads/2019/12/word-image-173-300x127.png 300w, https://vitux.com/wp-content/uploads/2019/12/word-image-173-768x325.png 768w&quot; width=&quot;678&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Then from the &lt;strong&gt;Add an Input Source&lt;/strong&gt; dialog box, select the language you want to add as an input source and then click &lt;strong&gt;Add&lt;/strong&gt; button.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Add an Input Source&quot; class=&quot;aligncenter wp-image-9518&quot; height=&quot;353&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 614px) 100vw, 614px&quot; src=&quot;https://vitux.com/wp-content/uploads/2019/12/word-image-174.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2019/12/word-image-174.png 720w, https://vitux.com/wp-content/uploads/2019/12/word-image-174-300x173.png 300w&quot; width=&quot;614&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Now your selected language will be shown under the Input Sources as a new keyboard layout.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Input Sources&quot; class=&quot;aligncenter wp-image-9519&quot; height=&quot;312&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 648px) 100vw, 648px&quot; src=&quot;https://vitux.com/wp-content/uploads/2019/12/word-image-175.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2019/12/word-image-175.png 970w, https://vitux.com/wp-content/uploads/2019/12/word-image-175-300x144.png 300w, https://vitux.com/wp-content/uploads/2019/12/word-image-175-768x370.png 768w&quot; width=&quot;648&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Under the list of &lt;strong&gt;Input Sources&lt;/strong&gt;, you will see the up and down arrows. Using these arrows, you can set any language as a default layout. The one at the top of the list will be used as a default and primary keyboard layout.&lt;/p&gt;
&lt;h2&gt;Switch between Keyboard Layouts&lt;/h2&gt;
&lt;p&gt;After adding a keyboard layout, you will now see the keyboard selection icon at the top right corner of the desktop. When you click the downward arrow in front of it, a drop-down menu will appear allowing you to select the keyboard layout.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Show Keyboard Layout&quot; class=&quot;aligncenter wp-image-9520&quot; height=&quot;246&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 379px) 100vw, 379px&quot; src=&quot;https://vitux.com/wp-content/uploads/2019/12/word-image-176.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2019/12/word-image-176.png 379w, https://vitux.com/wp-content/uploads/2019/12/word-image-176-300x195.png 300w&quot; width=&quot;379&quot;/&gt;&lt;/p&gt;
&lt;p&gt;An alternative and the quickest way to switch between the keyboard layouts is by using the keyboard shortcut that is &lt;strong&gt;Super key+ Space key&lt;/strong&gt;. This is the default keyboard shortcut for switching between keyboard layouts. However, you can also change this shortcut from the keyboard settings.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Language switcher&quot; class=&quot;aligncenter wp-image-9521&quot; height=&quot;172&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 316px) 100vw, 316px&quot; src=&quot;https://vitux.com/wp-content/uploads/2019/12/word-image-177.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2019/12/word-image-177.png 316w, https://vitux.com/wp-content/uploads/2019/12/word-image-177-300x163.png 300w&quot; width=&quot;316&quot;/&gt;&lt;/p&gt;
&lt;p&gt;In this article, you have learned how to change the keyboard layout in a Debian OS. Now you are able to choose and set your preferred input language for the default keyboard layout.&lt;/p&gt;
&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;How to Change the Keyboard Layout in Debian Desktop&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;

&lt;/article&gt;
&lt;span class=&quot;entry-title&quot;&gt;read coderpad profiles:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;http://www.lawrence.com/users/coderpad/&quot;&gt;http://www.lawrence.com/users/coderpad/&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;https://www.scribd.com/document/601722224/Coderpad&quot;&gt;https://www.scribd.com/document/601722224/Coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&quot;&gt;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://linktr.ee/coderpad&quot;&gt;https://linktr.ee/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.pearltrees.com/coderpad&quot;&gt;https://www.pearltrees.com/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.akonter.com/user/profile/coderpad&quot;&gt;https://www.akonter.com/user/profile/coderpad&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;</description><link>https://coderpad.blogspot.com/2022/11/how-to-change-keyboard-layout-in-debian.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-6397418857723722804</guid><pubDate>Wed, 02 Nov 2022 15:05:00 +0000</pubDate><atom:updated>2022-11-02T08:05:55.057-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">&gt;How to Mount NFS on Debian 11</category><title>How to Mount NFS on Debian 11</title><description>&lt;article class=&quot;post-14440 post type-post status-publish format-standard has-post-thumbnail hentry category-debian category-linux category-shell&quot; id=&quot;post-14440&quot;&gt;
&lt;div class=&quot;entry-content clearfix&quot;&gt;
&lt;p&gt;With NFS (Network File System), you can share files and folders with other systems in a network. NFS is based on a client-server architecture that allows users to remotely connect and access files through the network. With NFS, users can access shared files and folders as if they exist in their own system.&lt;/p&gt;
&lt;p&gt;In this article, we will be discussing how to mount NFS on Debian 11 system. We will cover:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Mounting the NFS file system manually&lt;/li&gt;
&lt;li&gt;Mounting the NFS file system automatically&lt;/li&gt;
&lt;li&gt;Unmounting the NFS file system&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We have used Debian 11 machine for explaining the commands and procedures mentioned in this article. More or less the same procedure can be followed in Ubuntu and older Debian distributions.&lt;/p&gt;
&lt;p&gt;We will run the commands on Debian Terminal. To open the Terminal, hit the super key on your keyboard and search for it using the search bar that appears. From the results, click the Terminal application to open it.&lt;/p&gt;
&lt;p&gt;If you do not have an NFS server yet, see here how to configure &lt;a href=&quot;https://vitux.com/debian_nfs_server/&quot;&gt;NFS server on Debian&lt;/a&gt; and &lt;a href=&quot;https://vitux.com/install-nfs-server-and-client-on-ubuntu/&quot;&gt;NFS server on Ubuntu&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;For the client machine:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Debian 11 or Debian 10&lt;/li&gt;
&lt;li&gt;User with sudo privileges&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For the remote server:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;NFS server is installed&lt;/li&gt;
&lt;li&gt;NFS server shared directory is exported&lt;/li&gt;
&lt;li&gt;NFS clients are allowed through the firewall&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once you have the above prerequisites completed, you can follow the below procedures in order to mount NFS on the client machine.&lt;/p&gt;
&lt;h2&gt;Install NFS Client Package on the client machine&lt;/h2&gt;
&lt;p&gt;You will need to install the NFS client package on the client machine in order to mount share directories on it. To install the NFS client package on the client computer, run the following commands in the Terminal:&lt;/p&gt;
&lt;pre&gt;$ sudo apt install nfs-common&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Install NFS package&quot; class=&quot;aligncenter wp-image-14441&quot; height=&quot;460&quot; sizes=&quot;(max-width: 938px) 100vw, 938px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1008.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1008.png 938w, https://vitux.com/wp-content/uploads/word-image-1008-300x147.png 300w, https://vitux.com/wp-content/uploads/word-image-1008-768x377.png 768w&quot; width=&quot;938&quot;/&gt;&lt;/p&gt;
&lt;p&gt;After running the above command, the system might ask for confirmation if you want to continue the installation or not. Press y to continue, after that, the NFS client package will be installed on your system.&lt;/p&gt;
&lt;h2&gt;Step 1: Create a mount point for the shared directory of NFS server�s&lt;/h2&gt;
&lt;p&gt;You will need to create an empty directory for the mount points on the client machine. This empty directory will act as the mount point for the folders shared remotely.&lt;/p&gt;
&lt;p&gt;Under the directory /mnt, we created a new mount folder �client_sharedfolder� using the below command:&lt;/p&gt;
&lt;pre&gt;$ sudo mkdir -p /mnt/client_ shareddirectory&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Create a shared folder&quot; class=&quot;aligncenter wp-image-14442&quot; height=&quot;29&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 721px) 100vw, 721px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1009.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1009.png 721w, https://vitux.com/wp-content/uploads/word-image-1009-300x12.png 300w&quot; width=&quot;721&quot;/&gt;&lt;/p&gt;
&lt;h3&gt;Step 2: Mount the NFS server shared folder on the client&lt;/h3&gt;
&lt;p&gt;Use the following syntax to mount the shared NFS folder into the client�s mount point directory.&lt;/p&gt;
&lt;pre&gt;$ sudo mount [nfs_server]:/[nfs_shareddirectory] [client_mountpoint]&lt;/pre&gt;
&lt;p&gt;Where&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;[nfs_server] is the NFS server�s IP address which you can find by running the �&lt;em&gt;$ ip a�&lt;/em&gt; command on the NFS server.&lt;/li&gt;
&lt;li&gt;[nfs_ shareddirectory] is the shared folder on the NFS server&lt;/li&gt;
&lt;li&gt;[client_mountpoint] is the mount point folder on the client�s machine&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=&quot;Manually mount NFS share&quot; class=&quot;aligncenter wp-image-14443&quot; height=&quot;52&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1090px) 100vw, 1090px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1010.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1010.png 1090w, https://vitux.com/wp-content/uploads/word-image-1010-300x14.png 300w, https://vitux.com/wp-content/uploads/word-image-1010-1024x49.png 1024w, https://vitux.com/wp-content/uploads/word-image-1010-768x37.png 768w&quot; width=&quot;1090&quot;/&gt;&lt;/p&gt;
&lt;p&gt;From the above screenshot, you can see that 192.168.72.144 is the IP address of the NFS server. The /mnt/sharedfolder is the shared folder on the NFS server and the /mnt/client_sharedfolder is the mount point folder on the client�s machine.&lt;/p&gt;
&lt;p&gt;Once you have mounted the NFS server shared folder on the client machine, you can verify it. Issue the following command in Terminal to do so:&lt;/p&gt;
&lt;pre&gt;$ df -h&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;NFS share mounted successfully&quot; class=&quot;aligncenter wp-image-14444&quot; height=&quot;369&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 976px) 100vw, 976px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1011.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1011.png 976w, https://vitux.com/wp-content/uploads/word-image-1011-300x113.png 300w, https://vitux.com/wp-content/uploads/word-image-1011-768x290.png 768w&quot; width=&quot;976&quot;/&gt;&lt;/p&gt;
&lt;p&gt;From the above screenshot, you can see the shared folder mounted on the client�s machine mount point.&lt;/p&gt;
&lt;h2&gt;Step 3: Verify NFS share&lt;/h2&gt;
&lt;p&gt;Once the NFS server share is mounted on the NFS client, try to access some files located on the server machine. Create any test file or directory on the NFS server computer, and try to access it from the client system.&lt;/p&gt;
&lt;p&gt;In the NFS server machine, move inside the shared folder and create some files or folders.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Go to shared folder&quot; class=&quot;aligncenter wp-image-14445&quot; height=&quot;54&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 796px) 100vw, 796px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1012.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1012.png 796w, https://vitux.com/wp-content/uploads/word-image-1012-300x20.png 300w, https://vitux.com/wp-content/uploads/word-image-1012-768x52.png 768w&quot; width=&quot;796&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Now in the client machine, issue the following command to check if these files exist:&lt;/p&gt;
&lt;pre&gt;$ ls /mnt/client_sharedfolder/&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Content of shared NFS folder&quot; class=&quot;aligncenter wp-image-14446&quot; height=&quot;74&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 620px) 100vw, 620px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1013.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1013.png 620w, https://vitux.com/wp-content/uploads/word-image-1013-300x36.png 300w&quot; width=&quot;620&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The method we have discussed above only mounts the file system temporarily on the client�s system. After you restart the system, the NFS file system will no longer remain mounted on the system.&lt;/p&gt;
&lt;h2&gt;Mount an NFS File System automatically&lt;/h2&gt;
&lt;p&gt;You also have the option to automatically mount the file system. It saves you from the hassle of mounting the file system manually every time the machine is restarted. For this purpose, you will need to edit the /etc/fstab file. Issue the following command in Terminal in order to do so:&lt;/p&gt;
&lt;pre&gt;$ sudo nano /etc/fstab&lt;/pre&gt;
&lt;p&gt;Then insert an entry in this file using the below syntax:&lt;/p&gt;
&lt;pre&gt;[nfs_server]: [nfs_shareddirectory] [client_mountpoint] nfs defaults 0 0&lt;/pre&gt;
&lt;p&gt;Where:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;[nfs_server] is the NFS server�s IP address&lt;/li&gt;
&lt;li&gt;[nfs_shareddirectory] is the shared folder on the NFS server&lt;/li&gt;
&lt;li&gt;[client_mountpoint] is the mount point on the client�s machine&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;nfs &lt;/strong&gt;is the file system type.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=&quot;Permanently mount nfs drive&quot; class=&quot;aligncenter wp-image-14447&quot; height=&quot;405&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 942px) 100vw, 942px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1014.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1014.png 942w, https://vitux.com/wp-content/uploads/word-image-1014-300x129.png 300w, https://vitux.com/wp-content/uploads/word-image-1014-768x330.png 768w&quot; width=&quot;942&quot;/&gt;&lt;/p&gt;
&lt;p&gt;From the above screenshot, you can see that the 192.168.72.144 is the IP address of the NFS server, /mnt/sharedfolder is the shared folder on the NFS server and the /mnt/client_sharedfolder is the mount point on the client�s machine.&lt;/p&gt;
&lt;p&gt;Once you have done with the above configurations, save, and close the /etc/fstab file. Now when you will restart the system, the NFS file system will be automatically mounted at the specified mount point.&lt;/p&gt;
&lt;h2&gt;Unmount the NFS File System&lt;/h2&gt;
&lt;p&gt;If you do not want the NFS file system to remain mounted anymore, you can unmount it from the client�s machine. To do so, issue the following command in Terminal:&lt;/p&gt;
&lt;pre&gt;$ sudo umount [mountpoint_name]&lt;/pre&gt;
&lt;p&gt;Replace the [mountpoint_name] by the actual name of your mount point folder.&lt;/p&gt;
&lt;p&gt;Note: Mounting the NFS files system using the /etc/fstab file automatically mounts the file system to the specified mount point on the next restart even if you unmount it using the umount command.&lt;/p&gt;
&lt;p&gt;Mounting the NFS file system on Linux is an easy task for storing and accessing the files through the network. In this article, you have learned about mounting and unmounting the NFS file system on the Debian 11 machine. I hope it will be helpful if you ever need to mount or mount the NFS file system on any Debian or Ubuntu machines.&lt;/p&gt;
&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;How to Mount NFS on Debian 11&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;

&lt;/article&gt;
&lt;span class=&quot;entry-title&quot;&gt;read coderpad profiles:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;http://www.lawrence.com/users/coderpad/&quot;&gt;http://www.lawrence.com/users/coderpad/&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;https://www.scribd.com/document/601722224/Coderpad&quot;&gt;https://www.scribd.com/document/601722224/Coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&quot;&gt;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://linktr.ee/coderpad&quot;&gt;https://linktr.ee/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.pearltrees.com/coderpad&quot;&gt;https://www.pearltrees.com/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.akonter.com/user/profile/coderpad&quot;&gt;https://www.akonter.com/user/profile/coderpad&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;</description><link>https://coderpad.blogspot.com/2022/11/how-to-mount-nfs-on-debian-11.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-2723834943217893265</guid><pubDate>Wed, 02 Nov 2022 15:01:00 +0000</pubDate><atom:updated>2022-11-02T08:01:23.119-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">How to Install Debian on Virtual Box</category><title>How to Install Debian on Virtual Box</title><description>&lt;article class=&quot;post-15239 post type-post status-publish format-standard has-post-thumbnail hentry category-debian category-linux&quot; id=&quot;post-15239&quot;&gt;
&lt;div class=&quot;entry-content clearfix&quot;&gt;
&lt;p&gt;The document will show you the step-by-step installation process of &lt;strong&gt;Debian&lt;/strong&gt; 10 on &lt;strong&gt;Virtual Box&lt;/strong&gt;. Virtual box is greatly recommended for IT users, students, and even professionals who have to work on multiple operating systems at once. Instead of installing different operating systems on your machine according to work requirements which involve complex setup process, frequent restarting of PC, data overwriting, and infected disk space. Therefore it is &lt;strong&gt;highly recommended&lt;/strong&gt; to have &lt;strong&gt;Virtual Box Software&lt;/strong&gt; in your machines that enables to you create as many VMs as you want according to work/task specifications.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Debian 10&lt;/strong&gt; is &lt;strong&gt;Linux operating system distribution&lt;/strong&gt;, which is &lt;strong&gt;free&lt;/strong&gt; and &lt;strong&gt;open-source software&lt;/strong&gt;. Also, Debian 10 has further extended versions of it.&lt;/p&gt;
&lt;h2&gt;Prerequisites for installing Debian on Virtual Box&lt;/h2&gt;
&lt;p&gt;For installing Debian 10, you need to complete the following prerequisites of the process:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Internet connectivity.&lt;/li&gt;
&lt;li&gt;Installed Virtual Box version 6.1.12 on your machine.&lt;/li&gt;
&lt;li&gt;At least 8GB of RAM on your machine.&lt;/li&gt;
&lt;li&gt;At least 20GB of free disk space on your machine.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Installing Debian&lt;/h2&gt;
&lt;p&gt;For installing Debian 10 on Virtual Box version 6.1.12, you need to follow the following steps in order:&lt;/p&gt;
&lt;h3&gt;Step 01: Open the Oracle VM Virtual Box software&lt;/h3&gt;
&lt;p&gt;After opening the Virtual Box, go to the top left corner and&lt;strong&gt; click on the new button to create a&lt;/strong&gt; &lt;strong&gt;new VM&lt;/strong&gt;, as shown in the below image.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15240 aligncenter&quot; height=&quot;308&quot; sizes=&quot;(max-width: 765px) 100vw, 765px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1477.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1477.png 765w, https://vitux.com/wp-content/uploads/word-image-1477-300x121.png 300w&quot; width=&quot;765&quot;/&gt;&lt;/p&gt;
&lt;h3&gt;Step 02: Enter the VM name and the required version&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Whenever you create a new VM, choose a relevant and significant name for it. Since &lt;strong&gt;this guide is for installing Debian 10 on Virtual Box 6.1.12, that is why I write Debian 10 in the name field&lt;/strong&gt;, &lt;strong&gt;the user can choose or keep any name of his/her choice &lt;/strong&gt;(look at the highlighted first column in the image attached below). Let�s suppose, if the user is creating the VM for Debian version 10.5, he/she can keep the name as Debian10.5 too, depending upon his/her choice.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;As Debian 10 is Linux operating system distribution, make sure the �Type� is set automatically to Linux as you enter the VM name in the name field&lt;/strong&gt; as highlighted in the third column in the below image.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;version field&lt;/strong&gt;, &lt;strong&gt;two versions&lt;/strong&gt; are given for &lt;strong&gt;32-bit and 64-bit operating systems&lt;/strong&gt;. &lt;strong&gt;With the 32-bit version&lt;/strong&gt;, the user will be able to set the&lt;strong&gt; RAM/Memory size for his VM limited to 4GB.&lt;/strong&gt; Whereas, &lt;strong&gt;with the 64-bit version&lt;/strong&gt;, the user can be able to set up&lt;strong&gt; 16 Exa-Bytes of RAM/Memory size&lt;/strong&gt; for his VM. The user can choose anyone of both concerning his system specifications. In the particular case, I am going to choose the 64-bit in the version field as highlighted in the fourth column of the attached image.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15241 aligncenter&quot; height=&quot;480&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 510px) 100vw, 510px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1478.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1478.png 510w, https://vitux.com/wp-content/uploads/word-image-1478-300x282.png 300w&quot; width=&quot;510&quot;/&gt;&lt;/p&gt;
&lt;h3&gt;Step 03: Set the memory size/RAM&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;For creating a virtual machine, the &lt;strong&gt;upper limit of memory size is 16384MB(16.384GB)&lt;/strong&gt; and the&lt;strong&gt; lower limit is 4MB(0.004 GB)&lt;/strong&gt;. The &lt;strong&gt;user can select any memory size in this range&lt;/strong&gt; keeping in mind his system specifications ( precisely his system RAM size).&lt;/li&gt;
&lt;li&gt;For this particular guide, I am setting the memory size as &lt;strong&gt;4096 MB&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;After setting the memory size, click the&lt;strong&gt; Next button&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15242 aligncenter&quot; height=&quot;714&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 716px) 100vw, 716px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1479.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1479.png 716w, https://vitux.com/wp-content/uploads/word-image-1479-300x300.png 300w, https://vitux.com/wp-content/uploads/word-image-1479-150x150.png 150w, https://vitux.com/wp-content/uploads/word-image-1479-270x270.png 270w, https://vitux.com/wp-content/uploads/word-image-1479-230x230.png 230w&quot; width=&quot;716&quot;/&gt;&lt;/p&gt;
&lt;h3&gt;Step 04: Create hard disk for VM&lt;/h3&gt;
&lt;p&gt;Mark the second option: &lt;strong&gt;create virtual hard disk now&lt;/strong&gt; and click the &lt;strong&gt;Create button&lt;/strong&gt;, for creating a virtual hard disk for Debian 10.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15243 aligncenter&quot; height=&quot;700&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 704px) 100vw, 704px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1480.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1480.png 704w, https://vitux.com/wp-content/uploads/word-image-1480-300x298.png 300w, https://vitux.com/wp-content/uploads/word-image-1480-150x150.png 150w, https://vitux.com/wp-content/uploads/word-image-1480-230x230.png 230w&quot; width=&quot;704&quot;/&gt;&lt;/p&gt;
&lt;h3&gt;Step 05: Set hard disk file type&lt;/h3&gt;
&lt;p&gt;Mark the first option&lt;strong&gt; VDI (VirtualBox Disk Image) &lt;/strong&gt;and click the &lt;strong&gt;Next button&lt;/strong&gt;. It will set the hard disk file type as VDI.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15244 aligncenter&quot; height=&quot;724&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 712px) 100vw, 712px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1481.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1481.png 712w, https://vitux.com/wp-content/uploads/word-image-1481-295x300.png 295w&quot; width=&quot;712&quot;/&gt;&lt;/p&gt;
&lt;h3&gt;Step 06: Set the storage type for the hard disk&lt;/h3&gt;
&lt;p&gt;Mark the option named as &lt;strong&gt;fixed size&lt;/strong&gt; and click the &lt;strong&gt;Next button&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15245 aligncenter&quot; height=&quot;716&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 702px) 100vw, 702px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1482.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1482.png 702w, https://vitux.com/wp-content/uploads/word-image-1482-294x300.png 294w&quot; width=&quot;702&quot;/&gt;&lt;/p&gt;
&lt;h3&gt;Step 07: Select the file location and size for VM hard disk&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;To avoid the exhaustive file and data searching later. Keep the &lt;strong&gt;default file location&lt;/strong&gt;, though you can change the file location as per your desire.&lt;/li&gt;
&lt;li&gt;For creating a virtual machine, the &lt;strong&gt;upper limit of size for a virtual hard disk file is 20TB.&lt;/strong&gt; and the&lt;strong&gt; lower limit is 4MB&lt;/strong&gt;. The &lt;strong&gt;user can select any file size in this range&lt;/strong&gt; keeping in mind the&lt;strong&gt; prerequisite&lt;/strong&gt; for a particular installation i.e there should be &lt;strong&gt;at least 20GB of free disk space on his machine. &lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;For this particular guide, I am setting the memory size as &lt;strong&gt;20GB(20,000MB) according to free hard disk space on my system.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;After setting the hard disk file size, click the&lt;strong&gt; Create button.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15246 aligncenter&quot; height=&quot;722&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 700px) 100vw, 700px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1483.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1483.png 700w, https://vitux.com/wp-content/uploads/word-image-1483-291x300.png 291w&quot; width=&quot;700&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Clicking the create button, will start creating the fixed medium storage unit, as shown in the below image.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15247 aligncenter&quot; height=&quot;186&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 650px) 100vw, 650px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1484.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1484.png 650w, https://vitux.com/wp-content/uploads/word-image-1484-300x86.png 300w&quot; width=&quot;650&quot;/&gt;&lt;/p&gt;
&lt;h3&gt;Step 08: Add the ISO file for Debian 10&lt;/h3&gt;
&lt;p&gt;Before moving ahead, first, you need to download Debian 10 ISO Image. You can download it from its official website &lt;a href=&quot;https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/&quot;&gt;https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/&lt;/a&gt;. From this website, you can download ISO image with concern to your Desktop environment (cinnamon, gnome, KDE, and more). In this documentation, I will prefer cinnamon. Click on the link for downloading the ISO file for cinnamon as highlighted in the below image.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15248 aligncenter&quot; height=&quot;608&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1348px) 100vw, 1348px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1485.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1485.png 1348w, https://vitux.com/wp-content/uploads/word-image-1485-300x135.png 300w, https://vitux.com/wp-content/uploads/word-image-1485-1024x462.png 1024w, https://vitux.com/wp-content/uploads/word-image-1485-768x346.png 768w&quot; width=&quot;1348&quot;/&gt;&lt;/p&gt;
&lt;p&gt;After creating the virtual hard disk for VM:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Go to the left corner.&lt;/li&gt;
&lt;li&gt;Click the right button on the Debian10 field.&lt;/li&gt;
&lt;li&gt;Click the settings button.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15249 aligncenter&quot; height=&quot;716&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1366px) 100vw, 1366px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1486.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1486.png 1366w, https://vitux.com/wp-content/uploads/word-image-1486-300x157.png 300w, https://vitux.com/wp-content/uploads/word-image-1486-1024x537.png 1024w, https://vitux.com/wp-content/uploads/word-image-1486-768x403.png 768w&quot; width=&quot;1366&quot;/&gt;&lt;/p&gt;
&lt;p&gt;After going into the settings:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Click the &lt;strong&gt;Storage&lt;/strong&gt; on the left side.&lt;/li&gt;
&lt;li&gt;Select&lt;strong&gt; Empty&lt;/strong&gt; under the Storage Devices field.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt; Storage Devices �&amp;gt; Controller: IDE �&amp;gt; Empty&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Click on the &lt;strong&gt;CD/DVD icon&lt;/strong&gt; and select &lt;strong&gt;Choose/Create a Virtual Optical Disk.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Ok&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15250 aligncenter&quot; height=&quot;716&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1366px) 100vw, 1366px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1487.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1487.png 1366w, https://vitux.com/wp-content/uploads/word-image-1487-300x157.png 300w, https://vitux.com/wp-content/uploads/word-image-1487-1024x537.png 1024w, https://vitux.com/wp-content/uploads/word-image-1487-768x403.png 768w&quot; width=&quot;1366&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Clicking the Ok button will show a Dialogue box. Follow the following bullets highlighted in the below-attached images as well:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Click on the &lt;strong&gt;Add &lt;/strong&gt;button.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15251 aligncenter&quot; height=&quot;700&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 672px) 100vw, 672px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1488.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1488.png 672w, https://vitux.com/wp-content/uploads/word-image-1488-288x300.png 288w&quot; width=&quot;672&quot;/&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Select the &lt;strong&gt;Debian 10 ISO file from your downloads&lt;/strong&gt; and click on the &lt;strong&gt;Open&lt;/strong&gt; button.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15252 aligncenter&quot; height=&quot;718&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 698px) 100vw, 698px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1489.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1489.png 698w, https://vitux.com/wp-content/uploads/word-image-1489-292x300.png 292w&quot; width=&quot;698&quot;/&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Select the&lt;strong&gt; ISO file for Debian 10&lt;/strong&gt; and click on the&lt;strong&gt; Choose&lt;/strong&gt; button.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15253 aligncenter&quot; height=&quot;578&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 634px) 100vw, 634px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1490.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1490.png 634w, https://vitux.com/wp-content/uploads/word-image-1490-300x274.png 300w&quot; width=&quot;634&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Performing the above steps, it will add the Debian 10 ISO file under the storage devices. This is shown highlighted in the below image.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15254 aligncenter&quot; height=&quot;626&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 646px) 100vw, 646px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1491.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1491.png 646w, https://vitux.com/wp-content/uploads/word-image-1491-300x291.png 300w&quot; width=&quot;646&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Step 09: Installing the new VM&lt;/h2&gt;
&lt;p&gt;Once you have done with all of the above-mentioned steps, you can now install the new VM. For doing so, follow the following bullet points:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Click on the&lt;strong&gt; Start button&lt;/strong&gt; as shown highlighted in the below image.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15255 aligncenter&quot; height=&quot;718&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1366px) 100vw, 1366px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1492.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1492.png 1366w, https://vitux.com/wp-content/uploads/word-image-1492-300x158.png 300w, https://vitux.com/wp-content/uploads/word-image-1492-1024x538.png 1024w, https://vitux.com/wp-content/uploads/word-image-1492-768x404.png 768w&quot; width=&quot;1366&quot;/&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Click on the &lt;strong&gt;first option&lt;/strong&gt; of the &lt;strong&gt;Main Menu.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15256 aligncenter&quot; height=&quot;538&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 640px) 100vw, 640px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1493.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1493.png 640w, https://vitux.com/wp-content/uploads/word-image-1493-300x252.png 300w&quot; width=&quot;640&quot;/&gt;&lt;/p&gt;
&lt;p&gt;It will take you to the following screen:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Click on the&lt;strong&gt; install Debian&lt;/strong&gt; button.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15257 aligncenter&quot; height=&quot;252&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 787px) 100vw, 787px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1494.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1494.png 787w, https://vitux.com/wp-content/uploads/word-image-1494-300x96.png 300w, https://vitux.com/wp-content/uploads/word-image-1494-768x246.png 768w&quot; width=&quot;787&quot;/&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set &lt;strong&gt;American&lt;/strong&gt; &lt;strong&gt;English&lt;/strong&gt; as your &lt;strong&gt;default installation language&lt;/strong&gt; and click the &lt;strong&gt;Next&lt;/strong&gt; button.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15258 aligncenter&quot; height=&quot;595&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 805px) 100vw, 805px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1495.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1495.png 805w, https://vitux.com/wp-content/uploads/word-image-1495-300x222.png 300w, https://vitux.com/wp-content/uploads/word-image-1495-768x568.png 768w&quot; width=&quot;805&quot;/&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Select your &lt;strong&gt;current location&lt;/strong&gt; and click on the &lt;strong&gt;Next&lt;/strong&gt; button.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15259 aligncenter&quot; height=&quot;606&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 826px) 100vw, 826px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1496.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1496.png 826w, https://vitux.com/wp-content/uploads/word-image-1496-300x220.png 300w, https://vitux.com/wp-content/uploads/word-image-1496-768x563.png 768w&quot; width=&quot;826&quot;/&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Select the&lt;strong&gt; keyboard layout&lt;/strong&gt; &lt;strong&gt;of your choice&lt;/strong&gt; and click the &lt;strong&gt;Next &lt;/strong&gt;button.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15260 aligncenter&quot; height=&quot;595&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1497.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1497.png 800w, https://vitux.com/wp-content/uploads/word-image-1497-300x223.png 300w, https://vitux.com/wp-content/uploads/word-image-1497-768x571.png 768w&quot; width=&quot;800&quot;/&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Tick mark the &lt;strong&gt;�erase disk�&lt;/strong&gt; option and click the&lt;strong&gt; Next&lt;/strong&gt; button.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15261 aligncenter&quot; height=&quot;595&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 804px) 100vw, 804px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1498.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1498.png 804w, https://vitux.com/wp-content/uploads/word-image-1498-300x222.png 300w, https://vitux.com/wp-content/uploads/word-image-1498-768x568.png 768w&quot; width=&quot;804&quot;/&gt;&lt;/p&gt;
&lt;h3&gt;Step 10: Setting up User Account&lt;/h3&gt;
&lt;p&gt;After getting done with the above steps, it will now take you to the next tab named &lt;strong&gt;Users&lt;/strong&gt; for setting your account. Look at the highlighted parts of the attached image below for setting up the account.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set &lt;strong&gt;username&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Set &lt;strong&gt;password&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Confirm password.&lt;/li&gt;
&lt;li&gt;Click on the &lt;strong&gt;Next&lt;/strong&gt; button.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15262 aligncenter&quot; height=&quot;593&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 806px) 100vw, 806px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1499.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1499.png 806w, https://vitux.com/wp-content/uploads/word-image-1499-300x221.png 300w, https://vitux.com/wp-content/uploads/word-image-1499-768x565.png 768w&quot; width=&quot;806&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The next tab named &lt;strong&gt;�Summary�&lt;/strong&gt; will give an overall preview of all your selected fields and choices, along with the options of &lt;strong&gt;Back, Install and Cancel &lt;/strong&gt;in the bottom right corner.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Click on the &lt;strong&gt;Install&lt;/strong&gt; button.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15263 aligncenter&quot; height=&quot;606&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 806px) 100vw, 806px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1500.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1500.png 806w, https://vitux.com/wp-content/uploads/word-image-1500-300x226.png 300w, https://vitux.com/wp-content/uploads/word-image-1500-768x577.png 768w&quot; width=&quot;806&quot;/&gt;&lt;/p&gt;
&lt;p&gt;After clicking on the install, the installation process will begin and usually takes some time.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15264 aligncenter&quot; height=&quot;604&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 792px) 100vw, 792px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1501.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1501.png 792w, https://vitux.com/wp-content/uploads/word-image-1501-300x229.png 300w, https://vitux.com/wp-content/uploads/word-image-1501-768x586.png 768w&quot; width=&quot;792&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Once it has done, it will take you to the last tab named&lt;strong&gt; Finish&lt;/strong&gt; and you will be required to restart your VM. Tick the &lt;strong&gt;Restart Now&lt;/strong&gt; and then click the &lt;strong&gt;Done&lt;/strong&gt; button as highlighted in the below image and your VM will be restarted. You can now able to work on your new VM.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-15265 aligncenter&quot; height=&quot;603&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 802px) 100vw, 802px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1502.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1502.png 802w, https://vitux.com/wp-content/uploads/word-image-1502-300x226.png 300w, https://vitux.com/wp-content/uploads/word-image-1502-768x577.png 768w&quot; width=&quot;802&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;This document will guide the professional as well as na�ve users through the whole step by step process for an easy and steady way of installing Debian on Virtual Box version, showing everything highlighted in the attached images for your convenience.&lt;/p&gt;
&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;How to Install Debian on Virtual Box&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;

&lt;/article&gt;How to Install Debian on Virtual Box</description><link>https://coderpad.blogspot.com/2022/11/how-to-install-debian-on-virtual-box.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-2345644665530700518</guid><pubDate>Wed, 02 Nov 2022 15:00:00 +0000</pubDate><atom:updated>2022-11-02T08:00:41.688-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">How to Restart Network on Ubuntu 22.04</category><title>How to Restart Network on Ubuntu 22.04</title><description>&lt;article class=&quot;post-15045 post type-post status-publish format-standard has-post-thumbnail hentry category-linux category-shell category-ubuntu&quot; id=&quot;post-15045&quot;&gt;
&lt;div class=&quot;entry-content clearfix&quot;&gt;
&lt;p&gt;Whenever a problem occurs with the system, the main solution is to perform a restart or reboot the system. Similarly, if a problem occurs with the network, then its easy treatment is to restart the network. There are many scenarios where you may need to restart the network on Ubuntu like settings of the network were changed or the active network connection not working properly. Restarting the network services is equally important for all Linux systems.&lt;/p&gt;
&lt;p&gt;In this article, we will check how to restart the network on Ubuntu 22.04 and Ubuntu 20.04 systems.&lt;/p&gt;
&lt;p&gt;Using the following different methods, you can restart the network on Ubuntu.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Restart network using GUI&lt;/li&gt;
&lt;li&gt;Restart network using the command line&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Depending on your ease, you can choose one that suits you.&lt;/p&gt;
&lt;h2&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;We are assuming that you are using the Gnome desktop on your Linux system. You should be logged in as a root user or you have sudo privileges to run all commands.&lt;/p&gt;
&lt;h2&gt;Method 1: Restart Network using GUI&lt;/h2&gt;
&lt;p&gt;When you restart the network using the GUI, then you can follow the following two different options.&lt;/p&gt;
&lt;h3&gt;Restart Network from the Desktop&lt;/h3&gt;
&lt;p&gt;In this method, you can restart the network from the Desktop. To do that, right-click on the top right corner on the network icon, and the following drop-down list will display on the right corner:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Desktop network Icon on Ubuntu&quot; class=&quot;aligncenter wp-image-15046&quot; height=&quot;584&quot; sizes=&quot;(max-width: 975px) 100vw, 975px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1359.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1359.png 975w, https://vitux.com/wp-content/uploads/word-image-1359-300x180.png 300w, https://vitux.com/wp-content/uploads/word-image-1359-768x460.png 768w&quot; width=&quot;975&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Click on the �wired connected� option from the list and select �Turn off� that will disable the network connection.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Turn off network connection&quot; class=&quot;aligncenter wp-image-15047&quot; height=&quot;567&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1038px) 100vw, 1038px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1360.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1360.png 1038w, https://vitux.com/wp-content/uploads/word-image-1360-300x164.png 300w, https://vitux.com/wp-content/uploads/word-image-1360-1024x559.png 1024w, https://vitux.com/wp-content/uploads/word-image-1360-768x420.png 768w&quot; width=&quot;1038&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Now, follow the above-mentioned process and again enable the network by clicking the connect option as follows:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Connect to network&quot; class=&quot;aligncenter wp-image-15048&quot; height=&quot;517&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 690px) 100vw, 690px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1361.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1361.png 690w, https://vitux.com/wp-content/uploads/word-image-1361-300x225.png 300w&quot; width=&quot;690&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The network connection has been re-establish now.&lt;/p&gt;
&lt;h1&gt;&lt;strong&gt;Network Restart using Gnome Settings&lt;/strong&gt;&lt;/h1&gt;
&lt;p&gt;Click on the arrow sign located at the top right corner and then choose �Settings�.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Open Settings&quot; class=&quot;aligncenter wp-image-15049&quot; height=&quot;541&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 709px) 100vw, 709px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1362.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1362.png 709w, https://vitux.com/wp-content/uploads/word-image-1362-300x229.png 300w&quot; width=&quot;709&quot;/&gt;&lt;/p&gt;
&lt;p&gt;You can also go into the Settings by using the application search bar as follows:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;GNOME settings manager&quot; class=&quot;aligncenter wp-image-15050&quot; height=&quot;569&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1178px) 100vw, 1178px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1363.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1363.png 1178w, https://vitux.com/wp-content/uploads/word-image-1363-300x145.png 300w, https://vitux.com/wp-content/uploads/word-image-1363-1024x495.png 1024w, https://vitux.com/wp-content/uploads/word-image-1363-768x371.png 768w&quot; width=&quot;1178&quot;/&gt;&lt;/p&gt;
&lt;p&gt;You will see the following window on the desktop. Select the �network� option from the left sidebar and here you can enable or disable the connected network connection.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Network settings&quot; class=&quot;aligncenter wp-image-15051&quot; height=&quot;810&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 983px) 100vw, 983px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1364.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1364.png 983w, https://vitux.com/wp-content/uploads/word-image-1364-300x247.png 300w, https://vitux.com/wp-content/uploads/word-image-1364-768x633.png 768w&quot; width=&quot;983&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Method 2: Restart network using the command line&lt;/h2&gt;
&lt;p&gt;Using this method, you can restart the network using the following different ways:&lt;/p&gt;
&lt;h3&gt;Restart Network using the service manager&lt;/h3&gt;
&lt;p&gt;The most simple and easiest way to restart the network using the network service manager. Launch the terminal and type the following command on it:&lt;/p&gt;
&lt;pre&gt;$ sudo service network-manager restart&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Restart network manager service&quot; class=&quot;aligncenter wp-image-15052&quot; height=&quot;171&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 734px) 100vw, 734px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1365.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1365.png 734w, https://vitux.com/wp-content/uploads/word-image-1365-300x70.png 300w&quot; width=&quot;734&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Verify&lt;/p&gt;
&lt;h3&gt;Use Systemd to Restart Network&lt;/h3&gt;
&lt;p&gt;Systemd has an array of system components that can also handle network services. Restart network service using systemd, directly restart the network services instead of going through any other hoops.&lt;/p&gt;
&lt;pre&gt;$ sudo systemctl restart NetworkManager.service&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Use systemctl command to restart network on Ubuntu&quot; class=&quot;aligncenter wp-image-15053&quot; height=&quot;143&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 734px) 100vw, 734px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1366.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1366.png 734w, https://vitux.com/wp-content/uploads/word-image-1366-300x58.png 300w&quot; width=&quot;734&quot;/&gt;&lt;/p&gt;
&lt;p&gt;verify&lt;/p&gt;
&lt;h3&gt;Restart Network through the Nmcli&lt;/h3&gt;
&lt;p&gt;Nmcli is the most commonly used tool for managing network connections. You can turn off the connect using the following command:&lt;/p&gt;
&lt;pre&gt;$ sudo nmcli networking off&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;network restart with nmcli&quot; class=&quot;aligncenter wp-image-15054&quot; height=&quot;149&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 726px) 100vw, 726px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1367.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1367.png 726w, https://vitux.com/wp-content/uploads/word-image-1367-300x62.png 300w&quot; width=&quot;726&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Use the command below to turn on the network connection.&lt;/p&gt;
&lt;pre&gt;$ sudo nmcli networking on&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Turn on network using nmcli&quot; class=&quot;aligncenter wp-image-15055&quot; height=&quot;150&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 734px) 100vw, 734px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1368.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1368.png 734w, https://vitux.com/wp-content/uploads/word-image-1368-300x61.png 300w&quot; width=&quot;734&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Verify&lt;/p&gt;
&lt;h3&gt;Using ifdown and ifup commands Restart Network&lt;/h3&gt;
&lt;p&gt;The ifdown and ifup commands are used to handle the different network interfaces on Linux.&lt;/p&gt;
&lt;p&gt;These two packages are not preinstalled on Ubuntu. Therefore, you need to install these packages by using the following command:&lt;/p&gt;
&lt;pre&gt;$ sudo apt update &amp;amp;&amp;amp; sudo apt install ifupdown -y&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Install ifup and ifdown scripts&quot; class=&quot;aligncenter wp-image-15056&quot; height=&quot;477&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 737px) 100vw, 737px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1369.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1369.png 737w, https://vitux.com/wp-content/uploads/word-image-1369-300x194.png 300w&quot; width=&quot;737&quot;/&gt;&lt;/p&gt;
&lt;p&gt;To turn off the network, use the ifdown and turn it on by using the ifup command as follows:&lt;/p&gt;
&lt;pre&gt;$ sudo ifdown -a &amp;amp;&amp;amp; sudo ifup -a&lt;/pre&gt;
&lt;h3&gt;Restart Network using the nmtui&lt;/h3&gt;
&lt;p&gt;Nmtui is another tool for managing network connections and provides an interactive environment. This tool comes pre-installed by default on Ubuntu. Therefore, just launch it using the following command:&lt;/p&gt;
&lt;pre&gt;$ sudo nmtui&lt;/pre&gt;
&lt;p&gt;The following interface will display on the terminal:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Start nmtui&quot; class=&quot;aligncenter wp-image-15057&quot; height=&quot;471&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 735px) 100vw, 735px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1370.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1370.png 735w, https://vitux.com/wp-content/uploads/word-image-1370-300x192.png 300w&quot; width=&quot;735&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Choose �Activate a connection� using the downward arrow key and then hit �Enter�.Now, deactivate this connection by selecting the �deactivate� option and hitting �Enter�.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Deactivate network connection&quot; class=&quot;aligncenter wp-image-15058&quot; height=&quot;476&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 727px) 100vw, 727px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1371.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1371.png 727w, https://vitux.com/wp-content/uploads/word-image-1371-300x196.png 300w&quot; width=&quot;727&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Once the connection is deactivated, again �Activate� this connection as follows:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Activate network connection&quot; class=&quot;aligncenter wp-image-15059&quot; height=&quot;472&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 730px) 100vw, 730px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1372.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1372.png 730w, https://vitux.com/wp-content/uploads/word-image-1372-300x194.png 300w&quot; width=&quot;730&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Once the network is restarted, quit this application as follows:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Quit nmtui&quot; class=&quot;aligncenter wp-image-15060&quot; height=&quot;473&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 723px) 100vw, 723px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1373.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1373.png 723w, https://vitux.com/wp-content/uploads/word-image-1373-300x196.png 300w&quot; width=&quot;723&quot;/&gt;&lt;/p&gt;
&lt;h3&gt;Restart network using the IP command&lt;/h3&gt;
&lt;p&gt;The IP command is one more alternative that you can use in managing the network connections on Linux.&lt;/p&gt;
&lt;p&gt;First, you will find your target network interface by using the following command:&lt;/p&gt;
&lt;pre&gt;$ ip link show&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;get network device name with ip command&quot; class=&quot;aligncenter wp-image-15061&quot; height=&quot;242&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 728px) 100vw, 728px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1374.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1374.png 728w, https://vitux.com/wp-content/uploads/word-image-1374-300x100.png 300w&quot; width=&quot;728&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Here, enp0s3 is our target network. Start the network by typing the following command:&lt;/p&gt;
&lt;pre&gt;$ sudo ip link set enp0s3 down&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Shutdown network link using ip command&quot; class=&quot;aligncenter wp-image-15062&quot; height=&quot;160&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 736px) 100vw, 736px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1375.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1375.png 736w, https://vitux.com/wp-content/uploads/word-image-1375-300x65.png 300w&quot; width=&quot;736&quot;/&gt;&lt;/p&gt;
&lt;pre&gt;$ sudo ip link set enp0s3 up&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Turn on network link with the help of the ip command&quot; class=&quot;aligncenter wp-image-15063&quot; height=&quot;113&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 728px) 100vw, 728px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-1376.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-1376.png 728w, https://vitux.com/wp-content/uploads/word-image-1376-300x47.png 300w&quot; width=&quot;728&quot;/&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Restarting the network is a good solution for solving a network problem. If you still have the same problem then you can also reboot or restart your system. From the above all mentioned ways, I hope you have learned a lot.� But, in case of any issue, you can send us your feedback.&lt;/p&gt;
&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;How to Restart Network on Ubuntu 22.04&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;

&lt;/article&gt;</description><link>https://coderpad.blogspot.com/2022/11/how-to-restart-network-on-ubuntu-2204.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-5744061951986196398</guid><pubDate>Wed, 02 Nov 2022 14:57:00 +0000</pubDate><atom:updated>2022-11-02T07:57:48.550-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">How to install PHP 5.6</category><category domain="http://www.blogger.com/atom/ns#">PHP 8.0 and PHP 8.1 on Ubuntu 22.04 LTS</category><title>How to install PHP 5.6, PHP 8.0 and PHP 8.1 on Ubuntu 22.04 LTS</title><description>&lt;article class=&quot;post-2718 post type-post status-publish format-standard has-post-thumbnail hentry category-linux category-ubuntu&quot; id=&quot;post-2718&quot;&gt;
&lt;div class=&quot;entry-content clearfix&quot;&gt;
&lt;p&gt;PHP is a recursive acronym for Hypertext Processor. It is an open-source general-purpose scripting language that is widely used in web development because of its ability to be embedded in HTML. A scripting language is used to write pre-written programs that are later used to automate tasks. PHP scripts are commonly used on Linux, Unix, Windows, Mac OS, and other operating systems. When using PHP in web development, you are free to choose your web server and the underlying operating system.&lt;/p&gt;
&lt;p&gt;This article describes step-by-step how to install PHP versions 5.6, 8.0, and 8.1 on your Ubuntu. After installing the two versions, it also explains how you can disable one version and enable another version as the default version for the system.&lt;/p&gt;
&lt;p&gt;We have run the commands and procedures mentioned in this article on an &lt;strong&gt;Ubuntu 22.04 LTS&lt;/strong&gt; system. The same commands will work on the old &lt;strong&gt;Ubuntu 20.04 LTS&lt;/strong&gt; version as well.&lt;/p&gt;
&lt;p&gt;In this article, we use the Ubuntu command line, the terminal, to install and configure PHP. You can open the Terminal application using either the System Dash or the Ctrl+Alt+t key combination.&lt;/p&gt;
&lt;p&gt;The official PHP website, php.net, provides a list of all PHP versions to date at the following link:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://php.net/releases/&quot;&gt;http://php.net/releases/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;From this list, you can choose whichever version you wish to install on your system. The list includes downloadable tar.gz packages but in this article, we will describe installing PHP through the Ondrej PPA repository.&lt;/p&gt;
&lt;h2&gt;Install PHP version 5.6&lt;/h2&gt;
&lt;p&gt;In order to install PHP version 5.6, first, open your Ubuntu Terminal and enter the following command in order to add the Ondrej PHP repository to your Ubuntu.&lt;/p&gt;
&lt;pre&gt;$ sudo add-apt-repository ppa:ondrej/php&lt;/pre&gt;
&lt;p&gt;This repository contains all the released versions of PHP to date.&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;Add the Ondrej PHP repository&quot; class=&quot;alignnone size-large wp-image-19342&quot; height=&quot;390&quot; sizes=&quot;(max-width: 750px) 100vw, 750px&quot; src=&quot;https://vitux.com/wp-content/uploads/ubuntu-add-ondrej-ppa-1024x533.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/ubuntu-add-ondrej-ppa-1024x533.png 1024w, https://vitux.com/wp-content/uploads/ubuntu-add-ondrej-ppa-300x156.png 300w, https://vitux.com/wp-content/uploads/ubuntu-add-ondrej-ppa-768x400.png 768w, https://vitux.com/wp-content/uploads/ubuntu-add-ondrej-ppa.png 1285w&quot; width=&quot;750&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Once the Ondrej repository is added, you need to update your system�s repository index with that on the Internet. This way you can install the latest available version of software on your system. Enter the following command in order to do so:&lt;/p&gt;
&lt;pre&gt;$ sudo apt update&lt;/pre&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;Ubuntu package repository update&quot; class=&quot;alignnone size-full wp-image-19343&quot; height=&quot;232&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 756px) 100vw, 756px&quot; src=&quot;https://vitux.com/wp-content/uploads/repository-update.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/repository-update.png 756w, https://vitux.com/wp-content/uploads/repository-update-300x92.png 300w&quot; width=&quot;756&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Now install any pending updates with the following command:&lt;/p&gt;
&lt;pre&gt;$ sudo apt upgrade&lt;/pre&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;Installing Ubuntu updates&quot; class=&quot;alignnone size-large wp-image-19344&quot; height=&quot;226&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 750px) 100vw, 750px&quot; src=&quot;https://vitux.com/wp-content/uploads/ubuntu-install-updates-1024x308.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/ubuntu-install-updates-1024x308.png 1024w, https://vitux.com/wp-content/uploads/ubuntu-install-updates-300x90.png 300w, https://vitux.com/wp-content/uploads/ubuntu-install-updates-768x231.png 768w, https://vitux.com/wp-content/uploads/ubuntu-install-updates.png 1282w&quot; width=&quot;750&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Now is the time to install PHP 5.6 on your system. Enter the following command as sudo as only an authorized person can install/uninstall and configure software on Ubuntu:&lt;/p&gt;
&lt;pre&gt;$ sudo apt install -y php5.6&lt;/pre&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;PHP 5.6 on Ubuntu 22.04&quot; class=&quot;alignnone size-large wp-image-19345&quot; height=&quot;306&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 750px) 100vw, 750px&quot; src=&quot;https://vitux.com/wp-content/uploads/ubuntu-22-04-php-5-1024x418.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/ubuntu-22-04-php-5-1024x418.png 1024w, https://vitux.com/wp-content/uploads/ubuntu-22-04-php-5-300x122.png 300w, https://vitux.com/wp-content/uploads/ubuntu-22-04-php-5-768x313.png 768w, https://vitux.com/wp-content/uploads/ubuntu-22-04-php-5.png 1284w&quot; width=&quot;750&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The software will then be installed on your system.&lt;/p&gt;
&lt;p&gt;In order to check the version number of your installed PHP, run the following command:&lt;/p&gt;
&lt;pre&gt;$ php -v&lt;/pre&gt;
&lt;p&gt;or,&lt;/p&gt;
&lt;pre&gt;$ php --version&lt;/pre&gt;
&lt;p&gt;The command will also verify that PHP is now indeed installed on your system.&lt;/p&gt;
&lt;p&gt;Now you have PHP 5.6 installed, but most use cases require that you install additional PHP modules like MySQL support, Curl, GD, etc. Run the below command to install some commonly used modules.&lt;/p&gt;
&lt;pre&gt;apt-get install php5.6-gd php5.6-mysql php5.6-imap php5.6-curl php5.6-intl php5.6-pspell php5.6-recode php5.6-sqlite3 php5.6-tidy php5.6-xmlrpc php5.6-xsl php5.6-zip php5.6-mbstring php5.6-soap php5.6-opcache libicu65 php5.6-common php5.6-json php5.6-readline php5.6-xml&lt;/pre&gt;
&lt;h2&gt;Install PHP version 8.0&lt;/h2&gt;
&lt;p&gt;In order to install PHP version 8.0, first, open your Ubuntu Terminal and enter the following command in order to add the Ondrej PHP repository to your Ubuntu system (in case you have not done that already in the above chapter to install PHP 5.6).&lt;/p&gt;
&lt;pre&gt;$ sudo add-apt-repository ppa:ondrej/php&lt;/pre&gt;
&lt;p&gt;This repository contains all the released versions of PHP till date.&lt;/p&gt;
&lt;p&gt;Once the Ondrej repository is added, you need to update your system�s repository with that on the internet. This way you can install the latest available version of a software on your system. Enter the following command in order to do so:&lt;/p&gt;
&lt;pre&gt;$ sudo apt update&lt;/pre&gt;
&lt;p&gt;Now is the time to install PHP 8.0 to your system. Enter the following command as sudo as only an authorized person can install/uninstall and configure software on Ubuntu:&lt;/p&gt;
&lt;pre&gt;$ sudo apt install -y php8.0&lt;/pre&gt;
&lt;p&gt;The software will then be installed on your system.&lt;/p&gt;
&lt;p&gt;In order to check the version number of your installed PHP, run the following command:&lt;/p&gt;
&lt;pre&gt;$ php -v&lt;/pre&gt;
&lt;p&gt;or,&lt;/p&gt;
&lt;pre&gt;$ php --version&lt;/pre&gt;
&lt;p&gt;The command will also verify that PHP is now indeed installed on your system.&lt;/p&gt;
&lt;p&gt;Now you have PHP 5.6 installed, but most use cases require that you install additional PHP modules like MySQL support, Curl, GD, SQLite, XML, etc. Run the below command to install some commonly used modules.&lt;/p&gt;
&lt;pre&gt;apt install php8.0-gd php8.0-mysql php8.0-imap php8.0-curl php8.0-intl php8.0-pspell php8.0-sqlite3 php8.0-tidy php8.0-xsl php8.0-zip php8.0-mbstring php8.0-soap php8.0-opcache libonig5 php8.0-common php8.0-readline php8.0-xml&lt;/pre&gt;
&lt;h2&gt;Install PHP version 8.1&lt;/h2&gt;
&lt;p&gt;In order to install PHP version 8.1, first, open your Ubuntu Terminal and enter the following command in order to add the Ondrej PHP repository to your Ubuntu system (in case you have not done that already in one of the above chapters).&lt;/p&gt;
&lt;pre&gt;$ sudo add-apt-repository ppa:ondrej/php&lt;/pre&gt;
&lt;p&gt;This repository contains all the released versions of PHP to date.&lt;/p&gt;
&lt;p&gt;Once the Ondrej repository is added, you need to update your system�s repository with that on the internet. This way you can install the latest available version of a software on your system. Enter the following command in order to do so:&lt;/p&gt;
&lt;pre&gt;$ sudo apt update&lt;/pre&gt;
&lt;p&gt;Now is the time to install PHP 8.1 on your system. Enter the following command as sudo as only an authorized person can install/uninstall and configure software on Ubuntu:&lt;/p&gt;
&lt;pre&gt;$ sudo apt install -y php8.1&lt;/pre&gt;
&lt;p&gt;The software will then be installed on your system.&lt;/p&gt;
&lt;p&gt;In order to check the version number of your installed PHP, run the following command:&lt;/p&gt;
&lt;pre&gt;$ php -v&lt;/pre&gt;
&lt;p&gt;or,&lt;/p&gt;
&lt;pre&gt;$ php --version&lt;/pre&gt;
&lt;p&gt;The command will also verify that PHP is now indeed installed on your system.&lt;/p&gt;
&lt;p&gt;Now you have PHP 8.1 installed, but most use cases require that you install additional PHP modules like MySQL support, Curl, GD, SQLite, XML, etc. Run the below command to install some commonly used modules.&lt;/p&gt;
&lt;pre&gt;apt install php8.1-gd php8.1-mysql php8.1-imap php8.1-curl php8.1-intl php8.1-pspell php8.1-sqlite3 php8.1-tidy php8.1-xsl php8.1-zip php8.1-mbstring php8.1-soap php8.1-opcache libonig5 php8.1-common php8.1-readline php8.1-xml&lt;/pre&gt;
&lt;h2&gt;Switching between installed PHP versions&lt;/h2&gt;
&lt;p&gt;If you have two or more versions of PHP installed on your system, you can configure your system to use one of them as the default PHP version. For this, it is first important to learn which version is currently enabled as default on your Ubuntu system.&lt;/p&gt;
&lt;h3&gt;Check which version is enabled&lt;/h3&gt;
&lt;p&gt;We will describe two ways to check which PHP version is enabled on your system; one is through Apache2 and the other is through the CLI.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Through Apache2&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Change the current directory to /etc/apache2 as follows:&lt;/p&gt;
&lt;pre&gt;$ cd /etc/apache2&lt;/pre&gt;
&lt;p&gt;In the apache2 directory, run the following command to list all the available modes of PHP on your system and know which one of them is currently enabled:&lt;/p&gt;
&lt;pre&gt;$ ls -l mods-*/*php*&lt;/pre&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;Choose PHP version for Apache&quot; class=&quot;alignnone size-full wp-image-18675&quot; height=&quot;232&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 1000px) 100vw, 1000px&quot; src=&quot;https://vitux.com/wp-content/uploads/choose-php-version-apache.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/choose-php-version-apache.png 1000w, https://vitux.com/wp-content/uploads/choose-php-version-apache-300x70.png 300w, https://vitux.com/wp-content/uploads/choose-php-version-apache-768x178.png 768w&quot; width=&quot;1000&quot;/&gt;&lt;/p&gt;
&lt;p&gt;In the output, you can see that the currently enabled version of PHP is highlighted. In our case, it is PHP 5.6.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Through CLI&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It is also very simple to check the currently enabled version of PHP through the CLI. Run the following command which is used to update the default alternative to a software on Ubuntu and thus lists all the available alternatives.&lt;/p&gt;
&lt;pre&gt;$ sudo update-alternatives --config php&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Change PHP CLI version&quot; class=&quot;size-full wp-image-18676 aligncenter&quot; height=&quot;269&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 775px) 100vw, 775px&quot; src=&quot;https://vitux.com/wp-content/uploads/choose-php-cli-version.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/choose-php-cli-version.png 775w, https://vitux.com/wp-content/uploads/choose-php-cli-version-300x104.png 300w, https://vitux.com/wp-content/uploads/choose-php-cli-version-768x267.png 768w&quot; width=&quot;775&quot;/&gt;&lt;/p&gt;
&lt;p&gt;In the output of the above command, the currently enabled version of PHP is indicated by a * symbol. You can see that in our case, it is PHP 5.6.&lt;/p&gt;
&lt;h3&gt;Switch from PHP 5.6 to PHP 8.0 or PHP 8.1&lt;/h3&gt;
&lt;p&gt;We will describe two ways to switch from PHP 5.6 to PHP 8.0; one is through Apache2 and the other is through the CLI.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Through Apache2&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;First, disable the currently enabled version of PHP through the following command:&lt;/p&gt;
&lt;pre&gt;$ sudo a2dismod php5.6&lt;/pre&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;Disable PHP 5.6&quot; class=&quot;alignnone size-full wp-image-18677&quot; height=&quot;200&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; src=&quot;https://vitux.com/wp-content/uploads/disable-php-5-6.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/disable-php-5-6.png 800w, https://vitux.com/wp-content/uploads/disable-php-5-6-300x75.png 300w, https://vitux.com/wp-content/uploads/disable-php-5-6-768x192.png 768w&quot; width=&quot;800&quot;/&gt;&lt;/p&gt;
&lt;p&gt;And then, enable the other version of PHP through the following command:&lt;/p&gt;
&lt;pre&gt;$ sudo a2enmod php8.0&lt;/pre&gt;
&lt;p&gt;�&lt;/p&gt;
&lt;p&gt;If you want to switch to PHP 8.1 instead, use this command:&lt;/p&gt;
&lt;pre&gt;$ sudo a2enmod php8.1&lt;/pre&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;Enable PHP 8&quot; class=&quot;alignnone size-full wp-image-18678&quot; height=&quot;297&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 800px) 100vw, 800px&quot; src=&quot;https://vitux.com/wp-content/uploads/enable-php-8-ubuntu.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/enable-php-8-ubuntu.png 800w, https://vitux.com/wp-content/uploads/enable-php-8-ubuntu-300x111.png 300w, https://vitux.com/wp-content/uploads/enable-php-8-ubuntu-768x285.png 768w&quot; width=&quot;800&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Now when you restart the apache2 service through the following command, PHP 8.0 will be enabled on your system.&lt;/p&gt;
&lt;pre&gt;$ sudo service apache2 restart&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Through CLI&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Use the following command to update your system to now use PHP 8.1 as the default PHP version.&lt;/p&gt;
&lt;pre&gt;$ sudo update-alternatives --set php /usr/bin/php8.1&lt;/pre&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;Change PHP CLI version&quot; class=&quot;alignnone size-full wp-image-18679&quot; height=&quot;139&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 900px) 100vw, 900px&quot; src=&quot;https://vitux.com/wp-content/uploads/switch-to-php-8-1.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/switch-to-php-8-1.png 900w, https://vitux.com/wp-content/uploads/switch-to-php-8-1-300x46.png 300w, https://vitux.com/wp-content/uploads/switch-to-php-8-1-768x119.png 768w&quot; width=&quot;900&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Alternatively, you can use the following command to achieve the same purpose:&lt;/p&gt;
&lt;pre&gt;$ sudo update-alternatives --config php&lt;/pre&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;Alternative way to change CLI PHP on Ubuntu&quot; class=&quot;alignnone size-full wp-image-18680&quot; height=&quot;327&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 917px) 100vw, 917px&quot; src=&quot;https://vitux.com/wp-content/uploads/php-cli-8.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/php-cli-8.png 917w, https://vitux.com/wp-content/uploads/php-cli-8-300x107.png 300w, https://vitux.com/wp-content/uploads/php-cli-8-768x274.png 768w&quot; width=&quot;917&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The command lists all the available versions of PHP installed on your system. Enter the selection number of the version you want to enable on your system and hit enter. For example, if I enter 2, PHP 5.6 will be enabled on my system.&lt;/p&gt;
&lt;h3&gt;Switch from PHP 8.0 to PHP 5.6&lt;/h3&gt;
&lt;p&gt;We will describe two ways to switch from PHP 8.0 to PHP 5.6; one is through Apache2 and the other is through the CLI.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Through Apache2&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;First, disable the currently enabled version of PHP through the following command:&lt;/p&gt;
&lt;pre&gt;$ sudo a2dismod php8.0&lt;/pre&gt;
&lt;p&gt;And then, enable the other version of PHP through the following command:&lt;/p&gt;
&lt;pre&gt;$ sudo a2enmod php5.6&lt;/pre&gt;
&lt;p&gt;Now when you restart the apache2 service through the following command, PHP 5.6 will be enabled on your system.&lt;/p&gt;
&lt;pre&gt;$ sudo service apache2 restart&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Through CLI&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Use the following command to update your system to now use PHP 5.6 as the default PHP version.&lt;/p&gt;
&lt;pre&gt;$ sudo update-alternatives --set php /usr/bin/php5.6&lt;/pre&gt;
&lt;p&gt;Alternatively, you can use the following command to achieve the same purpose:&lt;/p&gt;
&lt;pre&gt;$ sudo update-alternatives --config php&lt;/pre&gt;
&lt;p&gt;The command lists all the available versions of PHP installed on your system. Enter the selection number of the version you want to enable on your system and hit enter so that the new version will be enabled.&lt;/p&gt;
&lt;p&gt;This article will guide you in installing your desired version of PHP on Ubuntu 22.04. If you have more than one version of PHP installed on your system, the article also helps you in checking which version is currently enabled and also how to switch from one version to the other.&lt;/p&gt;
&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;How to install PHP 5.6, PHP 8.0 and PHP 8.1 on Ubuntu 22.04 LTS&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;

&lt;/article&gt;</description><link>https://coderpad.blogspot.com/2022/11/how-to-install-php-56-php-80-and-php-81.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-8953502351109868355</guid><pubDate>Wed, 02 Nov 2022 14:56:00 +0000</pubDate><atom:updated>2022-11-02T07:56:51.984-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">How to Install Fish Shell on Ubuntu and Linux Mint</category><title>How to Install Fish Shell on Ubuntu and Linux Mint</title><description>&lt;article class=&quot;post-19356 post type-post status-publish format-standard has-post-thumbnail hentry category-linux&quot; id=&quot;post-19356&quot;&gt;
&lt;div class=&quot;entry-content clearfix&quot;&gt;
&lt;p&gt;The &lt;strong&gt;Fish shell&lt;/strong&gt; also known as the &lt;strong&gt;Friendly Interactive Shell&lt;/strong&gt; is one of the richest Linux shells in terms of user experience. It comes with a whole bundle of useful features with the help of which users can use the command line interface very easily and conveniently. In this article, we will show you how to install Fish Shell on Ubuntu and Linux Mint.&lt;/p&gt;
&lt;h2&gt;Installation Procedure of the Fish Shell&lt;/h2&gt;
&lt;p&gt;To install the Fish shell on a Linux Mint 20 system, you will have to take a look at the following installation procedure. The first four steps of this method are related to the Fish shell installation whereas the last two steps are about its usage. You can also skip the last two steps if you want.&lt;/p&gt;
&lt;h3&gt;Step # 1: Adding the Fish Shell PPA Repository to Linux Mint 20&lt;/h3&gt;
&lt;p&gt;First, you need to add the Fish shell PPA repository to your system by running the command shown below:&lt;/p&gt;
&lt;pre&gt;$ sudo apt-add-repository ppa:fish-shell/release-3&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=&quot;Add the fish shell ppa repository&quot; class=&quot;aligncenter wp-image-19357&quot; height=&quot;27&quot; sizes=&quot;(max-width: 634px) 100vw, 634px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-19356-1.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-19356-1.png 634w, https://vitux.com/wp-content/uploads/word-image-19356-1-300x13.png 300w&quot; width=&quot;634&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Step # 2: Updating the System&lt;/h3&gt;
&lt;p&gt;Now, since we have added a new repository to our system, therefore, before proceeding any further, we will first update our system with the following command:&lt;/p&gt;
&lt;pre&gt;$ sudo apt-get update&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=&quot;update packages&quot; class=&quot;aligncenter wp-image-19358&quot; height=&quot;24&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 402px) 100vw, 402px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-19356-2.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-19356-2.png 402w, https://vitux.com/wp-content/uploads/word-image-19356-2-300x18.png 300w&quot; width=&quot;402&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Step # 3: Installing the Fish Shell on Linux Mint 20&lt;/h3&gt;
&lt;p&gt;After doing that, you can install the Fish shell on your system with the command stated below:&lt;/p&gt;
&lt;pre&gt;$ sudo apt-get install fish&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=&quot;Install Fish shell&quot; class=&quot;aligncenter wp-image-19359&quot; height=&quot;23&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 450px) 100vw, 450px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-19356-3.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-19356-3.png 450w, https://vitux.com/wp-content/uploads/word-image-19356-3-300x15.png 300w&quot; width=&quot;450&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Step # 4: Confirming the Fish Shell Installation&lt;/h3&gt;
&lt;p&gt;The Fish shell will install on your system after a few minutes of executing the installation command. However, if you want to confirm this installation, then you can check its version with the following command:&lt;/p&gt;
&lt;pre&gt;$ fish --version&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=&quot;Check fish shell version&quot; class=&quot;aligncenter wp-image-19360&quot; height=&quot;22&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 360px) 100vw, 360px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-19356-4.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-19356-4.png 360w, https://vitux.com/wp-content/uploads/word-image-19356-4-300x18.png 300w&quot; width=&quot;360&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can see the version of the Fish shell in the image shown below:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Fish Shell 3.1.0&quot; class=&quot;aligncenter wp-image-19361&quot; height=&quot;62&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 369px) 100vw, 369px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-19356-5.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-19356-5.png 369w, https://vitux.com/wp-content/uploads/word-image-19356-5-300x50.png 300w&quot; width=&quot;369&quot;/&gt;&lt;/p&gt;
&lt;h3&gt;Step # 5: Using the Fish Shell on Linux Mint 20: (Optional)&lt;/h3&gt;
&lt;p&gt;If you want to use the Fish shell after installing it, then you will have to run the following command:&lt;/p&gt;
&lt;pre&gt;$ fish&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;img alt=&quot;Start Fish shell&quot; class=&quot;aligncenter wp-image-19362&quot; height=&quot;24&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 279px) 100vw, 279px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-19356-6.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-19356-6.png 279w, https://vitux.com/wp-content/uploads/word-image-19356-6-270x24.png 270w&quot; width=&quot;279&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The Fish shell is shown in the image below:&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-19363 aligncenter&quot; height=&quot;84&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 406px) 100vw, 406px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-19356-7.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-19356-7.png 406w, https://vitux.com/wp-content/uploads/word-image-19356-7-300x62.png 300w&quot; width=&quot;406&quot;/&gt;&lt;/p&gt;
&lt;p&gt;The best thing about the Fish shell is that as soon as you will start typing a command in this shell to run it, you will see useful suggestions that you can choose to auto-complete your command. You can see the following image to understand this. We just typed an �s� and the Fish shell suggested a relevant command that we can choose:&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-19364 aligncenter&quot; height=&quot;87&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 471px) 100vw, 471px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-19356-8.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-19356-8.png 471w, https://vitux.com/wp-content/uploads/word-image-19356-8-300x55.png 300w&quot; width=&quot;471&quot;/&gt;&lt;/p&gt;
&lt;p&gt;Now, to select a command from the provided suggestions, you can simply press the �Tab� key and you will see a whole list of suggested commands you can simply choose one of them as shown in the image below:&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;wp-image-19365 aligncenter&quot; height=&quot;174&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 482px) 100vw, 482px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-19356-9.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-19356-9.png 482w, https://vitux.com/wp-content/uploads/word-image-19356-9-300x108.png 300w&quot; width=&quot;482&quot;/&gt;&lt;/p&gt;
&lt;h3&gt;Step # 6: Exiting from the Fish Shell in Linux Mint 20: (Optional)&lt;/h3&gt;
&lt;p&gt;If you want to exist from the Fish shell and return to your Bash shell, then you simply need to execute the following command:&lt;/p&gt;
&lt;pre&gt;&amp;gt; bash&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;img class=&quot;wp-image-19366 aligncenter&quot; height=&quot;79&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 421px) 100vw, 421px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-19356-10.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-19356-10.png 421w, https://vitux.com/wp-content/uploads/word-image-19356-10-300x56.png 300w&quot; width=&quot;421&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;Removal Procedure of the Fish Shell from Linux Mint 20:&lt;/h2&gt;
&lt;p&gt;For removing the Fish shell from Linux Mint 20, you need to perform the two steps mentioned below:&lt;/p&gt;
&lt;h3&gt;Step # 1: Remove Fish Shell from your System:&lt;/h3&gt;
&lt;p&gt;First, you need to completely remove the Fish shell from your system with the following command:&lt;/p&gt;
&lt;pre&gt;$ sudo apt-get purge --autoremove fish&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;img class=&quot;wp-image-19367 aligncenter&quot; height=&quot;26&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 536px) 100vw, 536px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-19356-11.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-19356-11.png 536w, https://vitux.com/wp-content/uploads/word-image-19356-11-300x15.png 300w&quot; width=&quot;536&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Step # 2: Remove the Fish Shell PPA Repository from your System:&lt;/h3&gt;
&lt;p&gt;After removing the Fish shell completely from your system, you also need to remove its official PPA repository from your system that you have added previously. You can do this by running the command shown below:&lt;/p&gt;
&lt;pre&gt;$ sudo apt-add-repository --remove ppa:fish-shell/release-3&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;img class=&quot;wp-image-19368 aligncenter&quot; height=&quot;42&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 645px) 100vw, 645px&quot; src=&quot;https://vitux.com/wp-content/uploads/word-image-19356-12.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/word-image-19356-12.png 645w, https://vitux.com/wp-content/uploads/word-image-19356-12-300x20.png 300w, https://vitux.com/wp-content/uploads/word-image-19356-12-642x42.png 642w&quot; width=&quot;645&quot;/&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;This article guided you on the installation of the Fish shell on a Linux Mint 20 system. Apart from that, it also enlightened you a little bit on the usage of this shell. Finally, it concluded with the removal procedure of the Fish shell from your system.&lt;/p&gt;

&lt;/article&gt;</description><link>https://coderpad.blogspot.com/2022/11/how-to-install-fish-shell-on-ubuntu-and.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-3155238872122586226</guid><pubDate>Tue, 01 Nov 2022 15:31:00 +0000</pubDate><atom:updated>2022-11-01T08:31:25.724-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tutorial: Web Scraping with Python Using Beautiful Soup</category><title>Tutorial: Web Scraping with Python Using Beautiful Soup</title><description>&lt;article class=&quot;w-100&quot; id=&quot;post-28252&quot;&gt;&lt;div class=&quot;pt-1 pt-sm-3&quot;&gt;March 30, 2021&lt;/div&gt;&lt;h1 class=&quot;display-6 mt-0 pt-0 pb-2&quot;&gt;Tutorial: Web Scraping with Python Using Beautiful Soup&lt;/h1&gt;&lt;img alt=&quot;&quot; class=&quot;img-fluid w-lg-50 w-md-75 my-3 wp-post-image&quot; height=&quot;315&quot; sizes=&quot;(max-width: 560px) 100vw, 560px&quot; src=&quot;https://www.dataquest.io/wp-content/uploads/2021/03/web-scraping-with-python-1.jpg&quot; srcset=&quot;https://923259.smushcdn.com/2321054/wp-content/uploads/2021/03/web-scraping-with-python-1.jpg?size=234x132&amp;amp;lossy=0&amp;amp;strip=1&amp;amp;webp=1 234w, https://923259.smushcdn.com/2321054/wp-content/uploads/2021/03/web-scraping-with-python-1-300x169.jpg?lossy=0&amp;amp;strip=1&amp;amp;webp=1 300w, https://923259.smushcdn.com/2321054/wp-content/uploads/2021/03/web-scraping-with-python-1.jpg?size=468x263&amp;amp;lossy=0&amp;amp;strip=1&amp;amp;webp=1 468w, https://923259.smushcdn.com/2321054/wp-content/uploads/2021/03/web-scraping-with-python-1.jpg?lossy=0&amp;amp;strip=1&amp;amp;webp=1 560w&quot; width=&quot;560&quot;&gt;&lt;p&gt;&lt;em&gt;Learn how to scrape the web with Python!&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The internet is an absolutely massive source of data — data that we can access using web scraping and Python!&lt;/p&gt;
&lt;p&gt;In fact, web scraping is often the &lt;em&gt;only&lt;/em&gt; way we can access data. There is a lot of information out there that isn’t available in convenient CSV exports or easy-to-connect APIs. And websites themselves are often valuable sources of data — consider, for example, the kinds of analysis you could do if you could download every post on a web forum.&lt;/p&gt;
&lt;p&gt;To access those sorts of on-page datasets, we’ll have to use web scraping.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Don’t worry if you’re still a total beginner!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In this tutorial we’re going to cover how to do web scraping with Python from scratch, starting with some answers to frequently-asked questions.&lt;/p&gt;
&lt;p&gt;Then, &lt;strong&gt;we’ll work through an actual web scraping project&lt;/strong&gt;, focusing on weather data.&lt;/p&gt;
&lt;div data-centered-image=&quot;1&quot; style=&quot;max-width: 970px; margin: 20px auto;&quot;&gt;&lt;img alt=&quot;web scraping weather data with python&quot; data-height=&quot;648&quot; data-id=&quot;25907&quot; data-init-height=&quot;1500&quot; data-init-width=&quot;2250&quot; data-sizes=&quot;(max-width: 632px) 100vw, 632px&quot; data-width=&quot;970&quot; height=&quot;648&quot; loading=&quot;lazy&quot; src=&quot;https://www.dataquest.io/wp-content/uploads/2020/09/web-scraping-weather.jpeg&quot; srcset=&quot;https://www.dataquest.io/wp-content/uploads/2020/09/web-scraping-weather.jpeg 2250w, https://www.dataquest.io/wp-content/uploads/2020/09/web-scraping-weather-300x200.jpeg 300w, https://www.dataquest.io/wp-content/uploads/2020/09/web-scraping-weather-1024x683.jpeg 1024w, https://www.dataquest.io/wp-content/uploads/2020/09/web-scraping-weather-768x512.jpeg 768w, https://www.dataquest.io/wp-content/uploads/2020/09/web-scraping-weather-1536x1024.jpeg 1536w, https://www.dataquest.io/wp-content/uploads/2020/09/web-scraping-weather-2048x1365.jpeg 2048w&quot; title=&quot;web-scraping-weather&quot; width=&quot;970&quot;/&gt;&lt;/div&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;em&gt;We’ll work together to scrape weather data from the web to support a weather app.&lt;br/&gt;
&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;But before we start writing any Python, we’ve got to cover the basics! If you’re already familiar with the concept of web scraping, feel free to &lt;a href=&quot;#tve-jump-1788432a71d&quot;&gt;scroll past these questions and jump right into the tutorial!&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;The Fundamentals of Web Scraping:&lt;/h2&gt;
&lt;h3&gt;What is Web Scraping in Python?&lt;/h3&gt;
&lt;p&gt;Some websites offer data sets that are downloadable in CSV format, or accessible via an &lt;a href=&quot;https://en.wikipedia.org/wiki/Application_programming_interface&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;Application Programming Interface&lt;/a&gt; (API). But many websites with useful data don’t offer these convenient options.&lt;/p&gt;
&lt;p&gt;Consider, for example, the National Weather Service’s website. It contains up-to-date weather forecasts for every location in the US, but that weather data isn’t accessible as a CSV or via API. It has to be viewed on the NWS site:&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;nws&quot; class=&quot;lazy&quot; data-lazy-loaded=&quot;1&quot; src=&quot;https://www.dataquest.io/wp-content/uploads/2019/01/nws.png&quot;/&gt;&lt;/p&gt;
&lt;p&gt;If we wanted to analyze this data, or download it for use in some other app, we wouldn’t want to painstakingly copy-paste everything. Web scraping is a technique that lets us use programming to do the heavy lifting. We’ll write some code that looks at the NWS site, grabs just the data we want to work with, and outputs it in the format we need.&lt;/p&gt;
&lt;p&gt;In this tutorial, we’ll show you how to perform web scraping using &lt;a href=&quot;https://www.python.org/downloads/release/python-350/&quot;&gt;Python 3&lt;/a&gt; and the &lt;a href=&quot;https://www.crummy.com/software/BeautifulSoup/&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;Beautiful Soup&lt;/a&gt; library. We’ll be scraping weather forecasts from the &lt;a href=&quot;https://www.weather.gov/&quot;&gt;National Weather Service&lt;/a&gt;, and then analyzing them using the &lt;a href=&quot;https://pandas.pydata.org/&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;Pandas&lt;/a&gt; library.&lt;/p&gt;
&lt;p&gt;But to be clear, lots of programming languages can be used to scrape the web! We also teach &lt;a href=&quot;https://www.dataquest.io/blog/web-scraping-in-r-rvest/&quot; rel=&quot;noopener&quot; style=&quot;outline: currentcolor none medium;&quot; target=&quot;_blank&quot;&gt;web scraping in R&lt;/a&gt;, for example. For this tutorial, though, we’ll be sticking with Python.&lt;/p&gt;
&lt;h3&gt;How Does Web Scraping Work?&lt;/h3&gt;
&lt;p&gt;When we scrape the web, we write code that sends a request to the server that’s hosting the page we specified. The server will return the source code — HTML, mostly — for the page (or pages) we requested.&lt;/p&gt;
&lt;p&gt;So far, we’re essentially doing the same thing a web browser does — sending a server request with a specific URL and asking the server to return the code for that page.&lt;/p&gt;
&lt;p&gt;But &lt;em&gt;unlike&lt;/em&gt; a web browser, our web scraping code won’t interpret the page’s source code and display the page visually. Instead, we’ll write some custom code that filters through the page’s source code looking for specific elements we’ve specified, and extracting whatever content we’ve instructed it to extract.&lt;/p&gt;
&lt;p&gt;For example, if we wanted to get all of the data from inside a table that was displayed on a web page, our code would be written to go through these steps in sequence:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;Request the content (source code) of a specific URL from the server&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Download the content that is returned&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Identify the elements of the page that are part of the table we want&lt;br/&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Extract and (if necessary) reformat those elements into a dataset we can analyze or use in whatever way we require.&lt;br/&gt;
&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;If that all sounds very complicated, don’t worry! &lt;/strong&gt;Python and Beautiful Soup have built-in features designed to make this relatively straightforward.&lt;/p&gt;
&lt;p&gt;One thing that’s important to note: from a server’s perspective, requesting a page via web scraping is the same as loading it in a web browser. When we use code to submit these requests, we might be “loading” pages much faster than a regular user, and thus quickly eating up the website owner’s server resources.&lt;/p&gt;
&lt;h3&gt;Why Use Python for Web Scraping?&lt;/h3&gt;
&lt;p&gt;As previously mentioned, it’s possible to do web scraping with many programming languages.&lt;/p&gt;
&lt;p&gt;However, one of the most popular approaches is to use Python and the Beautiful Soup library, as we’ll do in this tutorial.&lt;/p&gt;
&lt;p&gt;Learning to do this with Python will mean that there are lots of tutorials, how-to videos, and bits of example code out there to help you deepen your knowledge once you’ve mastered the Beautiful Soup basics.&lt;/p&gt;
&lt;h3&gt;Is Web Scraping Legal?&lt;/h3&gt;
&lt;p&gt;Unfortunately, there’s not a cut-and-dry answer here. Some websites explicitly allow web scraping. Others explicitly forbid it. Many websites don’t offer any clear guidance one way or the other.&lt;/p&gt;
&lt;p&gt;Before scraping any website, we should look for a terms and conditions page to see if there are explicit rules about scraping. If there are, we should follow them. If there are not, then it becomes more of a judgement call.&lt;/p&gt;
&lt;p&gt;Remember, though, that &lt;em&gt;web scraping consumes server resources for the host website.&lt;/em&gt; If we’re just scraping one page once, that isn’t going to cause a problem. But if our code is scraping 1,000 pages once every ten minutes, that could quickly get expensive for the website owner.&lt;/p&gt;
&lt;p&gt;Thus, in addition to following any and all explicit rules about web scraping posted on the site, it’s also a good idea to follow these best practices:&lt;/p&gt;
&lt;h4&gt;Web Scraping Best Practices:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Never scrape more frequently than you need to.&lt;/li&gt;
&lt;li&gt;Consider &lt;a href=&quot;https://pypi.org/project/requests-cache/&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;caching&lt;/a&gt; the content you scrape so that it’s only downloaded once.&lt;/li&gt;
&lt;li&gt;Build pauses into your code using functions like &lt;a href=&quot;https://docs.python.org/3/library/time.html&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;&lt;code&gt;time.sleep()&lt;/code&gt;&lt;/a&gt; to keep from overwhelming servers with too many requests too quickly.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In our case for this tutorial, the NWS’s data is public domain and &lt;a href=&quot;https://www.weather.gov/disclaimer&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;its terms&lt;/a&gt; do not forbid web scraping, so we’re in the clear to proceed.&lt;/p&gt;
&lt;div class=&quot;learn-python-right-way p-4 text-center&quot;&gt; &lt;h2 class=&quot;text-white&quot;&gt;Learn Python the Right Way.&lt;/h2&gt; &lt;p class=&quot;text-white&quot;&gt;Learn Python by writing Python code from day one, right in your browser window. It&#39;s the best way to learn Python — see for yourself with one of our 60+ free lessons.&lt;/p&gt; &lt;div class=&quot;mx-auto mb-3&quot; style=&quot;max-width:310px&quot;&gt;&lt;img alt=&quot;astronaut floating over code&quot; loading=&quot;lazy&quot; src=&quot;https://www.dataquest.io/wp-content/uploads/2019/10/dataquest-learn-data-science-online.gif&quot;/&gt;&lt;/div&gt; &lt;p&gt;&lt;a class=&quot;btn btn-lg btn-secondary&quot; href=&quot;https://app.dataquest.io/signup&quot;&gt;Try Dataquest&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;h2 id=&quot;tve-jump-1788432a71d&quot;&gt;The Components of a Web Page&lt;/h2&gt;
&lt;p&gt;Before we start writing code, we need to understand a little bit about the structure of a web page. We’ll use the site’s structure to write code that gets us the data we want to scrape, so understanding that structure is an important first step for any web scraping project.&lt;br/&gt;
When we visit a web page, our web browser makes a request to a web server. This request is called a &lt;code&gt;GET&lt;/code&gt; request, since we’re getting files from the server. The server then sends back files that tell our browser how to render the page for us. These files will typically include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.w3.org/TR/html/&quot;&gt;HTML&lt;/a&gt; — the main content of the page.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/CSS&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;CSS&lt;/a&gt; — used to add styling to make the page look nicer.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;JS&lt;/a&gt; — Javascript files add interactivity to web pages.&lt;/li&gt;
&lt;li&gt;Images — image formats, such as &lt;a href=&quot;https://en.wikipedia.org/wiki/JPEG&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;JPG&lt;/a&gt; and &lt;a href=&quot;https://en.wikipedia.org/wiki/Portable_Network_Graphics&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;PNG&lt;/a&gt;, allow web pages to show pictures.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After our browser receives all the files, it renders the page and displays it to us.&lt;/p&gt;
&lt;p&gt;There’s a lot that happens behind the scenes to render a page nicely, but we don’t need to worry about most of it when we’re web scraping. When we perform web scraping, we’re interested in the main content of the web page, so we look primarily at the HTML.&lt;/p&gt;
&lt;h2&gt;HTML&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/HTML&quot;&gt;HyperText Markup Language&lt;/a&gt; (HTML) is the language that web pages are created in. HTML isn’t a programming language, like Python, though. It’s a &lt;strong&gt;markup language&lt;/strong&gt; that tells a browser how to display content.&lt;/p&gt;
&lt;p&gt;HTML has many functions that are similar to what you might find in a word processor like Microsoft Word — it can make text bold, create paragraphs, and so on.&lt;/p&gt;
&lt;p&gt;If you’re already familiar with HTML, feel free to &lt;a href=&quot;#tve-jump-178843cde0c&quot;&gt;jump to the next section of this tutorial&lt;/a&gt;. Otherwise, let’s take a quick tour through HTML so we know enough to scrape effectively.&lt;/p&gt;
&lt;p&gt;HTML consists of elements called &lt;strong&gt;tags&lt;/strong&gt;. The most basic tag is the &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; tag. This tag tells the web browser that everything inside of it is HTML. We can make a simple HTML document just using this tag:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;html&amp;gt;

&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We haven’t added any content to our page yet, so if we viewed our HTML document in a web browser, we wouldn’t see anything:&lt;/p&gt;
&lt;p&gt;Right inside an &lt;code&gt;html&lt;/code&gt; tag, we can put two other tags: the &lt;code&gt;head&lt;/code&gt; tag, and the &lt;code&gt;body&lt;/code&gt; tag.&lt;/p&gt;
&lt;p&gt;The main content of the web page goes into the &lt;code&gt;body&lt;/code&gt; tag. The &lt;code&gt;head&lt;/code&gt; tag contains data about the title of the page, and other information that generally isn’t useful in web scraping:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;

&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;

&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We still haven’t added any content to our page (that goes inside the &lt;code&gt;body&lt;/code&gt; tag), so if we open this HTML file in a browser, we still won’t see anything:&lt;/p&gt;
&lt;p&gt;You may have noticed above that we put the &lt;code&gt;head&lt;/code&gt; and &lt;code&gt;body&lt;/code&gt; tags inside the &lt;code&gt;html&lt;/code&gt; tag. In HTML, tags are nested, and can go inside other tags.&lt;/p&gt;
&lt;p&gt;We’ll now add our first content to the page, inside a &lt;code&gt;p&lt;/code&gt; tag. The &lt;code&gt;p&lt;/code&gt; tag defines a paragraph, and any text inside the tag is shown as a separate paragraph:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;

&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;

&amp;lt;p&amp;gt;

Here&#39;s a paragraph of text!

&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;

Here&#39;s a second paragraph of text!

&amp;lt;/p&amp;gt;

&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Rendered in a browser, that HTML file will look like this:&lt;/p&gt;
&lt;p&gt;Here’s a paragraph of text!&lt;/p&gt;
&lt;p&gt;Here’s a second paragraph of text!&lt;/p&gt;
&lt;p&gt;Tags have commonly used names that depend on their position in relation to other tags:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;child&lt;/code&gt; — a child is a tag inside another tag. So the two &lt;code&gt;p&lt;/code&gt; tags above are both children of the &lt;code&gt;body&lt;/code&gt; tag.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;parent&lt;/code&gt; — a parent is the tag another tag is inside. Above, the &lt;code&gt;html&lt;/code&gt; tag is the parent of the &lt;code&gt;body&lt;/code&gt; tag.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sibiling&lt;/code&gt; — a sibiling is a tag that is nested inside the same parent as another tag. For example, &lt;code&gt;head&lt;/code&gt; and &lt;code&gt;body&lt;/code&gt; are siblings, since they’re both inside &lt;code&gt;html&lt;/code&gt;. Both &lt;code&gt;p&lt;/code&gt; tags are siblings, since they’re both inside &lt;code&gt;body&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We can also add properties to HTML tags that change their behavior. Below, we’ll add some extra text and hyperlinks using the &lt;code&gt;a&lt;/code&gt; tag.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;

&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;

&amp;lt;p&amp;gt;

Here&#39;s a paragraph of text!

&amp;lt;a href=&quot;https://www.dataquest.io&quot;&amp;gt;Learn Data Science Online&amp;lt;/a&amp;gt;

&amp;lt;/p&amp;gt;

&amp;lt;p&amp;gt;

Here&#39;s a second paragraph of text!

&amp;lt;a href=&quot;https://www.python.org&quot;&amp;gt;Python&amp;lt;/a&amp;gt; &amp;lt;/p&amp;gt;

&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here’s how this will look:&lt;/p&gt;
&lt;p&gt;Here’s a paragraph of text! &lt;a href=&quot;https://www.dataquest.io&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;Learn Data Science Online&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here’s a second paragraph of text! &lt;a href=&quot;https://www.python.org&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;Python&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In the above example, we added two &lt;code&gt;a&lt;/code&gt; tags. &lt;code&gt;a&lt;/code&gt; tags are links, and tell the browser to render a link to another web page. The &lt;code&gt;href&lt;/code&gt; property of the tag determines where the link goes.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;a&lt;/code&gt; and &lt;code&gt;p&lt;/code&gt; are extremely common html tags. Here are a few others:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;div&lt;/code&gt; — indicates a division, or area, of the page.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;b&lt;/code&gt; — bolds any text inside.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;i&lt;/code&gt; — italicizes any text inside.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;table&lt;/code&gt; — creates a table.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;form&lt;/code&gt; — creates an input form.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a full list of tags, look &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/HTML/Element&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Before we move into actual web scraping, let’s learn about the &lt;code&gt;class&lt;/code&gt; and &lt;code&gt;id&lt;/code&gt; properties. These special properties give HTML elements names, and make them easier to interact with when we’re scraping.&lt;/p&gt;
&lt;p&gt;One element can have multiple classes, and a class can be shared between elements. Each element can only have one id, and an id can only be used once on a page. Classes and ids are optional, and not all elements will have them.&lt;/p&gt;
&lt;p&gt;We can add classes and ids to our example:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;

&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;

&amp;lt;p class=&quot;bold-paragraph&quot;&amp;gt;

Here&#39;s a paragraph of text!

&amp;lt;a href=&quot;https://www.dataquest.io&quot; id=&quot;learn-link&quot;&amp;gt;Learn Data Science Online&amp;lt;/a&amp;gt;

&amp;lt;/p&amp;gt;

&amp;lt;p class=&quot;bold-paragraph extra-large&quot;&amp;gt;

Here&#39;s a second paragraph of text!

&amp;lt;a href=&quot;https://www.python.org&quot; class=&quot;extra-large&quot;&amp;gt;Python&amp;lt;/a&amp;gt;

&amp;lt;/p&amp;gt;

&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here’s how this will look:&lt;/p&gt;
&lt;p&gt;Here’s a paragraph of text! &lt;a href=&quot;https://www.dataquest.io&quot;&gt;Learn Data Science Online&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here’s a second paragraph of text! &lt;a href=&quot;https://www.python.org&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;Python&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As you can see, adding classes and ids doesn’t change how the tags are rendered at all.&lt;/p&gt;
&lt;h2&gt;The requests library&lt;/h2&gt;
&lt;p&gt;Now that we understand the structure of a web page, it’s time to get into the fun part: scraping the content we want!&lt;br/&gt;
The first thing we’ll need to do to scrape a web page is to download the page. We can download pages using the Python &lt;a href=&quot;https://2.python-requests.org/en/latest/&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;requests&lt;/a&gt; library.&lt;/p&gt;
&lt;p&gt;The requests library will make a &lt;code&gt;GET&lt;/code&gt; request to a web server, which will download the HTML contents of a given web page for us. There are several different types of requests we can make using &lt;code&gt;requests&lt;/code&gt;, of which &lt;code&gt;GET&lt;/code&gt; is just one. If you want to learn more, check out our &lt;a href=&quot;https://www.dataquest.io/blog/python-api-tutorial/&quot;&gt;API tutorial&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Let’s try downloading a simple sample website, &lt;code&gt;https://dataquestio.github.io/web-scraping-pages/simple.html&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;We’ll need to first import the &lt;code&gt;requests&lt;/code&gt; library, and then download the page using the &lt;a href=&quot;https://2.python-requests.org/en/master/user/quickstart/#make-a-request&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;requests.get&lt;/a&gt; method:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; requests

page &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; requests&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;https://dataquestio.github.io/web-scraping-pages/simple.html&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

page&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;Response [200]&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After running our request, we get a &lt;a href=&quot;https://2.python-requests.org/en/master/user/quickstart/#response-content&quot;&gt;Response&lt;/a&gt; object. This object has a &lt;code&gt;status_code&lt;/code&gt; property, which indicates if the page was downloaded successfully:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;page&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;status_code&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;200&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A &lt;code&gt;status_code&lt;/code&gt; of &lt;code&gt;200&lt;/code&gt; means that the page downloaded successfully. We won’t fully dive into status codes here, but a status code starting with a &lt;code&gt;2&lt;/code&gt; generally indicates success, and a code starting with a &lt;code&gt;4&lt;/code&gt; or a &lt;code&gt;5&lt;/code&gt; indicates an error.&lt;/p&gt;
&lt;p&gt;We can print out the HTML content of the page using the &lt;code&gt;content&lt;/code&gt; property:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;page&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;content&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;

&amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;

&amp;lt;title&amp;gt;A simple example page&amp;lt;/title&amp;gt;

&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;

&amp;lt;p&amp;gt;Here is some simple content for this page.&amp;lt;/p&amp;gt;

&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Parsing a page with BeautifulSoup&lt;/h2&gt;
&lt;p&gt;As you can see above, we now have downloaded an HTML document.&lt;/p&gt;
&lt;p&gt;We can use the &lt;a href=&quot;https://www.crummy.com/software/BeautifulSoup/&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;BeautifulSoup&lt;/a&gt; library to parse this document, and extract the text from the &lt;code&gt;p&lt;/code&gt; tag.&lt;/p&gt;
&lt;p&gt;We first have to import the library, and create an instance of the &lt;code&gt;BeautifulSoup&lt;/code&gt; class to parse our document:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;from&lt;/span&gt; bs4 &lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; BeautifulSoup

soup &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; BeautifulSoup&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;page&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;content&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;html.parser&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can now print out the HTML content of the page, formatted nicely, using the &lt;code&gt;prettify&lt;/code&gt; method on the &lt;code&gt;BeautifulSoup&lt;/code&gt; object.&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;soup&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;prettify&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;

&amp;lt;html&amp;gt;

    &amp;lt;head&amp;gt;

        &amp;lt;title&amp;gt;A simple example page&amp;lt;/title&amp;gt;

    &amp;lt;/head&amp;gt;

    &amp;lt;body&amp;gt;

        &amp;lt;p&amp;gt;Here is some simple content for this page.&amp;lt;/p&amp;gt;

    &amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This step isn’t strictly necessary, and we won’t always bother with it, but it can be helpful to look at prettified HTML to make the structure of the and where tags are nested easier to see.&lt;br/&gt;
As all the tags are nested, we can move through the structure one level at a time. We can first select all the elements at the top level of the page using the &lt;code&gt;children&lt;/code&gt; property of &lt;code&gt;soup&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Note that &lt;code&gt;children&lt;/code&gt; returns a list generator, so we need to call the &lt;code&gt;list&lt;/code&gt; function on it:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;list&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;soup&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;children&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;[&#39;html&#39;, &#39;n&#39;, &amp;lt;html&amp;gt; &amp;lt;head&amp;gt; &amp;lt;title&amp;gt;A simple example page&amp;lt;/title&amp;gt; &amp;lt;/head&amp;gt; &amp;lt;body&amp;gt; &amp;lt;p&amp;gt;Here is some simple content for this page.&amp;lt;/p&amp;gt; &amp;lt;/body&amp;gt; &amp;lt;/html&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The above tells us that there are two tags at the top level of the page — the initial &lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/code&gt; tag, and the &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; tag. There is a newline character (&lt;code&gt;n&lt;/code&gt;) in the list as well. Let’s see what the type of each element in the list is:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;type&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;item&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; item &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; list&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;soup&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;children&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;[bs4.element.Doctype, bs4.element.NavigableString, bs4.element.Tag]&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As we can see, all of the items are &lt;code&gt;BeautifulSoup&lt;/code&gt; objects:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The first is a &lt;code&gt;Doctype&lt;/code&gt; object, which contains information about the type of the document.&lt;/li&gt;
&lt;li&gt;The second is a &lt;code&gt;NavigableString&lt;/code&gt;, which represents text found in the HTML document.&lt;/li&gt;
&lt;li&gt;The final item is a &lt;code&gt;Tag&lt;/code&gt; object, which contains other nested tags.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The most important object type, and the one we’ll deal with most often, is the &lt;code&gt;Tag&lt;/code&gt; object.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;Tag&lt;/code&gt; object allows us to navigate through an HTML document, and extract other tags and text. You can learn more about the various &lt;code&gt;BeautifulSoup&lt;/code&gt; objects &lt;a href=&quot;https://www.crummy.com/software/BeautifulSoup/bs4/doc/#kinds-of-objects&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We can now select the &lt;code&gt;html&lt;/code&gt; tag and its children by taking the third item in the list:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;html &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; list&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;soup&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;children&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Each item in the list returned by the &lt;code&gt;children&lt;/code&gt; property is also a &lt;code&gt;BeautifulSoup&lt;/code&gt; object, so we can also call the &lt;code&gt;children&lt;/code&gt; method on &lt;code&gt;html&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Now, we can find the children inside the &lt;code&gt;html&lt;/code&gt; tag:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;list&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;html&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;children&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;[&#39;n&#39;, &amp;lt;head&amp;gt; &amp;lt;title&amp;gt;A simple example page&amp;lt;/title&amp;gt; &amp;lt;/head&amp;gt;, &#39;n&#39;, &amp;lt;body&amp;gt; &amp;lt;p&amp;gt;Here is some simple content for this page.&amp;lt;/p&amp;gt; &amp;lt;/body&amp;gt;, &#39;n&#39;]&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As we can see above, there are two tags here, &lt;code&gt;head&lt;/code&gt;, and &lt;code&gt;body&lt;/code&gt;. We want to extract the text inside the &lt;code&gt;p&lt;/code&gt; tag, so we’ll dive into the body:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;body &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; list&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;html&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;children&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, we can get the &lt;code&gt;p&lt;/code&gt; tag by finding the children of the body tag:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;list&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;body&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;children&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;[&#39;n&#39;, &amp;lt;p&amp;gt;Here is some simple content for this page.&amp;lt;/p&amp;gt;, &#39;n&#39;]&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can now isolate the p tag:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;p &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; list&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;body&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;children&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once we’ve isolated the tag, we can use the &lt;code&gt;get_text&lt;/code&gt; method to extract all of the text inside the tag:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;p&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get_text&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&#39;Here is some simple content for this page.&#39;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Finding all instances of a tag at once&lt;/h2&gt;
&lt;p&gt;What we did above was useful for figuring out how to navigate a page, but it took a lot of commands to do something fairly simple.&lt;/p&gt;
&lt;p&gt;If we want to extract a single tag, we can instead use the &lt;code&gt;find_all&lt;/code&gt; method, which will find all the instances of a tag on a page.&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;soup &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; BeautifulSoup&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;page&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;content&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;html.parser&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

soup&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;find_all&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;p&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;[&amp;lt;p&amp;gt;Here is some simple content for this page.&amp;lt;/p&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that &lt;code&gt;find_all&lt;/code&gt; returns a list, so we’ll have to loop through, or use list indexing, it to extract text:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;soup&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;find_all&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;p&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get_text&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&#39;Here is some simple content for this page.&#39;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;f you instead only want to find the first instance of a tag, you can use the &lt;code&gt;find&lt;/code&gt; method, which will return a single &lt;code&gt;BeautifulSoup&lt;/code&gt; object:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;soup&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;find&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;p&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;p&amp;gt;Here is some simple content for this page.&amp;lt;/p&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Searching for tags by class and id&lt;/h2&gt;
&lt;p&gt;We introduced classes and ids earlier, but it probably wasn’t clear why they were useful.&lt;/p&gt;
&lt;p&gt;Classes and ids are used by CSS to determine which HTML elements to apply certain styles to. But when we’re scraping, &lt;em&gt;we &lt;/em&gt;can also use them to specify the elements we want to scrape.&lt;/p&gt;
&lt;p&gt;To illustrate this principle, we’ll work with the following page:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;html&amp;gt;

    &amp;lt;head&amp;gt;

        &amp;lt;title&amp;gt;A simple example page&amp;lt;/title&amp;gt;

    &amp;lt;/head&amp;gt;

    &amp;lt;body&amp;gt;

        &amp;lt;div&amp;gt;

            &amp;lt;p class=&quot;inner-text first-item&quot; id=&quot;first&quot;&amp;gt;

                First paragraph.

            &amp;lt;/p&amp;gt;

            &amp;lt;p class=&quot;inner-text&quot;&amp;gt;

                Second paragraph.

            &amp;lt;/p&amp;gt;

        &amp;lt;/div&amp;gt;

            &amp;lt;p class=&quot;outer-text first-item&quot; id=&quot;second&quot;&amp;gt;

                &amp;lt;b&amp;gt;

                First outer paragraph.

                &amp;lt;/b&amp;gt;

            &amp;lt;/p&amp;gt;

            &amp;lt;p class=&quot;outer-text&quot;&amp;gt;

                &amp;lt;b&amp;gt;

                Second outer paragraph.

                &amp;lt;/b&amp;gt;

            &amp;lt;/p&amp;gt;

    &amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can access the above document at the URL &lt;code&gt;https://dataquestio.github.io/web-scraping-pages/ids_and_classes.html&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Let’s first download the page and create a &lt;code&gt;BeautifulSoup&lt;/code&gt; object:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;page &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; requests&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;https://dataquestio.github.io/web-scraping-pages/ids_and_classes.html&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

soup &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; BeautifulSoup&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;page&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;content&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;html.parser&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

soup&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;

&amp;lt;title&amp;gt;A simple example page

&amp;lt;/title&amp;gt;

&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;

&amp;lt;div&amp;gt;

&amp;lt;p class=&quot;inner-text first-item&quot; id=&quot;first&quot;&amp;gt;

First paragraph.

&amp;lt;/p&amp;gt;&amp;lt;p class=&quot;inner-text&quot;&amp;gt;

Second paragraph.

&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;

&amp;lt;p class=&quot;outer-text first-item&quot; id=&quot;second&quot;&amp;gt;&amp;lt;b&amp;gt;

First outer paragraph.

&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p class=&quot;outer-text&quot;&amp;gt;&amp;lt;b&amp;gt;

Second outer paragraph.

&amp;lt;/b&amp;gt;

&amp;lt;/p&amp;gt;

&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, we can use the &lt;code&gt;find_all&lt;/code&gt; method to search for items by class or by id. In the below example, we’ll search for any &lt;code&gt;p&lt;/code&gt; tag that has the class &lt;code&gt;outer-text&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;soup&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;find_all&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;p&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; class_&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;outer-text&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;[&amp;lt;p class=&quot;outer-text first-item&quot; id=&quot;second&quot;&amp;gt; &amp;lt;b&amp;gt; First outer paragraph. &amp;lt;/b&amp;gt; &amp;lt;/p&amp;gt;, &amp;lt;p class=&quot;outer-text&quot;&amp;gt; &amp;lt;b&amp;gt; Second outer paragraph. &amp;lt;/b&amp;gt; &amp;lt;/p&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the below example, we’ll look for any tag that has the class &lt;code&gt;outer-text&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;soup&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;find_all&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;class_&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;outer-text&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;p class=&quot;outer-text first-item&quot; id=&quot;second&quot;&amp;gt;

&amp;lt;b&amp;gt;

First outer paragraph.

&amp;lt;/b&amp;gt;

&amp;lt;/p&amp;gt;, &amp;lt;p class=&quot;outer-text&quot;&amp;gt;

&amp;lt;b&amp;gt;

Second outer paragraph.

&amp;lt;/b&amp;gt;

&amp;lt;/p&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can also search for elements by id:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;soup&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;find_all&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;id&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;first&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;[&amp;lt;p class=&quot;inner-text first-item&quot; id=&quot;first&quot;&amp;gt;

First paragraph.

&amp;lt;/p&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Using CSS Selectors&lt;/h2&gt;
&lt;p&gt;We can also search for items using &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_started/Selectors&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;CSS selectors&lt;/a&gt;. These selectors are how the CSS language allows developers to specify HTML tags to style. Here are some examples:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;p a&lt;/code&gt; — finds all &lt;code&gt;a&lt;/code&gt; tags inside of a &lt;code&gt;p&lt;/code&gt; tag.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;body p a&lt;/code&gt; — finds all &lt;code&gt;a&lt;/code&gt; tags inside of a &lt;code&gt;p&lt;/code&gt; tag inside of a &lt;code&gt;body&lt;/code&gt; tag.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;html body&lt;/code&gt; — finds all &lt;code&gt;body&lt;/code&gt; tags inside of an &lt;code&gt;html&lt;/code&gt; tag.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;p.outer-text&lt;/code&gt; — finds all &lt;code&gt;p&lt;/code&gt; tags with a class of &lt;code&gt;outer-text&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;p#first&lt;/code&gt; — finds all &lt;code&gt;p&lt;/code&gt; tags with an id of &lt;code&gt;first&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;body p.outer-text&lt;/code&gt; — finds any &lt;code&gt;p&lt;/code&gt; tags with a class of &lt;code&gt;outer-text&lt;/code&gt; inside of a &lt;code&gt;body&lt;/code&gt; tag.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can learn more about CSS selectors &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_started/Selectors&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;BeautifulSoup&lt;/code&gt; objects support searching a page via CSS selectors using the &lt;code&gt;select&lt;/code&gt; method. We can use CSS selectors to find all the &lt;code&gt;p&lt;/code&gt; tags in our page that are inside of a &lt;code&gt;div&lt;/code&gt; like this:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;soup&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;select&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;div p&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;[&amp;lt;p class=&quot;inner-text first-item&quot; id=&quot;first&quot;&amp;gt;

First paragraph.

&amp;lt;/p&amp;gt;, &amp;lt;p class=&quot;inner-text&quot;&amp;gt;

Second paragraph.

&amp;lt;/p&amp;gt;]&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that the &lt;code&gt;select&lt;/code&gt; method above returns a list of &lt;code&gt;BeautifulSoup&lt;/code&gt; objects, just like &lt;code&gt;find&lt;/code&gt; and &lt;code&gt;find_all&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Downloading weather data&lt;/h2&gt;
&lt;p&gt;We now know enough to proceed with extracting information about the local weather from the National Weather Service website!&lt;/p&gt;
&lt;p&gt;The first step is to find the page we want to scrape. We’ll extract weather information about downtown San Francisco from &lt;a href=&quot;https://forecast.weather.gov/MapClick.php?lat=37.7772&amp;amp;lon=-122.4168&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;this page&lt;/a&gt;.&lt;/p&gt;
&lt;div data-centered-image=&quot;1&quot; style=&quot;max-width: 632px; margin: 20px auto;&quot;&gt;&lt;img alt=&quot;an image of the site we will use for our python web scraping&quot; data-height=&quot;171&quot; data-id=&quot;4320&quot; data-init-height=&quot;640&quot; data-init-width=&quot;2362&quot; data-sizes=&quot;(max-width: 632px) 100vw, 632px&quot; data-width=&quot;632&quot; height=&quot;171&quot; loading=&quot;lazy&quot; src=&quot;https://www.dataquest.io/wp-content/uploads/extended_forecast.png&quot; srcset=&quot;https://www.dataquest.io/wp-content/uploads/extended_forecast.png 2362w, https://www.dataquest.io/wp-content/uploads/extended_forecast-300x81.png 300w, https://www.dataquest.io/wp-content/uploads/extended_forecast-768x208.png 768w, https://www.dataquest.io/wp-content/uploads/extended_forecast-1024x277.png 1024w&quot; title=&quot;extended_forecast&quot; width=&quot;632&quot;/&gt;&lt;/div&gt;
&lt;p&gt;Specifically, let’s extract data about the extended forecast.&lt;/p&gt;
&lt;p&gt;As we can see from the image, the page has information about the extended forecast for the next week, including time of day, temperature, and a brief description of the conditions.&lt;/p&gt;
&lt;h2&gt;Exploring page structure with Chrome DevTools&lt;/h2&gt;
&lt;p&gt;The first thing we’ll need to do is inspect the page using &lt;a href=&quot;https://developer.chrome.com/devtools&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;Chrome Devtools&lt;/a&gt;. If you’re using another browser, &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Tools/Web_Console/Opening_the_Web_Console&quot;&gt;Firefox&lt;/a&gt; and &lt;a href=&quot;https://developer.apple.com/safari/tools/&quot;&gt;Safari&lt;/a&gt; have equivalents.&lt;/p&gt;
&lt;p&gt;You can start the developer tools in Chrome by clicking &lt;code&gt;View -&amp;gt; Developer -&amp;gt; Developer Tools&lt;/code&gt;. You should end up with a panel at the bottom of the browser like what you see below. Make sure the &lt;code&gt;Elements&lt;/code&gt; panel is highlighted:&lt;/p&gt;
&lt;div data-centered-image=&quot;1&quot; style=&quot;max-width: 661px; margin: 20px auto;&quot;&gt;&lt;img alt=&quot;&quot; data-height=&quot;314&quot; data-id=&quot;4330&quot; data-init-height=&quot;1218&quot; data-init-width=&quot;2560&quot; data-sizes=&quot;(max-width: 661px) 100vw, 661px&quot; data-width=&quot;661&quot; height=&quot;314&quot; loading=&quot;lazy&quot; src=&quot;https://www.dataquest.io/wp-content/uploads/devtools.png&quot; srcset=&quot;https://www.dataquest.io/wp-content/uploads/devtools.png 2560w, https://www.dataquest.io/wp-content/uploads/devtools-300x143.png 300w, https://www.dataquest.io/wp-content/uploads/devtools-768x365.png 768w, https://www.dataquest.io/wp-content/uploads/devtools-1024x487.png 1024w&quot; title=&quot;devtools&quot; width=&quot;661&quot;/&gt;&lt;/div&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;em&gt;Chrome Developer Tools&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The elements panel will show you all the HTML tags on the page, and let you navigate through them. It’s a really handy feature!&lt;/p&gt;
&lt;p&gt;By right clicking on the page near where it says “Extended Forecast”, then clicking “Inspect”, we’ll open up the tag that contains the text “Extended Forecast” in the elements panel:&lt;/p&gt;
&lt;div data-centered-image=&quot;1&quot; style=&quot;max-width: 661px; margin: 20px auto;&quot;&gt;&lt;img alt=&quot;&quot; data-height=&quot;329&quot; data-id=&quot;4333&quot; data-init-height=&quot;1274&quot; data-init-width=&quot;2556&quot; data-sizes=&quot;(max-width: 661px) 100vw, 661px&quot; data-width=&quot;661&quot; height=&quot;329&quot; loading=&quot;lazy&quot; src=&quot;https://www.dataquest.io/wp-content/uploads/ex_selected.png&quot; srcset=&quot;https://www.dataquest.io/wp-content/uploads/ex_selected.png 2556w, https://www.dataquest.io/wp-content/uploads/ex_selected-300x150.png 300w, https://www.dataquest.io/wp-content/uploads/ex_selected-768x383.png 768w, https://www.dataquest.io/wp-content/uploads/ex_selected-1024x510.png 1024w&quot; title=&quot;ex_selected&quot; width=&quot;661&quot;/&gt;&lt;/div&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;em&gt;The extended forecast text&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;We can then scroll up in the elements panel to find the “outermost” element that contains all of the text that corresponds to the extended forecasts. In this case, it’s a &lt;code&gt;div&lt;/code&gt; tag with the id &lt;code&gt;seven-day-forecast&lt;/code&gt;:&lt;/p&gt;
&lt;div data-centered-image=&quot;1&quot; style=&quot;max-width: 632px; margin: 20px auto;&quot;&gt;&lt;img alt=&quot;&quot; data-height=&quot;302&quot; data-id=&quot;4328&quot; data-init-height=&quot;1222&quot; data-init-width=&quot;2560&quot; data-sizes=&quot;(max-width: 632px) 100vw, 632px&quot; data-width=&quot;632&quot; height=&quot;302&quot; loading=&quot;lazy&quot; src=&quot;https://www.dataquest.io/wp-content/uploads/div.png&quot; srcset=&quot;https://www.dataquest.io/wp-content/uploads/div.png 2560w, https://www.dataquest.io/wp-content/uploads/div-300x143.png 300w, https://www.dataquest.io/wp-content/uploads/div-768x367.png 768w, https://www.dataquest.io/wp-content/uploads/div-1024x489.png 1024w&quot; title=&quot;div&quot; width=&quot;632&quot;/&gt;&lt;/div&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;em&gt;The div that contains the extended forecast items.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If we click around on the console, and explore the div, we’ll discover that each forecast item (like “Tonight”, “Thursday”, and “Thursday Night”) is contained in a &lt;code&gt;div&lt;/code&gt; with the class &lt;code&gt;tombstone-container&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Time to Start Scraping!&lt;/h2&gt;
&lt;p&gt;We now know enough to download the page and start parsing it. In the below code, we will:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Download the web page containing the forecast.&lt;/li&gt;
&lt;li&gt;Create a &lt;code&gt;BeautifulSoup&lt;/code&gt; class to parse the page.&lt;/li&gt;
&lt;li&gt;Find the &lt;code&gt;div&lt;/code&gt; with id &lt;code&gt;seven-day-forecast&lt;/code&gt;, and assign to &lt;code&gt;seven_day&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Inside &lt;code&gt;seven_day&lt;/code&gt;, find each individual forecast item.&lt;/li&gt;
&lt;li&gt;Extract and print the first forecast item.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;page &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; requests&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;https://forecast.weather.gov/MapClick.php?lat=37.7772&amp;amp;lon=-122.4168&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

soup &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; BeautifulSoup&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;page&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;content&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;html.parser&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

seven_day &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; soup&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;find&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;id&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;seven-day-forecast&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

forecast_items &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; seven_day&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;find_all&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;class_&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;tombstone-container&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

tonight &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; forecast_items&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;tonight&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;prettify&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&quot;tombstone-container&quot;&amp;gt;

	&amp;lt;p class=&quot;period-name&quot;&amp;gt;

		Tonight

		&amp;lt;br&amp;gt;

		&amp;lt;br/&amp;gt;

		&amp;lt;/br&amp;gt;

	&amp;lt;/p&amp;gt;

	&amp;lt;p&amp;gt;

		&amp;lt;img alt=&quot;Tonight: Mostly clear, with a low around 49. West northwest wind 12 to 17 mph decreasing to 6 to 11 mph after midnight. Winds could gust as high as 23 mph. &quot; class=&quot;forecast-icon&quot; src=&quot;newimages/medium/nfew.png&quot; title=&quot;Tonight: Mostly clear, with a low around 49. West northwest wind 12 to 17 mph decreasing to 6 to 11 mph after midnight. Winds could gust as high as 23 mph. &quot;/&amp;gt;

	&amp;lt;/p&amp;gt;

	&amp;lt;p class=&quot;short-desc&quot;&amp;gt;

		Mostly Clear

	&amp;lt;/p&amp;gt;

	&amp;lt;p class=&quot;temp temp-low&quot;&amp;gt;

		Low: 49 °F

	&amp;lt;/p&amp;gt;

&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Extracting information from the page&lt;/h2&gt;
&lt;p&gt;As we can see, inside the forecast item &lt;code&gt;tonight&lt;/code&gt; is all the information we want. There are four pieces of information we can extract:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The name of the forecast item — in this case, &lt;code&gt;Tonight&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The description of the conditions — this is stored in the &lt;code&gt;title&lt;/code&gt; property of &lt;code&gt;img&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A short description of the conditions — in this case, &lt;code&gt;Mostly Clear&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The temperature low — in this case, &lt;code&gt;49&lt;/code&gt; degrees.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We’ll extract the name of the forecast item, the short description, and the temperature first, since they’re all similar:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;period &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; tonight&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;find&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;class_&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;period-name&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get_text&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

short_desc &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; tonight&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;find&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;class_&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;short-desc&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get_text&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

temp &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; tonight&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;find&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;class_&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;temp&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get_text&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;period&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;short_desc&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;temp&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;Tonight

Mostly Clear

Low: 49 °F&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, we can extract the &lt;code&gt;title&lt;/code&gt; attribute from the &lt;code&gt;img&lt;/code&gt; tag. To do this, we just treat the &lt;code&gt;BeautifulSoup&lt;/code&gt; object like a dictionary, and pass in the attribute we want as a key:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;img &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; tonight&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;find&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;img&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

desc &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; img&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;title&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;desc&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;Tonight: Mostly clear, with a low around 49. West northwest wind 12 to 17 mph decreasing to 6 to 11 mph after midnight. Winds could gust as high as 23 mph.&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Extracting all the information from the page&lt;/h2&gt;
&lt;p&gt;Now that we know how to extract each individual piece of information, we can combine our knowledge with CSS selectors and list comprehensions to &lt;strong&gt;extract everything at once&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;In the below code, we will:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Select all items with the class &lt;code&gt;period-name&lt;/code&gt; inside an item with the class &lt;code&gt;tombstone-container&lt;/code&gt; in &lt;code&gt;seven_day&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Use a list comprehension to call the &lt;code&gt;get_text&lt;/code&gt; method on each &lt;code&gt;BeautifulSoup&lt;/code&gt; object.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;period_tags &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; seven_day&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;select&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.tombstone-container .period-name&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

periods &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;pt&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get_text&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; pt &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; period_tags&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;

periods&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;[&#39;Tonight&#39;,

&#39;Thursday&#39;,

&#39;ThursdayNight&#39;,

&#39;Friday&#39;,

&#39;FridayNight&#39;,

&#39;Saturday&#39;,

&#39;SaturdayNight&#39;,

&#39;Sunday&#39;,

&#39;SundayNight&#39;]&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As we can see above, our technique gets us each of the period names, in order.&lt;/p&gt;
&lt;p&gt;We can apply the same technique to get the other three fields:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;short_descs &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;sd&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get_text&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; sd &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; seven_day&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;select&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.tombstone-container .short-desc&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;

temps &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;t&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;get_text&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; t &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; seven_day&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;select&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.tombstone-container .temp&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;

descs &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;d&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;for&lt;/span&gt; d &lt;span class=&quot;token keyword&quot;&gt;in&lt;/span&gt; seven_day&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;select&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;.tombstone-container img&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;short_descs&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;temps&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;descs&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;[&#39;Mostly Clear&#39;, &#39;Sunny&#39;, &#39;Mostly Clear&#39;, &#39;Sunny&#39;, &#39;Slight ChanceRain&#39;, &#39;Rain Likely&#39;, &#39;Rain Likely&#39;, &#39;Rain Likely&#39;, &#39;Chance Rain&#39;]

[&#39;Low: 49 °F&#39;, &#39;High: 63 °F&#39;, &#39;Low: 50 °F&#39;, &#39;High: 67 °F&#39;, &#39;Low: 57 °F&#39;, &#39;High: 64 °F&#39;, &#39;Low: 57 °F&#39;, &#39;High: 64 °F&#39;, &#39;Low: 55 °F&#39;]

[&#39;Tonight: Mostly clear, with a low around 49. West northwest wind 12 to 17 mph decreasing to 6 to 11 mph after midnight. Winds could gust as high as 23 mph. &#39;, &#39;Thursday: Sunny, with a high near 63. North wind 3 to 5 mph. &#39;, &#39;Thursday Night: Mostly clear, with a low around 50. Light and variable wind becoming east southeast 5 to 8 mph after midnight. &#39;, &#39;Friday: Sunny, with a high near 67. Southeast wind around 9 mph. &#39;, &#39;Friday Night: A 20 percent chance of rain after 11pm. Partly cloudy, with a low around 57. South southeast wind 13 to 15 mph, with gusts as high as 20 mph. New precipitation amounts of less than a tenth of an inch possible. &#39;, &#39;Saturday: Rain likely. Cloudy, with a high near 64. Chance of precipitation is 70%. New precipitation amounts between a quarter and half of an inch possible. &#39;, &#39;Saturday Night: Rain likely. Cloudy, with a low around 57. Chance of precipitation is 60%.&#39;, &#39;Sunday: Rain likely. Cloudy, with a high near 64.&#39;, &#39;Sunday Night: A chance of rain. Mostly cloudy, with a low around 55.&#39;]&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Combining our data into a Pandas Dataframe&lt;/h2&gt;
&lt;p&gt;We can now combine the data into a &lt;a href=&quot;https://pandas.pydata.org/&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;Pandas&lt;/a&gt; DataFrame and analyze it. A DataFrame is an object that can store tabular data, making data analysis easy. If you want to learn more about Pandas, check out our free to start course &lt;a href=&quot;https://www.dataquest.io/course/python-for-data-science-intermediate/&quot; style=&quot;outline: none;&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In order to do this, we’ll call the &lt;a href=&quot;https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html&quot; style=&quot;outline: currentcolor none medium;&quot;&gt;DataFrame&lt;/a&gt; class, and pass in each list of items that we have. We pass them in as part of a dictionary.&lt;/p&gt;
&lt;p&gt;Each dictionary key will become a column in the DataFrame, and each list will become the values in the column:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;import&lt;/span&gt; pandas &lt;span class=&quot;token keyword&quot;&gt;as&lt;/span&gt; pd

weather &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; pd&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;DataFrame&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;

    &lt;span class=&quot;token string&quot;&gt;&quot;period&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; periods&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;

    &lt;span class=&quot;token string&quot;&gt;&quot;short_desc&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; short_descs&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;

    &lt;span class=&quot;token string&quot;&gt;&quot;temp&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; temps&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;

    &lt;span class=&quot;token string&quot;&gt;&quot;desc&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;descs

&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

weather&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;desc&lt;/th&gt;
&lt;th&gt;period&lt;/th&gt;
&lt;th&gt;short_desc&lt;/th&gt;
&lt;th&gt;temp&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;Tonight: Mostly clear, with a low around 49. W…&lt;/td&gt;
&lt;td&gt;Tonight&lt;/td&gt;
&lt;td&gt;Mostly Clear&lt;/td&gt;
&lt;td&gt;Low: 49 °F&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Thursday: Sunny, with a high near 63. North wi…&lt;/td&gt;
&lt;td&gt;Thursday&lt;/td&gt;
&lt;td&gt;Sunny&lt;/td&gt;
&lt;td&gt;High: 63 °F&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Thursday Night: Mostly clear, with a low aroun…&lt;/td&gt;
&lt;td&gt;ThursdayNight&lt;/td&gt;
&lt;td&gt;Mostly Clear&lt;/td&gt;
&lt;td&gt;Low: 50 °F&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Friday: Sunny, with a high near 67. Southeast …&lt;/td&gt;
&lt;td&gt;Friday&lt;/td&gt;
&lt;td&gt;Sunny&lt;/td&gt;
&lt;td&gt;High: 67 °F&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Friday Night: A 20 percent chance of rain afte…&lt;/td&gt;
&lt;td&gt;FridayNight&lt;/td&gt;
&lt;td&gt;Slight ChanceRain&lt;/td&gt;
&lt;td&gt;Low: 57 °F&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Saturday: Rain likely. Cloudy, with a high ne…&lt;/td&gt;
&lt;td&gt;Saturday&lt;/td&gt;
&lt;td&gt;Rain Likely&lt;/td&gt;
&lt;td&gt;High: 64 °F&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Saturday Night: Rain likely. Cloudy, with a l…&lt;/td&gt;
&lt;td&gt;SaturdayNight&lt;/td&gt;
&lt;td&gt;Rain Likely&lt;/td&gt;
&lt;td&gt;Low: 57 °F&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;Sunday: Rain likely. Cloudy, with a high near…&lt;/td&gt;
&lt;td&gt;Sunday&lt;/td&gt;
&lt;td&gt;Rain Likely&lt;/td&gt;
&lt;td&gt;High: 64 °F&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;Sunday Night: A chance of rain. Mostly cloudy…&lt;/td&gt;
&lt;td&gt;SundayNight&lt;/td&gt;
&lt;td&gt;Chance Rain&lt;/td&gt;
&lt;td&gt;Low: 55 °F&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;We can now do some analysis on the data. For example, we can use a &lt;a href=&quot;https://app.dataquest.io/m/354/&quot; rel=&quot;noopener&quot; target=&quot;_blank&quot;&gt;regular expression&lt;/a&gt; and the &lt;a href=&quot;https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.str.extract.html&quot;&gt;Series.str.extract&lt;/a&gt; method to pull out the numeric temperature values:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;temp_nums &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; weather&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;temp&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;str&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;extract&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;(?Pd+)&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; expand&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token boolean&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

weather&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;temp_num&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; temp_nums&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;astype&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;int&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

temp_nums&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;0 49

1 63

2 50

3 67

4 57

5 64

6 57

7 64

8 55

Name: temp_num, dtype: object&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We could then find the mean of all the high and low temperatures:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;weather&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;temp_num&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;mean&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;58.444444444444443&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We could also only select the rows that happen at night:&lt;/p&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;is_night &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; weather&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;temp&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;str&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;contains&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Low&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;

weather&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;is_night&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; is_night

is_night&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;0 True

1 False

2 True

3 False

4 True

5 False

6 True

7 False

8 True

Name: temp, dtype: bool&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;weather&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;is_night&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;0 True

1 False

2 True

3 False

4 True

5 False

6 True

7 False

8 True

Name: temp, dtype: bool&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-bordered&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;desc&lt;/th&gt;
&lt;th&gt;period&lt;/th&gt;
&lt;th&gt;short_desc&lt;/th&gt;
&lt;th&gt;temp&lt;/th&gt;
&lt;th&gt;temp_num&lt;/th&gt;
&lt;th&gt;is_night&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;Tonight: Mostly clear, with a low around 49. W…&lt;/td&gt;
&lt;td&gt;Tonight&lt;/td&gt;
&lt;td&gt;Mostly Clear&lt;/td&gt;
&lt;td&gt;Low: 49 °F&lt;/td&gt;
&lt;td&gt;49&lt;/td&gt;
&lt;td&gt;True&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Thursday Night: Mostly clear, with a low aroun…&lt;/td&gt;
&lt;td&gt;ThursdayNight&lt;/td&gt;
&lt;td&gt;Mostly Clear&lt;/td&gt;
&lt;td&gt;Low: 50 °F&lt;/td&gt;
&lt;td&gt;50&lt;/td&gt;
&lt;td&gt;True&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Friday Night: A 20 percent chance of rain afte…&lt;/td&gt;
&lt;td&gt;FridayNight&lt;/td&gt;
&lt;td&gt;Slight ChanceRain&lt;/td&gt;
&lt;td&gt;Low: 57 °F&lt;/td&gt;
&lt;td&gt;57&lt;/td&gt;
&lt;td&gt;True&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Saturday Night: Rain likely. Cloudy, with a l…&lt;/td&gt;
&lt;td&gt;SaturdayNight&lt;/td&gt;
&lt;td&gt;Rain Likely&lt;/td&gt;
&lt;td&gt;Low: 57 °F&lt;/td&gt;
&lt;td&gt;57&lt;/td&gt;
&lt;td&gt;True&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;Sunday Night: A chance of rain. Mostly cloudy…&lt;/td&gt;
&lt;td&gt;SundayNight&lt;/td&gt;
&lt;td&gt;Chance Rain&lt;/td&gt;
&lt;td&gt;Low: 55 °F&lt;/td&gt;
&lt;td&gt;55&lt;/td&gt;
&lt;td&gt;True&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h2&gt;Next Steps For This Web Scraping Project&lt;/h2&gt;
&lt;p&gt;If you’ve made it this far, congratulations! You should now have a good understanding of how to scrape web pages and extract data. Of course, there’s still a lot more to learn!&lt;/p&gt;
&lt;p&gt;If you want to go further, a good next step would be to pick a site and try some web scraping on your own. Some good examples of data to scrape are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;News articles&lt;/li&gt;
&lt;li&gt;Sports scores&lt;/li&gt;
&lt;li&gt;Weather forecasts&lt;/li&gt;
&lt;li&gt;Stock prices&lt;/li&gt;
&lt;li&gt;Online retailer prices&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You may also want to keep scraping the National Weather Service, and see what other data you can extract from the page, or about your own city.&lt;/p&gt;
&lt;p&gt;Alternatively, if you want to take your web scraping skills to the next level, you can check out our interactive course, which covers both the basics of web scraping and using Python to connect to APIs. With those two skills under your belt, you’ll be able to collect lots of unique and interesting datasets from sites all over the web!&lt;/p&gt;



&lt;/article&gt;</description><link>https://coderpad.blogspot.com/2022/11/tutorial-web-scraping-with-python-using.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4726615324507041850.post-683562737291381205</guid><pubDate>Tue, 01 Nov 2022 04:07:00 +0000</pubDate><atom:updated>2022-11-01T08:41:55.111-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">How to Configure Network Settings in Ubuntu</category><title>How to Configure Network Settings in Ubuntu</title><description>&lt;article class=&quot;post-4642 post type-post status-publish format-standard has-post-thumbnail hentry category-linux category-shell category-ubuntu&quot; id=&quot;post-4642&quot;&gt;
&lt;div class=&quot;entry-content clearfix&quot;&gt;
&lt;p&gt;When installing an Ubuntu server or desktop, it is important to know how to configure and view network settings. It’s also useful for troubleshooting problems with your Internet connection. Basic network configuration includes setting the IP address, the subnet mask for internal communication and a gateway for connecting to external networks. In this article, I’ll give you examples of the basic configuration you need to set up a network in Ubuntu, either from the command line or from the Ubuntu Network Manager GUI. The steps have been tested on Ubuntu 18.04 LTS up to &lt;b&gt;Ubuntu 22.04 LTS&lt;/b&gt;, but will also work on newer Ubuntu versions.&lt;/p&gt;
&lt;p&gt;Basic network setup requires:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Setting/Changing an IP address&lt;/li&gt;
&lt;li&gt;Setting up/Changing Hostname&lt;/li&gt;
&lt;li&gt;Editing a hosts file&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Setting/Changing an IP address&lt;/h2&gt;
&lt;p&gt;There are several ways to set an IP address in Ubuntu. You can configure the network interface to use dynamic IP using a DHCP server or you can manually set a static IP address&lt;b&gt;.&lt;/b&gt;&lt;/p&gt;
&lt;h3&gt;Method #1: Network configuration on the command line&lt;/h3&gt;
&lt;p&gt;In Ubuntu, you can set your IP address through terminal commands.&lt;/p&gt;
&lt;p&gt;First type &lt;b&gt;netstat -I&lt;/b&gt; to find the interface name. Then type the below command:&lt;/p&gt;
&lt;pre&gt;sudo ifconfig eth0 192.168.72.6 netmask 255.255.255.0&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Configure network address using ifconfig command&quot; class=&quot;aligncenter wp-image-4643 size-large&quot; height=&quot;111&quot; sizes=&quot;(max-width: 750px) 100vw, 750px&quot; src=&quot;https://vitux.com/wp-content/uploads/2019/04/word-image-147-1024x151.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2019/04/word-image-147-1024x151.png 1024w, https://vitux.com/wp-content/uploads/2019/04/word-image-147-300x44.png 300w, https://vitux.com/wp-content/uploads/2019/04/word-image-147-768x114.png 768w, https://vitux.com/wp-content/uploads/2019/04/word-image-147.png 1427w&quot; width=&quot;750&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Then to add a default gateway, add the below command:&lt;/p&gt;
&lt;pre&gt;sudo route add default gw 192.168.72.1 eth0&lt;/pre&gt;
  &lt;script async=&quot;&quot; crossorigin=&quot;anonymous&quot; src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8515204584571597&quot;&gt;&lt;/script&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-8515204584571597&quot; data-ad-format=&quot;fluid&quot; data-ad-layout=&quot;in-article&quot; data-ad-slot=&quot;6285636000&quot; style=&quot;display: block; text-align: center;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
     (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;p&gt;&lt;img alt=&quot;Set default gateway in Ubuntu Network config&quot; class=&quot;aligncenter wp-image-4644 size-large&quot; height=&quot;124&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 750px) 100vw, 750px&quot; src=&quot;https://vitux.com/wp-content/uploads/2019/04/word-image-148-1024x169.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2019/04/word-image-148-1024x169.png 1024w, https://vitux.com/wp-content/uploads/2019/04/word-image-148-300x50.png 300w, https://vitux.com/wp-content/uploads/2019/04/word-image-148-768x127.png 768w, https://vitux.com/wp-content/uploads/2019/04/word-image-148.png 1531w&quot; width=&quot;750&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Method #2: Network configuration using the GUI&lt;/h3&gt;
&lt;p&gt;You can set an IP address via the graphical user interface in Ubuntu. From the desktop, click on the start menu and search for &lt;b&gt;Settings&lt;/b&gt;. From the Settings window, click on the &lt;b&gt;Network&lt;/b&gt; tab&lt;b&gt;. &lt;/b&gt;Then from the right pane, select the interface and click on the gear icon to open settings for that interface.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;img alt=&quot;Network configuration using Ubuntu GUI&quot; class=&quot;aligncenter wp-image-4645 size-large&quot; height=&quot;422&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 750px) 100vw, 750px&quot; src=&quot;https://vitux.com/wp-content/uploads/2019/04/word-image-149-1024x576.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2019/04/word-image-149-1024x576.png 1024w, https://vitux.com/wp-content/uploads/2019/04/word-image-149-300x169.png 300w, https://vitux.com/wp-content/uploads/2019/04/word-image-149-768x432.png 768w, https://vitux.com/wp-content/uploads/2019/04/word-image-149.png 1379w&quot; width=&quot;750&quot; /&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;From the &lt;b&gt;IPv4&lt;/b&gt; tab, you can select the &lt;b&gt;Automatic (DHCP)&lt;/b&gt; radio button to allow the system to dynamically obtain the IP address.&lt;/p&gt;
  &lt;script async=&quot;&quot; crossorigin=&quot;anonymous&quot; src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8515204584571597&quot;&gt;&lt;/script&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-8515204584571597&quot; data-ad-format=&quot;fluid&quot; data-ad-layout=&quot;in-article&quot; data-ad-slot=&quot;3671065048&quot; style=&quot;display: block; text-align: center;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
     (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;p&gt;&lt;img alt=&quot;Get IP address using DHCP&quot; class=&quot;aligncenter wp-image-4646 size-large&quot; height=&quot;422&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 750px) 100vw, 750px&quot; src=&quot;https://vitux.com/wp-content/uploads/2019/04/word-image-150-1024x576.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2019/04/word-image-150-1024x576.png 1024w, https://vitux.com/wp-content/uploads/2019/04/word-image-150-300x169.png 300w, https://vitux.com/wp-content/uploads/2019/04/word-image-150-768x432.png 768w, https://vitux.com/wp-content/uploads/2019/04/word-image-150.png 1379w&quot; width=&quot;750&quot; /&gt;&lt;/p&gt;
&lt;p&gt;If you want to set a static IP address, click on the &lt;b&gt;Manual&lt;/b&gt; radio button. Enter the IP address, subnet mask, and a default gateway. Then click on &lt;b&gt;Apply&lt;/b&gt; to save the current changes.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Manual IPv4 address configuration&quot; class=&quot;aligncenter wp-image-4647 size-large&quot; height=&quot;422&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 750px) 100vw, 750px&quot; src=&quot;https://vitux.com/wp-content/uploads/2019/04/word-image-151-1024x576.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2019/04/word-image-151-1024x576.png 1024w, https://vitux.com/wp-content/uploads/2019/04/word-image-151-300x169.png 300w, https://vitux.com/wp-content/uploads/2019/04/word-image-151-768x432.png 768w, https://vitux.com/wp-content/uploads/2019/04/word-image-151.png 1379w&quot; width=&quot;750&quot; /&gt;&lt;/p&gt;
&lt;h3&gt;Method #3: Configure the network by editing /etc/interfaces file&lt;/h3&gt;
&lt;p&gt;Here is another method that you can use to configure the IP address. To set IP address dynamically, you have to edit &lt;b&gt;/etc/network/interfaces.&lt;/b&gt; In &lt;b&gt;/etc/network/interfaces&lt;/b&gt;, the basic configuration of interfaces is stored.&lt;/p&gt;
&lt;p&gt;Edit the &lt;b&gt;/etc/network/interfaces&lt;/b&gt; by entering the following command in terminal.&lt;/p&gt;
&lt;pre&gt;sudo nano /etc/network/interfaces&lt;/pre&gt;
&lt;p&gt;Then add the following lines:&lt;/p&gt;
&lt;pre&gt;auto eth1
  iface eth1 inet dhcp&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Add new eth1 interface&quot; class=&quot;aligncenter wp-image-4648 size-large&quot; height=&quot;422&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 750px) 100vw, 750px&quot; src=&quot;https://vitux.com/wp-content/uploads/2019/04/word-image-152-1024x576.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2019/04/word-image-152-1024x576.png 1024w, https://vitux.com/wp-content/uploads/2019/04/word-image-152-300x169.png 300w, https://vitux.com/wp-content/uploads/2019/04/word-image-152-768x432.png 768w, https://vitux.com/wp-content/uploads/2019/04/word-image-152.png 1379w&quot; width=&quot;750&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Save the file and restart networking services using the below command.&lt;/p&gt;
&lt;pre&gt;sudo systemctl restart networking&lt;/pre&gt;
&lt;p&gt;To set a Static IP address, you have to edit &lt;b&gt;/etc/network/interfaces&lt;/b&gt;&lt;/p&gt;
&lt;pre&gt; sudo nano /etc/network/interfaces&lt;/pre&gt;
&lt;p&gt;Add the below lines to &lt;b&gt;/etc/network/interfaces&lt;/b&gt;.&lt;/p&gt;
&lt;pre&gt;auto eth1
  iface eth1 inet static
  address 192.168.72.8
  netmask 255.255.255.0
  gateway 192.168.72.1
  dns-nameservers 8.8.8.8 4.4.2.2&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Static IP address configuration in /etc/interfaces file&quot; class=&quot;aligncenter wp-image-4649 size-large&quot; height=&quot;422&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 750px) 100vw, 750px&quot; src=&quot;https://vitux.com/wp-content/uploads/2019/04/word-image-153-1024x576.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2019/04/word-image-153-1024x576.png 1024w, https://vitux.com/wp-content/uploads/2019/04/word-image-153-300x169.png 300w, https://vitux.com/wp-content/uploads/2019/04/word-image-153-768x432.png 768w, https://vitux.com/wp-content/uploads/2019/04/word-image-153.png 1379w&quot; width=&quot;750&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Save the file and restart networking services.&lt;/p&gt;
&lt;pre&gt;sudo systemctl restart networking&lt;/pre&gt;
&lt;h2&gt;Setting up/Changing Hostname&lt;/h2&gt;
&lt;p&gt;The hostname of Ubuntu OS is configured in the file &lt;b&gt;/etc/hostname&lt;/b&gt;.&lt;/p&gt;
&lt;p&gt;To edit &lt;b&gt;/etc/hostname&lt;/b&gt;, enter the below command:&lt;/p&gt;
&lt;pre&gt;sudo nano /etc/hostname&lt;/pre&gt;
&lt;p&gt;This file contains only the hostname of the file, change the name, and then save it.&lt;/p&gt;
  &lt;script async=&quot;&quot; crossorigin=&quot;anonymous&quot; src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8515204584571597&quot;&gt;&lt;/script&gt;
&lt;ins class=&quot;adsbygoogle&quot; data-ad-client=&quot;ca-pub-8515204584571597&quot; data-ad-format=&quot;fluid&quot; data-ad-layout=&quot;in-article&quot; data-ad-slot=&quot;7729745465&quot; style=&quot;display: block; text-align: center;&quot;&gt;&lt;/ins&gt;
&lt;script&gt;
     (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;p&gt;&lt;img alt=&quot;Edit Ubuntu hostname&quot; class=&quot;aligncenter wp-image-4650 size-large&quot; height=&quot;422&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 750px) 100vw, 750px&quot; src=&quot;https://vitux.com/wp-content/uploads/2019/04/word-image-154-1024x576.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2019/04/word-image-154-1024x576.png 1024w, https://vitux.com/wp-content/uploads/2019/04/word-image-154-300x169.png 300w, https://vitux.com/wp-content/uploads/2019/04/word-image-154-768x432.png 768w, https://vitux.com/wp-content/uploads/2019/04/word-image-154.png 1379w&quot; width=&quot;750&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Editing the /etc/hosts file&lt;/h2&gt;
&lt;p&gt;Hosts file maps hostname to IP address locally. For instance, you have a server in your local network, instead of remembering its IP, you can map its IP with a name in your /etc/hosts file. It will allow you to access that machine with a name instead of the IP.&lt;/p&gt;
&lt;p&gt;To edit a hosts file, enter:&lt;/p&gt;
&lt;pre&gt;sudo nano /etc/hosts&lt;/pre&gt;
&lt;p&gt;Add the server IP address and name in the hosts file in the following format.&lt;/p&gt;
&lt;pre&gt;192.168.72.10 fileserver&lt;/pre&gt;
&lt;p&gt;&lt;img alt=&quot;Set hostname in /etc/hosts file&quot; class=&quot;wp-image-4651 size-large aligncenter&quot; height=&quot;422&quot; loading=&quot;lazy&quot; sizes=&quot;(max-width: 750px) 100vw, 750px&quot; src=&quot;https://vitux.com/wp-content/uploads/2019/04/word-image-155-1024x576.png&quot; srcset=&quot;https://vitux.com/wp-content/uploads/2019/04/word-image-155-1024x576.png 1024w, https://vitux.com/wp-content/uploads/2019/04/word-image-155-300x169.png 300w, https://vitux.com/wp-content/uploads/2019/04/word-image-155-768x432.png 768w, https://vitux.com/wp-content/uploads/2019/04/word-image-155.png 1379w&quot; width=&quot;750&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Save the file and reboot the system to apply the changes.&lt;/p&gt;
&lt;p&gt;That’s all you need to set up a network in Ubuntu. Those were the basic settings. There are many more options you can configure in your Ubuntu machine.&lt;/p&gt;
&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;How to Configure Network Settings in Ubuntu&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;read coderpad profiles:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;http://www.lawrence.com/users/coderpad/&quot;&gt;http://www.lawrence.com/users/coderpad/&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&lt;a href=&quot;https://www.scribd.com/document/601722224/Coderpad&quot;&gt;https://www.scribd.com/document/601722224/Coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&quot;&gt;https://issuu.com/coderpad/docs/coderpad-blogspot-com-&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://linktr.ee/coderpad&quot;&gt;https://linktr.ee/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.pearltrees.com/coderpad&quot;&gt;https://www.pearltrees.com/coderpad&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://www.akonter.com/user/profile/coderpad&quot;&gt;https://www.akonter.com/user/profile/coderpad&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;extra-hatom-entry-title&quot;&gt;&lt;span class=&quot;entry-title&quot;&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;

&lt;/article&gt;</description><link>https://coderpad.blogspot.com/2022/10/how-to-configure-network-settings-in.html</link><author>noreply@blogger.com (Nick)</author><thr:total>0</thr:total></item></channel></rss>