<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux Interview Questions and Answers - Techyaz.com</title>
	<atom:link href="https://techyaz.com/tag/linux-interview-questions-and-answers/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Tips, Tutorials and How-to Topics</description>
	<lastBuildDate>Tue, 20 Mar 2018 11:44:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>

<image>
	<url>https://techyaz.com/wp-content/uploads/2017/11/cropped-Site-icon-150x150.png</url>
	<title>Linux Interview Questions and Answers - Techyaz.com</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>11 Examples of ls Command to List Files in Linux</title>
		<link>https://techyaz.com/linux/11-examples-ls-command-list-files-linux/</link>
					<comments>https://techyaz.com/linux/11-examples-ls-command-list-files-linux/#respond</comments>
		
		<dc:creator><![CDATA[Angelo Marquez]]></dc:creator>
		<pubDate>Tue, 20 Mar 2018 10:21:41 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[RedHat Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Linux Commands]]></category>
		<category><![CDATA[Linux Interview Questions and Answers]]></category>
		<category><![CDATA[Linux Tools]]></category>
		<guid isPermaLink="false">http://techyaz.com/?p=1958</guid>

					<description><![CDATA[<p>Normally, the work of system administrators consists of an almost permanent use of the terminal; this is because servers with GNU/LINUX-based systems, for security reasons, do not have a graphical desktop environment. And this means that we have to use&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/linux/11-examples-ls-command-list-files-linux/">11 Examples of ls Command to List Files in Linux</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Normally, the work of system administrators consists of an almost permanent use of the terminal; this is because servers with GNU/LINUX-based systems, for security reasons, do not have a graphical desktop environment. And this means that we have to use the terminal for basically everything from the simplest or most complex tasks. Today we will learn the <strong>ls</strong> command utility that allows us to list files and folders from the terminal. Here we will also describe different combinations and options that can be used with ls command to get different output.</p>
<h3><span style="color: #333399;"><strong>LIST FILES IN LINUX: &#8220;ls&#8221; COMMAND</strong></span><strong> </strong></h3>
<p>As it was said, the command <strong>ls</strong> allows you to list files and folders of a specific path, is easy to use and is very useful and used in the daily work. The command has several options to improve the listings. In a terminal, we can invoke the help of the command <strong>ls</strong> in this way.</p>
<pre><span style="color: #0000ff;"><strong>ls --help</strong><strong> </strong></span></pre>
<p>Above command will display all options available for ls command to list the files and folders. In this way we get the syntax of usage and options as output per terminal.</p>
<p><img fetchpriority="high" decoding="async" class="aligncenter size-full wp-image-1959" src="http://techyaz.com/wp-content/uploads/2018/03/1-ls-cmd-min.png" alt="List all ls command options" width="758" height="736" srcset="https://techyaz.com/wp-content/uploads/2018/03/1-ls-cmd-min.png 758w, https://techyaz.com/wp-content/uploads/2018/03/1-ls-cmd-min-300x291.png 300w" sizes="(max-width: 758px) 100vw, 758px" /></p>
<p>As all options will not cover in one single screenshot so i have scrolled the above screen and taken another screenshots to cover all options in screenshots that has been displayed below.</p>
<p><img decoding="async" class="aligncenter size-full wp-image-1960" src="http://techyaz.com/wp-content/uploads/2018/03/2-ls-cmd-min.png" alt="Display all ls command options" width="764" height="736" srcset="https://techyaz.com/wp-content/uploads/2018/03/2-ls-cmd-min.png 764w, https://techyaz.com/wp-content/uploads/2018/03/2-ls-cmd-min-300x289.png 300w" sizes="(max-width: 764px) 100vw, 764px" /></p>
<p><img decoding="async" class="aligncenter size-full wp-image-1961" src="http://techyaz.com/wp-content/uploads/2018/03/3-ls-cmd-min.png" alt="Display all ls command options" width="750" height="736" srcset="https://techyaz.com/wp-content/uploads/2018/03/3-ls-cmd-min.png 750w, https://techyaz.com/wp-content/uploads/2018/03/3-ls-cmd-min-300x294.png 300w" sizes="(max-width: 750px) 100vw, 750px" /></p>
<p>As we can see the documentation is extensive, but don&#8217;t worry we will examine the most useful and used options. The basic syntax of the command is:</p>
<pre><span style="color: #0000ff;"><strong>ls [options] [file|dir]</strong></span></pre>
<p>Although it is possible to use ls from the most basic form only by typing:</p>
<pre><span style="color: #008000;"><strong>#List files from your given directory.</strong></span>
<span style="color: #0000ff;"><strong>ls</strong></span></pre>
<p>With this we only list the files that are in the directory where we are located in the terminal. For example, if we wanted to list everything in the root directory of our GNU/LINUX distribution it would be with the command:</p>
<pre><span style="color: #008000;"><strong>#List everything in the root directory</strong></span>
<span style="color: #0000ff;"><strong>ls /</strong></span></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1962" src="http://techyaz.com/wp-content/uploads/2018/03/4-ls-cmd-min-1024x150.png" alt="Run ls / to display all directories" width="1024" height="150" srcset="https://techyaz.com/wp-content/uploads/2018/03/4-ls-cmd-min-1024x150.png 1024w, https://techyaz.com/wp-content/uploads/2018/03/4-ls-cmd-min-300x44.png 300w, https://techyaz.com/wp-content/uploads/2018/03/4-ls-cmd-min-768x112.png 768w, https://techyaz.com/wp-content/uploads/2018/03/4-ls-cmd-min.png 1366w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></p>
<p>It was easy, wasn&#8217;t it?</p>
<h5><span style="color: #993300;">Most Important Options of the Command &#8220;ls&#8221;</span></h5>
<p><strong>ls</strong> as well as all GNU/LINUX commands have options that modify the basic command execution result. Here is a list of the most outstanding ones for this command.</p>
<table style="height: 441px;" width="784">
<tbody>
<tr>
<td width="198"><strong>Options</strong></td>
<td width="374"><strong>Description</strong></td>
</tr>
<tr>
<td width="198">-a</td>
<td width="374"> Do not ignore entries starting with .</td>
</tr>
<tr>
<td width="198">-A</td>
<td width="374"> Do not list implied . And ..</td>
</tr>
<tr>
<td width="198">-d</td>
<td width="374">List directories themselves, not their contents</td>
</tr>
<tr>
<td width="198">-i</td>
<td width="374">print the index number of each file</td>
</tr>
<tr>
<td width="198">-l</td>
<td width="374">Use a long listing format.  Displays information such as permissions and owner of the folder or file.</td>
</tr>
<tr>
<td width="198">-r</td>
<td width="374">reverse order while sorting</td>
</tr>
<tr>
<td width="198">-R</td>
<td width="374">List subdirectories recursively.  Displays the contents of the directory subfolders.</td>
</tr>
<tr>
<td width="198">-s</td>
<td width="374">print the allocated size of each file, in blocks</td>
</tr>
<tr>
<td width="198">-S</td>
<td width="374">sort by file size, largest first</td>
</tr>
<tr>
<td width="198">-t</td>
<td width="374">sort by modification time, newest first</td>
</tr>
<tr>
<td width="198">-U</td>
<td width="374">do not sort; list entries in directory order</td>
</tr>
<tr>
<td style="text-align: left;" width="198">-X</td>
<td style="text-align: left;" width="374">sort alphabetically by entry extension</td>
</tr>
</tbody>
</table>
<h3><span style="color: #333399;"> Examples of Command &#8220;ls&#8221;</span></h3>
<p>Here i have given different examples of command ls that you can use to fulfill different requirements.</p>
<h5><span style="color: #993300;">List Hidden Files </span></h5>
<p>We can use option -a if we want to list the hidden files of a specific folder, it would be enough to write:</p>
<pre><span style="color: #0000ff;"><strong>ls –a path</strong></span></pre>
<p>In my case it would be something like that:</p>
<pre><span style="color: #0000ff;"><strong>ls –a /home/angelo/</strong></span></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1963" src="http://techyaz.com/wp-content/uploads/2018/03/5-ls-cmd-min-1024x217.png" alt="list hidden files in Linux" width="1024" height="217" srcset="https://techyaz.com/wp-content/uploads/2018/03/5-ls-cmd-min-1024x217.png 1024w, https://techyaz.com/wp-content/uploads/2018/03/5-ls-cmd-min-300x63.png 300w, https://techyaz.com/wp-content/uploads/2018/03/5-ls-cmd-min-768x162.png 768w, https://techyaz.com/wp-content/uploads/2018/03/5-ls-cmd-min.png 1182w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></p>
<p>You can see all hidden files as well in above screenshot. We can identify hidden files by looking at the output as such files or folders start with dot (.).</p>
<h5><span style="color: #993300;">Display Files with their Index Number</span></h5>
<p>We can list files with their index number by running below command. To show files/folders with their index number we will use the option –i along with command ls. You can see i have used below command and output is showing in below image.</p>
<pre><span style="color: #0000ff;"><strong>ls -i /home/angelo/
</strong></span><strong><em> </em></strong></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1964" src="http://techyaz.com/wp-content/uploads/2018/03/6-ls-cmd-min-1024x195.png" alt="List folders with index number" width="1024" height="195" srcset="https://techyaz.com/wp-content/uploads/2018/03/6-ls-cmd-min-1024x195.png 1024w, https://techyaz.com/wp-content/uploads/2018/03/6-ls-cmd-min-300x57.png 300w, https://techyaz.com/wp-content/uploads/2018/03/6-ls-cmd-min-768x147.png 768w, https://techyaz.com/wp-content/uploads/2018/03/6-ls-cmd-min.png 1142w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></p>
<h5><span style="color: #993300;">List Files with full Details (Permissions, Index no, Owner, Create Date etc.)</span></h5>
<p>We can use ls command to display information such as permissions and owner of the folder or file. We will be using option -I to show complete information about files and folders as shown in below screenshot.</p>
<pre><span style="color: #0000ff;"><strong>ls -l /home/angelo/</strong></span></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1965" src="http://techyaz.com/wp-content/uploads/2018/03/7-ls-cmd-min.png" alt="Display all details of folders and files" width="778" height="462" srcset="https://techyaz.com/wp-content/uploads/2018/03/7-ls-cmd-min.png 778w, https://techyaz.com/wp-content/uploads/2018/03/7-ls-cmd-min-300x178.png 300w, https://techyaz.com/wp-content/uploads/2018/03/7-ls-cmd-min-768x456.png 768w" sizes="auto, (max-width: 778px) 100vw, 778px" /></p>
<p>This output shows us more specific information about what we have in the folder: First it shows the permissions on the folder, its index number, the owner of the folder, who created the folder, its size in kb, the date it was modified and the folder name.</p>
<h5><span style="color: #993300;">List Files or Folders in a Reverse Order</span></h5>
<p>ls command also gives an option to sort files and folders in reverse order. We can use -r option to show files and folders in a reverse order as shown in below screenshot after running below command.</p>
<pre><span style="color: #0000ff;"><strong>ls –r  /home/angelo/</strong></span></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1966" src="http://techyaz.com/wp-content/uploads/2018/03/8-ls-cmd-min-1024x139.png" alt="Display files and folders in reverse order" width="1024" height="139" srcset="https://techyaz.com/wp-content/uploads/2018/03/8-ls-cmd-min-1024x139.png 1024w, https://techyaz.com/wp-content/uploads/2018/03/8-ls-cmd-min-300x41.png 300w, https://techyaz.com/wp-content/uploads/2018/03/8-ls-cmd-min-768x105.png 768w, https://techyaz.com/wp-content/uploads/2018/03/8-ls-cmd-min.png 1366w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></p>
<h5><span style="color: #993300;">List Subdirectories Recursively</span></h5>
<p>We can List subdirectories recursively by adding the -R option with ls command.  It will display the contents of the directory subfolders. Run below command to display the result.</p>
<pre><span style="color: #0000ff;"><strong>ls –R /home/angelo/</strong></span></pre>
<h5><strong><em> </em></strong><span style="color: #993300;">Display list of Directories Only</span></h5>
<p>We can use -d and an asterisk option to list and show only the directories. Have a look at below command that has displayed the list of directories under /home/angelo.</p>
<pre><span style="color: #0000ff;"><strong>ls –d */home/angelo/</strong></span></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1967" src="http://techyaz.com/wp-content/uploads/2018/03/9-ls-cmd-min.png" alt="Show directories with astrick" width="980" height="184" srcset="https://techyaz.com/wp-content/uploads/2018/03/9-ls-cmd-min.png 980w, https://techyaz.com/wp-content/uploads/2018/03/9-ls-cmd-min-300x56.png 300w, https://techyaz.com/wp-content/uploads/2018/03/9-ls-cmd-min-768x144.png 768w" sizes="auto, (max-width: 980px) 100vw, 980px" /></p>
<h5><span style="color: #993300;">Display Files Sort by their File Size</span></h5>
<p>Run below command to display files sort by file size. It is possible with the option –S.</p>
<pre><span style="color: #0000ff;"><strong>ls -S /home/angelo/</strong></span></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1968" src="http://techyaz.com/wp-content/uploads/2018/03/10-ls-cmd-min-1024x145.png" alt="Display files sort by file size" width="1024" height="145" srcset="https://techyaz.com/wp-content/uploads/2018/03/10-ls-cmd-min-1024x145.png 1024w, https://techyaz.com/wp-content/uploads/2018/03/10-ls-cmd-min-300x42.png 300w, https://techyaz.com/wp-content/uploads/2018/03/10-ls-cmd-min-768x108.png 768w, https://techyaz.com/wp-content/uploads/2018/03/10-ls-cmd-min.png 1260w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></p>
<h5><span style="color: #993300;">Sort by Date/Time</span></h5>
<p>We can option -t to display files sort by date/time. Run below command to see the output that is also showing in below screenshot.</p>
<pre><span style="color: #0000ff;"><strong>ls –t /home/angelo/</strong></span></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1969" src="http://techyaz.com/wp-content/uploads/2018/03/11-ls-cmd-min-1024x152.png" alt="Display files sort by date time" width="1024" height="152" srcset="https://techyaz.com/wp-content/uploads/2018/03/11-ls-cmd-min-1024x152.png 1024w, https://techyaz.com/wp-content/uploads/2018/03/11-ls-cmd-min-300x45.png 300w, https://techyaz.com/wp-content/uploads/2018/03/11-ls-cmd-min-768x114.png 768w, https://techyaz.com/wp-content/uploads/2018/03/11-ls-cmd-min.png 1252w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></p>
<h5><span style="color: #993300;">Display Files as they were Created</span></h5>
<p>Use option -U to show folders and files in no order at all. It will display just as they are created.</p>
<pre><span style="color: #0000ff;"><strong>ls –U /home/angelo/</strong></span></pre>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-1970 size-large" src="http://techyaz.com/wp-content/uploads/2018/03/12-ls-cmd-min-1024x132.png" alt="Display Files as they were created" width="1024" height="132" srcset="https://techyaz.com/wp-content/uploads/2018/03/12-ls-cmd-min-1024x132.png 1024w, https://techyaz.com/wp-content/uploads/2018/03/12-ls-cmd-min-300x39.png 300w, https://techyaz.com/wp-content/uploads/2018/03/12-ls-cmd-min-768x99.png 768w, https://techyaz.com/wp-content/uploads/2018/03/12-ls-cmd-min.png 1366w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></p>
<h5><span style="color: #993300;">Sort by File Extension</span></h5>
<p>We can use option -X with ls command to sort files by their extension names. You can see this in below screenshot.</p>
<pre><span style="color: #0000ff;"><strong>ls –X /home/angelo/</strong></span></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1971" src="http://techyaz.com/wp-content/uploads/2018/03/13-ls-cmd-min-1024x142.png" alt="Display files sort by file extension" width="1024" height="142" srcset="https://techyaz.com/wp-content/uploads/2018/03/13-ls-cmd-min-1024x142.png 1024w, https://techyaz.com/wp-content/uploads/2018/03/13-ls-cmd-min-300x42.png 300w, https://techyaz.com/wp-content/uploads/2018/03/13-ls-cmd-min-768x107.png 768w, https://techyaz.com/wp-content/uploads/2018/03/13-ls-cmd-min.png 1366w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></p>
<h5><span style="color: #993300;">Sort by Modified Files</span></h5>
<p>We can use combination of options <strong>-ltr</strong> to show last modification file or directory date. Simply run below command to display the output.</p>
<pre><strong><span style="color: #0000ff;">ls -lrt</span></strong>

<strong><span style="color: #0000ff;">ls -lrt [path]</span></strong></pre>
<p>In conclusion we can say that the <strong>ls</strong> command, even when it is relatively easy to use, is one of the tools most used by system administrators.</p>
<p>I hope you like this article. Please follow our <a href="https://www.facebook.com/Techyaz/">Facebook</a> page and <a href="https://twitter.com/Tech_yaz">Twitter</a> handle to get latest updates.</p>
<p><span style="color: #800000;"><em><strong>Read More:</strong></em></span></p>
<ul>
<li><strong><a href="http://techyaz.com/rhel/red-hat-enterprise-linux-interview-questions-answers/" target="_blank" rel="noopener">RHEL Interview Questions &amp; Answers</a></strong></li>
<li><strong><a href="http://techyaz.com/rhel/linux-user-administration-add-delete-modify-user-accounts/" target="_blank" rel="noopener">Linux User Administration &#8211; Add, Delete &amp; Modify User Accounts</a></strong></li>
<li><strong><a href="http://techyaz.com/rhel/install-htop-monitor-linux-processes/" target="_blank" rel="noopener">Install HTop and Use it to Monitor Linux Processes</a></strong></li>
<li><strong><a href="http://techyaz.com/sql-server/sql-server-on-linux/change-hostname-red-hat-linux-server/" target="_blank" rel="noopener">How to Change Host Name of RHEL system?</a></strong></li>
<li><strong><a href="http://techyaz.com/rhel/how-to-reset-or-change-user-password-on-linux/" target="_blank" rel="noopener">How to Reset or Change Linux User Account Passwords?</a></strong></li>
</ul>
<p>The post <a href="https://techyaz.com/linux/11-examples-ls-command-list-files-linux/">11 Examples of ls Command to List Files in Linux</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/linux/11-examples-ls-command-list-files-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Red Hat Enterprise Linux Interview Questions and Answers</title>
		<link>https://techyaz.com/interview-questions/redhat-linux-interview-questions/red-hat-enterprise-linux-interview-questions-answers/</link>
					<comments>https://techyaz.com/interview-questions/redhat-linux-interview-questions/red-hat-enterprise-linux-interview-questions-answers/#respond</comments>
		
		<dc:creator><![CDATA[Angelo Marquez]]></dc:creator>
		<pubDate>Mon, 26 Feb 2018 09:32:20 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[RedHat Linux]]></category>
		<category><![CDATA[RedHat Linux Interview Questions]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Interview Questions]]></category>
		<category><![CDATA[Linux Interview Questions and Answers]]></category>
		<category><![CDATA[red hat Linux]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">http://techyaz.com/?p=1901</guid>

					<description><![CDATA[<p>When we talk about GNU/LINUX distributions we find a big collection of them, which can cover practically all the needs in almost all areas. Some of them range from simple home use to commercial production. The GNU/LINUX distribution that we&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/interview-questions/redhat-linux-interview-questions/red-hat-enterprise-linux-interview-questions-answers/">Red Hat Enterprise Linux Interview Questions and Answers</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>When we talk about GNU/LINUX distributions we find a big collection of them, which can cover practically all the needs in almost all areas. Some of them range from simple home use to commercial production. The GNU/LINUX distribution that we will be talking about not only has a great impact on the &#8220;penguin&#8221; world, but also on the business sector is an obligatory reference because of its stability, commercial support and solutions applied to the cloud. Welcome to Red Hat Enterprise Linux. This article is about Red Hat Enterprise Linux Interview Questions and Answers that will help you to crack your technical round of Linux interviews.</p>
<p><img loading="lazy" decoding="async" class="size-full wp-image-1902 alignright" src="http://techyaz.com/wp-content/uploads/2018/02/RHEL-InterviewQA.png" alt="Red Hat Linux Interview Questions and Answers" width="300" height="300" srcset="https://techyaz.com/wp-content/uploads/2018/02/RHEL-InterviewQA.png 300w, https://techyaz.com/wp-content/uploads/2018/02/RHEL-InterviewQA-150x150.png 150w, https://techyaz.com/wp-content/uploads/2018/02/RHEL-InterviewQA-160x160.png 160w, https://techyaz.com/wp-content/uploads/2018/02/RHEL-InterviewQA-320x320.png 320w" sizes="auto, (max-width: 300px) 100vw, 300px" /></p>
<h3><span style="color: #333399;">Red Hat Linux Interview Questions and Answers</span></h3>
<p><strong>1. What is Red Hat Enterprise Linux?</strong></p>
<p><strong>Answer &#8211;</strong> It is a GNU/LINUX distribution created and developed by the multinational enterprise oriented company Red Hat, being the basis for deploying cloud applications, servers or data center.</p>
<p><strong>2. Which is the package manager used by RHEL?</strong></p>
<p><strong>Answer &#8211;</strong> The package manager in RHEL is YUM.</p>
<p><strong>3. How do I install a program in RHEL?</strong></p>
<p><strong>Answer &#8211;</strong> Installing a package or program in RHEL is simple thanks to YUM. With root permission we type in a terminal.</p>
<pre><strong><span style="color: #0000ff;">yum install package_name</span></strong></pre>
<p><strong>4. How can I update the packages in RHEL?</strong></p>
<p><strong>Answer &#8211;</strong> Run below command to update all packages in your RHEL system.</p>
<pre><strong><span style="color: #0000ff;">yum upgrade</span></strong></pre>
<p><strong>5. How can I remove the packages in RHEL?</strong></p>
<p><strong>Answer &#8211;</strong> Run below command to remove any package from RedHat Linux system.</p>
<pre><span style="color: #008000;"><strong>#Make sure to change the name of package that needs to be removed.</strong></span>
<strong><span style="color: #0000ff;">yum remove package_name</span></strong></pre>
<p><strong>6. How can I create a user in RHEL?</strong></p>
<p><strong>Answer &#8211;</strong> We can create a new user from the terminal with the command:</p>
<pre><strong><span style="color: #008000;">#Pass the user name in place of user_name </span></strong>
<span style="color: #0000ff;"><strong>useradd user_name</strong></span></pre>
<p><strong>7. How can I change the user password?</strong></p>
<p><strong>Answer &#8211;</strong> The command that allows us to change the password of the active user is <em><strong>passwd</strong></em>. By entering the command in the terminal, you will be prompted for the current password and twice for the new password. Read below article to learn step by step process to change user as well as sudo passwords.</p>
<ul>
<li><strong><a href="http://techyaz.com/rhel/how-to-reset-or-change-user-password-on-linux/" target="_blank" rel="noopener">How to Reset or Change User Password on RHEL?</a></strong></li>
</ul>
<p><strong>8. How can I change the system language?</strong></p>
<p><strong>Answer-</strong> In RHEL, the system language can be changed using the following command:</p>
<pre><strong><span style="color: #0000ff;">localectl set-locale LANG=”xx_XX.utf8”</span></strong></pre>
<p>For example, if the system is in English and we want to change to German</p>
<pre><strong><span style="color: #0000ff;">localectl set-locale LANG=de_DE.utf8</span></strong></pre>
<p>Then simply restart the active session (not the system)</p>
<p><strong>9. What is a GNU/LINUX service?</strong></p>
<p><strong>Answer &#8211;</strong> A service is a program that runs in the background, outside the interactive control of the users of the system.</p>
<p><strong>10. How can I list the services that are running in RHEL?</strong></p>
<p><strong>Answer &#8211;</strong> This is very useful when managing systems in GNU/LINUX. We can list all the services that are running with the command:</p>
<pre><strong><span style="color: #0000ff;">systemctl -t service --state=active</span></strong></pre>
<p>If you want to check specific service running on RHEL then you can pass service name in above command. For example, i want to check SQL Server service running on my RHEL system then i will run below command. This command will show the output for only this service.</p>
<pre><strong><span style="color: #0000ff;">systemctl status mssql-server</span></strong></pre>
<p><strong>11. How can I start or stop a service?</strong></p>
<p><strong>Answer &#8211;</strong> During the administration of a GNU/LINUX based server we will have to initialize and also stop services.</p>
<p>To initialize:</p>
<pre><strong><span style="color: #0000ff;">systemctl start name.service </span></strong></pre>
<p>To Stop:</p>
<pre><strong><span style="color: #0000ff;">systemctl stop name.service</span></strong></pre>
<p>To Restart:</p>
<pre><strong><span style="color: #0000ff;">systemctl restart name.service</span></strong></pre>
<p><strong>12. How do I know which version of the kernel I am using?</strong></p>
<p><strong>Answer &#8211;</strong> To know which version of the Linux Kernel we are using, just use the command:</p>
<pre><strong><span style="color: #0000ff;">uname –r</span></strong></pre>
<p><strong>13. How can I add and remove kernel modules?</strong></p>
<p><strong>Answer &#8211;</strong> The kernel modules are small programs or libraries that are added to the kernel so that it can manage hardware devices. To add or remove it we use the command modprobe.</p>
<p>For example, to add a module:</p>
<pre><strong><span style="color: #0000ff;">modprobe module_name</span></strong></pre>
<p>And to remove a module</p>
<pre><strong><span style="color: #0000ff;">modprobe –r module_name</span></strong></pre>
<p><strong>14. What is the file system RHEL uses?</strong></p>
<p><strong>Answer &#8211;</strong> The file system used by RHEL is XFS</p>
<p><strong>15. How do I know how much space is available on my hard disk with RHEL?</strong></p>
<p><strong>Answer &#8211;</strong> This is useful to know when we are reaching the hard disk capacity. With the command:</p>
<pre><strong><span style="color: #0000ff;">df –h</span></strong></pre>
<p><strong>16. Can I change hostname in RHEL?</strong></p>
<p><strong>Answer &#8211;</strong> Yes. There are multiple ways to change hostname of a RHEL system. For example if we want hostname to be example. com, we must write the following command in a terminal:</p>
<pre><strong><span style="color: #0000ff;">hostnamectl set-hostname example.com
</span></strong></pre>
<p>I have explained it in below article in very details way. Have a look at this article to learn the process to rename or change the hostname of RHEL system.</p>
<ul>
<li><strong><a href="http://techyaz.com/sql-server/sql-server-on-linux/change-hostname-red-hat-linux-server/" target="_blank" rel="noopener">How to Change Hostname of RHEL system?</a></strong></li>
</ul>
<p><strong>17. How do I know the IP address of the equipment in RHEL?</strong></p>
<p><strong>Answer &#8211;</strong> With the command:</p>
<pre><strong><span style="color: #0000ff;">nmcli dev show</span></strong></pre>
<p>We will not only be able to see the ip address, but also the complete information of all the network interfaces. You can read below article to learn how to check and change the IP address, subnet mask etc of a RHEL system.</p>
<ul>
<li><strong><a href="http://techyaz.com/sql-server/sql-server-on-linux/check-change-ip-address-subnet-mask-default-gateway-linux-server/" target="_blank" rel="noopener">How to Find and Change IP Address, Subnet Mask and Default Gateway of RHEL system?</a></strong></li>
</ul>
<p><strong>18. Can I install a Web server in RHEL?</strong></p>
<p><strong>Answer-</strong> Of course, we can install the web server we want: Apache, nGix or other.</p>
<p><strong>19. After installing Apache2, where is the default Document Root located?</strong></p>
<p><strong>Answer &#8211;</strong> By default the apache2 DocumentRoot in RHEL sets it to /var/www/html/</p>
<p><strong>20. How do I know which version of Red Hat Enterprise Linux is running the server?</strong></p>
<p><strong>Answer &#8211;</strong> Run the command in a terminal to get the RHEL version running on your system.</p>
<pre><strong><span style="color: #0000ff;">/etc/redhat-release</span></strong></pre>
<p>I hope you like this set of Linux Interview Questions and Answers. Please follow our <a href="https://www.facebook.com/Techyaz/">Facebook</a> page and <a href="https://twitter.com/Tech_yaz">Twitter</a> handle to get latest updates.</p>
<p>The post <a href="https://techyaz.com/interview-questions/redhat-linux-interview-questions/red-hat-enterprise-linux-interview-questions-answers/">Red Hat Enterprise Linux Interview Questions and Answers</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/interview-questions/redhat-linux-interview-questions/red-hat-enterprise-linux-interview-questions-answers/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
