# linux basics part 2; electric boogalooo

# Welcome to week 3; Linux commands via bash the bourne-again shell

<div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-learning-to-communic"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Learning to communicate in a new way can be exciting." class="rc-Phrase css-ugczj4" data-cue="1" data-cue-index="0" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Learning to communicate in a new way can be exciting. </span></div><div aria-label="toggle video from Maybe you've learned a new language" class="rc-Phrase css-ugczj4" data-cue="2" data-cue-index="1" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Maybe you've learned a new language </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and can remember this feeling. </span></div><div aria-label="toggle video from Perhaps a lot of us share this excitement with" class="rc-Phrase css-ugczj4" data-cue="4" data-cue-index="3" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Perhaps a lot of us share this excitement with </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">young children as they are expanding their vocabulary. </span></div><div aria-label="toggle video from Others, including me, remember a sense of wonder when we" class="rc-Phrase css-ugczj4" data-cue="6" data-cue-index="5" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Others, including me, remember a sense of wonder when we </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">first used a specialized language </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">to communicate with their computer. </span></div><div aria-label="toggle video from Others, including me, remember a sense of wonder when we" class="rc-Phrase css-ugczj4" data-cue="6" data-cue-index="5" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In this section, we'll continue to learn more about </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Linux and how to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">communicate with the OS through its shell. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-you%27ll-utilize-the-c"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from You'll utilize the command line" class="rc-Phrase css-ugczj4" data-cue="12" data-cue-index="11" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">You'll utilize the command line </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">to communicate with the OS. </span></div><div aria-label="toggle video from You'll learn how to input" class="rc-Phrase css-ugczj4" data-cue="14" data-cue-index="13" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">You'll learn how to input </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">commands in the shell and learn about some of </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the core Linux commands that you'll </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">use as a security analyst. </span></div><div aria-label="toggle video from Specifically, this includes" class="rc-Phrase css-ugczj4" data-cue="18" data-cue-index="17" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Specifically, this includes </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">navigating and managing the file system. </span></div><div aria-label="toggle video from You'll also focus on" class="rc-Phrase css-ugczj4" data-cue="20" data-cue-index="19" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">You'll also focus on </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">authenticating and authorizing users. </span></div><div aria-label="toggle video from This means you'll be able to" class="rc-Phrase css-ugczj4" data-cue="22" data-cue-index="21" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This means you'll be able to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">use a command line to add and </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">delete users from the system and </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">to control what they have access to. </span></div><div aria-label="toggle video from Finally, there's always more to learn." class="rc-Phrase css-ugczj4" data-cue="26" data-cue-index="25" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Finally, there's always more to learn. </span></div><div aria-label="toggle video from Finally, there's always more to learn." class="rc-Phrase css-ugczj4" data-cue="26" data-cue-index="25" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We'll cover accessing resources that </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">support learning new Linux commands. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--1"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="phrases" id="bkmrk-i-remember-when-i-fi"><div aria-label="toggle video from I remember when I first learned about the command line" class="rc-Phrase css-ugczj4" data-cue="29" data-cue-index="28" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">I remember when I first learned about the command line </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and was shocked at the capabilities it provided. </span></div><div aria-label="toggle video from I didn't need to click through" class="rc-Phrase css-ugczj4" data-cue="31" data-cue-index="30" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">I didn't need to click through </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">multiple screens to get tasks done. </span></div><div aria-label="toggle video from Although it took some practice and time to get used to," class="rc-Phrase css-ugczj4" data-cue="33" data-cue-index="32" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Although it took some practice and time to get used to, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">it has been one of the biggest tools at my disposal. </span></div><div aria-label="toggle video from After this section, you'll have" class="rc-Phrase css-ugczj4" data-cue="35" data-cue-index="34" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">After this section, you'll have </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">a practical experience in an area </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">important to the work of </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">a security analyst: using Linux commands. </span></div><div aria-label="toggle video from After this section, you'll have" class="rc-Phrase css-ugczj4" data-cue="35" data-cue-index="34" role="button" tabindex="0">---

<div class="cds-1 css-xl5mb3 cds-2"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Welcome back. Before we get" class="rc-Phrase css-ugczj4" data-cue="1" data-cue-index="0" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Welcome back. Before we get </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">into specific Linux commands, let's </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">explore in more detail the basics of </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">communicating with the OS through the shell. </span></div><div aria-label="toggle video from Being able to utilize Linux commands is" class="rc-Phrase css-ugczj4" data-cue="5" data-cue-index="4" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Being able to utilize Linux commands is </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">a foundational skill for all security professionals. </span></div><div aria-label="toggle video from As a security analyst, you will work with" class="rc-Phrase css-ugczj4" data-cue="7" data-cue-index="6" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">As a security analyst, you will work with </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">server logs and you'll need to know how to navigate, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">manage and analyze files </span></div><div aria-label="toggle video from remotely without a graphical user interface." class="rc-Phrase css-ugczj4" data-cue="10" data-cue-index="9" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">remotely without a graphical user interface. </span></div><div aria-label="toggle video from In addition, you'll need to know how to" class="rc-Phrase css-ugczj4" data-cue="11" data-cue-index="10" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In addition, you'll need to know how to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">verify and configure users and group access. </span></div><div aria-label="toggle video from You'll also need to give authorization" class="rc-Phrase css-ugczj4" data-cue="13" data-cue-index="12" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">You'll also need to give authorization </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and set file permissions. </span></div><div aria-label="toggle video from That means that developing skills with the command line" class="rc-Phrase css-ugczj4" data-cue="15" data-cue-index="14" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">That means that developing skills with the command line </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">is essential for your work as a security analyst. </span></div><div aria-label="toggle video from When we learned about the Linux" class="rc-Phrase css-ugczj4" data-cue="17" data-cue-index="16" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">When we learned about the Linux </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">architecture, we learned that </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the shell is one of the main components </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">of an operating system. </span></div><div aria-label="toggle video from We also learned that there are different shells." class="rc-Phrase css-ugczj4" data-cue="21" data-cue-index="20" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We also learned that there are different shells. </span></div><div aria-label="toggle video from In this section, we'll utilize the Bash shell." class="rc-Phrase css-ugczj4" data-cue="22" data-cue-index="21" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In this section, we'll utilize the Bash shell. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Bash is the default shell in most Linux distributions." class="rc-Phrase css-ugczj4" data-cue="23" data-cue-index="22" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Bash is the default shell in most Linux distributions. </span></div><div aria-label="toggle video from For the most part, the key Linux commands that you'll" class="rc-Phrase css-ugczj4" data-cue="24" data-cue-index="23" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">For the most part, the key Linux commands that you'll </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">be learning in this section are the same across shells. </span></div><div aria-label="toggle video from Now that you know what shell you'll be" class="rc-Phrase css-ugczj4" data-cue="26" data-cue-index="25" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Now that you know what shell you'll be </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">using, let's go into how to write in Bash. </span></div><div aria-label="toggle video from As we discussed in a previous section," class="rc-Phrase css-ugczj4" data-cue="28" data-cue-index="27" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">As we discussed in a previous section, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">communicating with your OS is like a conversation. </span></div><div aria-label="toggle video from You type in commands, and the OS" class="rc-Phrase css-ugczj4" data-cue="30" data-cue-index="29" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">You type in commands, and the OS </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">responds with an answer to your command. </span></div><div aria-label="toggle video from A command is an instruction" class="rc-Phrase css-ugczj4" data-cue="32" data-cue-index="31" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">A command is an instruction </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">telling the computer to do something. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from We'll try out a command in Bash." class="rc-Phrase css-ugczj4" data-cue="34" data-cue-index="33" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We'll try out a command in Bash. </span></div><div aria-label="toggle video from Notice a dollar sign before the cursor." class="rc-Phrase css-ugczj4" data-cue="35" data-cue-index="34" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Notice a dollar sign before the cursor. </span></div><div aria-label="toggle video from This is your prompt to enter a new command." class="rc-Phrase css-ugczj4" data-cue="36" data-cue-index="35" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This is your prompt to enter a new command. </span></div><div aria-label="toggle video from Some commands might tell the computer to" class="rc-Phrase css-ugczj4" data-cue="37" data-cue-index="36" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Some commands might tell the computer to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">find something like a specific file. </span></div><div aria-label="toggle video from Others might tell it to launch a program." class="rc-Phrase css-ugczj4" data-cue="39" data-cue-index="38" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Others might tell it to launch a program. </span></div><div aria-label="toggle video from Or, it might be to output a specific string of text." class="rc-Phrase css-ugczj4" data-cue="40" data-cue-index="39" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Or, it might be to output a specific string of text. </span></div><div aria-label="toggle video from In the last section," class="rc-Phrase css-ugczj4" data-cue="41" data-cue-index="40" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In the last section, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">when we discussed input and output, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we explored how the echo command did this. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Let's input the echo command again." class="rc-Phrase css-ugczj4" data-cue="44" data-cue-index="43" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's input the echo command again. </span></div><div aria-label="toggle video from You may notice that the command" class="rc-Phrase css-ugczj4" data-cue="45" data-cue-index="44" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">You may notice that the command </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we just input is not complete. </span></div><div aria-label="toggle video from If we're going to use the echo command" class="rc-Phrase css-ugczj4" data-cue="47" data-cue-index="46" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">If we're going to use the echo command </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">to output a specific string of </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">texts, we need to specify what the string of text is. </span></div><div aria-label="toggle video from This is what arguments are for." class="rc-Phrase css-ugczj4" data-cue="50" data-cue-index="49" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This is what arguments are for. </span></div><div aria-label="toggle video from An argument is specific information needed by a command." class="rc-Phrase css-ugczj4" data-cue="51" data-cue-index="50" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">An argument is specific information needed by a command. </span></div><div aria-label="toggle video from Some commands take multiple arguments." class="rc-Phrase css-ugczj4" data-cue="52" data-cue-index="51" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Some commands take multiple arguments. </span></div><div aria-label="toggle video from So now let's complete the echo command with an argument." class="rc-Phrase css-ugczj4" data-cue="53" data-cue-index="52" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">So now let's complete the echo command with an argument. </span></div><div aria-label="toggle video from We're learning some pretty technical stuff," class="rc-Phrase css-ugczj4" data-cue="54" data-cue-index="53" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We're learning some pretty technical stuff, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">so how about we output the words: "You are doing great!" </span></div><div aria-label="toggle video from We'll add this argument, and" class="rc-Phrase css-ugczj4" data-cue="56" data-cue-index="55" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We'll add this argument, and </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">then we'll press enter to get the output. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="phrases"><div aria-label="toggle video from In this example, our argument was a string of text." class="rc-Phrase css-ugczj4" data-cue="58" data-cue-index="57" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In this example, our argument was a string of text. </span></div><div aria-label="toggle video from Arguments can provide other types of information as well." class="rc-Phrase css-ugczj4" data-cue="59" data-cue-index="58" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Arguments can provide other types of information as well. </span></div><div aria-label="toggle video from One thing that is really important in Linux is that" class="rc-Phrase css-ugczj4" data-cue="60" data-cue-index="59" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">One thing that is really important in Linux is that </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">all commands and arguments are case sensitive. </span></div><div aria-label="toggle video from This includes file and directory names." class="rc-Phrase css-ugczj4" data-cue="62" data-cue-index="61" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This includes file and directory names. </span></div><div aria-label="toggle video from Keep that in mind as you learn more about how to" class="rc-Phrase css-ugczj4" data-cue="63" data-cue-index="62" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Keep that in mind as you learn more about how to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">use Linux in your day-to-day tasks as a security analyst. </span></div><div aria-label="toggle video from Okay, now that we've covered the basics of" class="rc-Phrase css-ugczj4" data-cue="65" data-cue-index="64" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Okay, now that we've covered the basics of </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">entering Linux commands and arguments </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">through the Bash shell, we're ready </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">to learn some specific commands. </span></div><div aria-label="toggle video from This is exciting, so let's get to our next video!" class="rc-Phrase css-ugczj4" data-cue="69" data-cue-index="68" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This is exciting, so let's get to our next video! </span></div></div></div></div>

# Portfolio Activity: Use Linux commands to manage file permissions

<div data-react-modal-body-trap="" id="bkmrk-" style="position: absolute; opacity: 0;" tabindex="0">  
</div><div id="bkmrk--1"></div><div aria-hidden="true" id="bkmrk--2"><div class="rc-MetatagsWrapper"><div class="rc-Course" role="none"><div class="rc-LearningAssistant"><div class="_1ed7tibu messages"><div>  
</div></div></div></div></div></div><div class="cds-1 css-1vu88ff cds-3 cds-grid-item cds-48 cds-49" id="bkmrk--3"></div><div class="cds-1 css-12jam8y cds-3 cds-grid-item cds-48" id="bkmrk-portfolio-activity%3A-"><main class="item-page-content css-b5no2e" id="bkmrk-portfolio-activity%3A--1" style="height: 100%;">#   


<div class="cds-1 css-0 cds-2"><div class="cds-1 css-0 cds-3 cds-grid-item cds-48"><div class="css-d48u4r" data-e2e="CoverPageHeader"><div class="cds-137 css-kny9tu cds-139">Quiz<span class="rc-A11yScreenReaderOnly">30 minutes</span><span aria-hidden="true"> • 30 min</span></div><div class="css-16tw56a"><div data-e2e="LearningObjectivesButton">  
</div></div></div></div></div></main></div><div class="cds-1 css-0 cds-3 cds-grid-item cds-48" id="bkmrk--4">  
</div>### Submit your assignment

<div class="cds-1 css-0 cds-3 cds-grid-item cds-48" id="bkmrk-due%C2%A0july-23%2C-11%3A59-p"><div class="css-n1ch8l" data-e2e="CoverPageRow"><div data-e2e="CoverPageRow__left-side-view"><div class="css-1fxprx5" data-e2e="CoverPageRow__step-title">  
</div><div data-e2e="CoverPageRow__step-details"><div class="css-m3ahs"><div class="css-1ap3tds"><div class="css-8bhjx3" data-e2e="CoverPagePhaseDetail"><span class="cds-137 css-qa763e cds-139" data-test="label">Due</span> <span class="cds-137 css-dmxkm1 cds-139" data-e2e="CoverPagePhaseDetail__content" data-test="content"><span class="rc-A11yScreenReaderOnly">July 23, 11:59 PM EDT</span><span aria-hidden="true">Jul 23, 11:59 PM EDT</span></span></div></div></div></div></div><div data-e2e="CoverPageRow__right-side-view"><div class="css-157hk8"><div class="css-xj6xiy"><div><div class="css-w1zv81"><div class="css-1yhoabd">  
</div></div></div></div></div></div></div></div>### Receive grade

<div class="cds-1 css-0 cds-3 cds-grid-item cds-48" id="bkmrk-to-pass%C2%A080%25-or-highe"><div class="css-n1ch8l" data-e2e="CoverPageRow"><div data-e2e="CoverPageRow__left-side-view"><div class="css-1fxprx5" data-e2e="CoverPageRow__step-title">  
</div><div data-e2e="CoverPageRow__step-details"><div class="css-m3ahs"><div class="css-1ap3tds"><div class="css-8bhjx3" data-e2e="CoverPagePhaseDetail"><span class="cds-137 css-qa763e cds-139" data-test="label">To Pass</span> <span class="cds-137 css-dmxkm1 cds-139" data-e2e="CoverPagePhaseDetail__content" data-test="content"><span aria-hidden="false">80% or higher</span></span></div></div></div></div></div><div data-e2e="CoverPageRow__right-side-view"><div class="css-kb0qrp" data-e2e="CoverPageRowRightSideGrade"><div class="css-14p9y0y" data-e2e="CoverPageRowRightSideGrade__grade-info">  
</div></div></div></div></div>### Your grade

<span aria-hidden="true">-</span><span class="rc-A11yScreenReaderOnly">Not available</span>

<div class="css-9fnwu" id="bkmrk--5"><div class="rc-ItemFeedback undefined"><div class="rc-ItemFeedbackContent horizontal-box css-lfchfm"><div class="css-e40v4" data-testid="like-button"><div class="rc-LikeContent"><div>  
</div></div></div></div></div></div><div class="css-e40v4" data-testid="dislike-button" id="bkmrk--6"><div class="rc-LikeContent"><div>  
</div></div></div><div class="rc-FlagContent css-8dn4zy" id="bkmrk--7"></div><div aria-hidden="true" id="bkmrk--8"><div class="rc-MetatagsWrapper"><div class="rc-Course" role="none"><div class="rc-LegacyDataFetch"><section class="cds-1 css-kt8aw0 cds-2 cds-5"><div class="cds-1 css-0 cds-2 cds-3 cds-grid-item cds-8 cds-11"><div class="cds-1 css-1fsmhyl cds-2 cds-3 cds-grid-item cds-5 cds-8" id="bkmrk--9"><div class="cds-1 css-12jam8y cds-3 cds-grid-item cds-48"><main class="item-page-content css-b5no2e" id="bkmrk--10" style="height: 100%;"><div class="cds-1 css-0 cds-2"><div class="css-9fnwu"><div class="rc-ItemFeedback undefined"><div class="rc-ItemFeedbackContent horizontal-box css-lfchfm"><div class="css-e40v4"><div class="rc-FlagContent css-8dn4zy" id="bkmrk--11"><div aria-live="polite" role="alert">  
</div><div class="ReactModalPortal">  
</div></div></div></div></div></div></div><div data-testid="faker">  
</div></main></div></div></div></section></div></div><div class="css-1qaroyf" id="bkmrk--12"></div></div></div><div id="bkmrk--13"></div><div class="css-uslc23" id="bkmrk--14"></div><div class="ReactModal__Overlay ReactModal__Overlay--after-open" id="bkmrk--15" style="position: relative; inset: 0px; background-color: rgba(255, 255, 255, 0.75); z-index: 4000;"><div aria-modal="true" class="ReactModal__Content ReactModal__Content--after-open css-1d1llns" role="dialog" tabindex="-1"><div aria-label="tunnel vision" aria-modal="true" class="rc-TunnelVision _3hmsj" role="dialog"><div class="_80l7z7">  
</div><div class="_oafuo3g" data-classname="tunnelvision-window-0"><div class="rc-TunnelVisionHeader _11sxso0 ">  
</div></div></div></div></div># Portfolio Activity: Use Linux commands to manage file permissions

Graded Quiz<span data-testid="time-commitment"><span class="rc-A11yScreenReaderOnly css-ibxuln">.</span><span aria-hidden="true"> • </span>30 min</span><span class="rc-A11yScreenReaderOnly css-ibxuln">.</span><span aria-hidden="true"> • </span><span class="rc-A11yScreenReaderOnly css-ibxuln">8 total points available.</span><span aria-hidden="true" data-testid="total-points">8 total points</span>

<div class="rc-TunnelVisionHeader _11sxso0 " id="bkmrk-duejul-23%2C-11%3A59-pm-"><div class="_11oc718"><div class="cds-1 css-1n47bz1 cds-2 cds-21" data-e2e="TunnelVisionWrapper__header"><div class="cds-1 css-a90vgb cds-3 cds-grid-item cds-48 cds-59 cds-88" data-e2e="TunnelVisionWrapper__header-left"><div data-e2e="HeaderLeft">  
</div></div><div class="cds-1 css-3bzjfj cds-3 cds-grid-item cds-48 cds-53 cds-80" data-e2e="TunnelVisionWrapper__header-right"><div class="css-gvoll6" data-e2e="HeaderRight"><div><div data-e2e="HeaderRight__deadline"><span class="cds-137 css-1a7vngm cds-139">Due</span><span class="cds-137 css-51cxur cds-139">Jul 23, 11:59 PM EDT</span></div></div></div></div></div></div></div>To pass this course item, you must complete the activity and receive at least 80%, or 7 out of 8 points, on the questions that follow. Once you have completed the activity and questions, review the feedback provided. You can learn more about graded and practice items in the [course overview<svg aria-labelledby="cds-react-aria-86-title" class="css-1lzqdox" fill="none" focusable="false" height="16" id="bkmrk--16" role="img" viewbox="0 0 16 16" width="16"></svg>](https://www.coursera.org/learn/linux-and-sql/supplement/rUv9P/course-4-overview)

<div class="css-10k4sfe" id="bkmrk--17"><div class="css-r172lo"><div class="cds-137 css-1emeb4e cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer"><div>  
</div></div></div></div></div></div>## Activity Overview

<div class="css-10k4sfe" id="bkmrk--18"><div class="css-r172lo"><div class="cds-137 css-1emeb4e cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer"><div><figure contenteditable="false" role="figure">![](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/2AQfHY8kQPi_Sz_ikBsRIA_945de3f0876e4bf081e7fad0a3563cf1_qMcY1UR7VsPnVIFuM8UgB-L2b56IPl0pUO6C1_xSlZUuxSVm7k1ykQkyiztVG18Tlmfne3wuxHRi3BRcXCAwGuDqdBf_fzrPn7N4bdIIgDSB3jEr2YrJ-W35cDSrR9JsqNuh4z7mhD84xoeWycs1BQo?expiry=1688860800000&hmac=RZewvPkuZpPKr-_WmHWw00TIloEW0YQfWvMdyeIkBHM)</figure></div></div></div></div></div></div>In this activity, you will create a new portfolio document to demonstrate your experience using Linux commands to manage file permissions. You can add this document to your cybersecurity portfolio, which you can share with prospective employers or recruiters. To review the importance of building a professional portfolio and options for creating your portfolio, read [Create a cybersecurity portfolio<svg aria-labelledby="cds-react-aria-87-title" class="css-1lzqdox" fill="none" focusable="false" height="16" id="bkmrk--19" role="img" viewbox="0 0 16 16" width="16"></svg>](https://www.coursera.org/learn/linux-and-sql/resources/wDFrc)

.

To create your portfolio document, you will review a scenario and follow a series of steps. This scenario is connected to [the lab<svg aria-labelledby="cds-react-aria-88-title" class="css-1lzqdox" fill="none" focusable="false" height="16" id="bkmrk--20" role="img" viewbox="0 0 16 16" width="16"></svg>](https://www.coursera.org/learn/linux-and-sql/ungradedLti/483Kl/activity-manage-authorization)

you have just completed about how to examine and manage file permissions. You will explain the commands you used in that lab, and this will help you prepare for future job interviews and other steps in the hiring process.

Be sure to complete this activity and answer the questions that follow before moving on. The next course item will provide you with a completed exemplar to compare to your own work.

## Scenario

<div id="bkmrk--21"><figure contenteditable="false" role="figure">![](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/n3CZ4UsCRPG8LZRWHwB0GA_75550adfbcb14fe19fa4c33d1d61c0f1_932cjNrOIXWC8O30ForxMUYss1gqOznt9oGLtNG7B6KMVZyttaX5azkrmrq9nzKD2GfXYL8hnKlu4Lo9g9KrsJPa6H-tCCibk747bj_S1w_210avbXn8C0S-9oMfZIk2wiK72sdKkOiN5n41vhzhpYI?expiry=1688860800000&hmac=hvYO-lgYx2LIkM57A2p_Tnyob75ullH-vF2G0leLabQ)</figure></div>Review the scenario below. Then, complete the step-by-step instructions.

You are a security professional at a large organization. You mainly work with their research team. Part of your job is to ensure users on this team are authorized with the appropriate permissions. This helps keep the system secure.

Your task is to examine existing permissions on the file system. You’ll need to determine if the permissions match the authorization that should be given. If they do not match, you’ll need to modify the permissions to authorize the appropriate users and remove any unauthorized access.

**Note:** This scenario involves investigating and updating the same file permissions as the ones in the [Manage authorization<svg aria-labelledby="cds-react-aria-89-title" class="css-1lzqdox" fill="none" focusable="false" height="16" id="bkmrk--22" role="img" viewbox="0 0 16 16" width="16"></svg>](https://www.coursera.org/learn/linux-and-sql/ungradedLti/483Kl/activity-manage-authorization)

lab. You can revisit the lab to get screenshots to include in your portfolio document. If you choose, it's also possible to complete this activity without revisiting the lab by typing your commands in the template.

## Step-By-Step Instructions

<div class="css-10k4sfe" id="bkmrk--23"><div class="css-r172lo"><div class="cds-137 css-1emeb4e cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer"><div><figure contenteditable="false" role="figure">![](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/Wu9aOBevT1eXCukQ_LlYfA_2e3b75d0dadc4f7e870172cd764a21f1_932cjNrOIXWC8O30ForxMUYss1gqOznt9oGLtNG7B6KMVZyttaX5azkrmrq9nzKD2GfXYL8hnKlu4Lo9g9KrsJPa6H-tCCibk747bj_S1w_210avbXn8C0S-9oMfZIk2wiK72sdKkOiN5n41vhzhpYI?expiry=1688860800000&hmac=-8jwdecLsL9doSPhVJpVdCIgI9gpiZp3njGmgpAvmnU)</figure></div></div></div></div></div></div>Follow the instructions to complete each step of the activity. Then, answer the 8 questions at the end of the activity before going to the next course item to compare your work to a completed exemplar.

### Step 1: Access the template

To use the template for this course item, click the following link and select *Use Template*. (In this step, you will just open the template. More instructions for how to use the template will be included in later steps.)

Link to template: [File permissions in Linux<svg aria-labelledby="cds-react-aria-90-title" class="css-1lzqdox" fill="none" focusable="false" height="16" id="bkmrk--24" role="img" viewbox="0 0 16 16" width="16"></svg>](https://docs.google.com/document/d/1A3xiUi9wbXf5lGvRwm8oFsXq18Q8mP7FUDNndjj89zc/template/preview?usp=sharing)

OR

If you don’t have a Google account, you can download the template directly from the following attachment.

<div id="bkmrk--25"><div contenteditable="false" data-e2e="slate-asset-wrapper">  
</div></div>
<div class="css-10k4sfe" id="bkmrk--26"><div class="css-r172lo"><div class="css-kz1sc2"><div class="css-1r5pb9u"><div class="cds-AccordionRoot-focusContainer"><div class="cds-AccordionRoot-container cds-AccordionRoot-silent" id="bkmrk--27"></div></div></div></div></div></div>The following supporting materials will help you complete this activity. Keep them open as you proceed to the next steps.

To use the supporting materials for this course item, click the links.

The **Instructions for including Linux commands** document provides instructions and best practices for including samples of Linux commands in your portfolio activity.

Link to supporting material: [Instructions for including Linux commands<svg aria-labelledby="cds-react-aria-94-title" class="css-1lzqdox" fill="none" focusable="false" height="16" id="bkmrk--28" role="img" viewbox="0 0 16 16" width="16"></svg>](https://docs.google.com/document/d/1t-9o-bPndpOIh9577FJobiakS10kJxgIKrB6GG7EPwA/template/preview?usp=sharing&resourcekey=0-623w2JztdmNSu3nDbsQJcQ)

The **Current file permissions** document demonstrates how the file structure is built for this portfolio activity. The file permissions for each file or directory are also provided.

Link to supporting material: [Current file permissions<svg aria-labelledby="cds-react-aria-95-title" class="css-1lzqdox" fill="none" focusable="false" height="16" id="bkmrk--29" role="img" viewbox="0 0 16 16" width="16"></svg>](https://docs.google.com/document/d/1F3-8XQZsNagSzTkJwFzOGY5OHbGbMRtlb8GbmXE_gCc/template/preview?usp=sharing&resourcekey=0-UUEu0EyFFvMf0SAipcel6w)

**Note**: It is recommended that you use the **Manage authorization** lab to complete this portfolio activity. If you’re revisiting the lab, using the **Current file permissions** document is optional because this file structure has already been created for you.

OR

If you don’t have a Google account, you can download the supporting materials directly from the following attachments.

<div id="bkmrk--30"><div contenteditable="false" data-e2e="slate-asset-wrapper">  
</div></div><div id="bkmrk--31">  
</div><div id="bkmrk--32"><div contenteditable="false" data-e2e="slate-asset-wrapper">  
</div></div>
<div class="css-10k4sfe" id="bkmrk--33"><div class="css-r172lo"><div class="css-kz1sc2"><div class="css-1r5pb9u"><div class="cds-AccordionRoot-focusContainer"><div class="cds-AccordionRoot-container cds-AccordionRoot-silent" id="bkmrk--34"></div></div></div></div></div></div>In the **Manage authorization** lab, check the permissions set for files and subdirectories in the <var>projects</var> directory. Make sure you display all permissions, including hidden files. Or, use the content of [**Current file permissions**<svg aria-labelledby="cds-react-aria-100-title" class="css-1lzqdox" fill="none" focusable="false" height="16" id="bkmrk--35" role="img" viewbox="0 0 16 16" width="16"></svg>](https://docs.google.com/document/d/1F3-8XQZsNagSzTkJwFzOGY5OHbGbMRtlb8GbmXE_gCc/template/preview?usp=sharing&resourcekey=0-UUEu0EyFFvMf0SAipcel6w)

document to determine the current permissions.

Describe the command you can use to check permissions in the **Check file and directory details** section of the **File permissions in Linux** template. From the lab, take a screenshot of the Linux command you used. Or, type this command directly into the template.

Then, use either the output of this command in the lab or the content or the **Current file permissions** document to indicate the current permissions. If using the **Current file permissions** document, write these in the 10-character string that would be part of the command's output.


<div class="css-10k4sfe" id="bkmrk--36"><div class="css-r172lo"><div class="css-kz1sc2"><div class="css-1r5pb9u"><div class="cds-AccordionRoot-focusContainer"><div class="cds-AccordionRoot-container cds-AccordionRoot-silent" id="bkmrk--37"></div></div></div></div></div></div>Choose one example from the output in the previous step. In the **Describe the permissions string** section of the **File permissions in Linux** template, write a short description that explains the 10-character string in the example. You should describe what the 10-character string is for and what each character represents.


<div class="css-10k4sfe" id="bkmrk--38"><div class="css-r172lo"><div class="css-kz1sc2"><div class="css-1r5pb9u"><div class="cds-AccordionRoot-focusContainer"><div class="cds-AccordionRoot-container cds-AccordionRoot-silent" id="bkmrk--39"></div></div></div></div></div></div>The organization does not allow other to have write access to any files. Based on the permissions established in Step 3, identify which file needs to have its permissions modified. Use a Linux command to modify these permissions.

Describe the command you used and its output in the **Change file permissions** section of the **File permissions in Linux** template. In the **Manage authorization** lab, take a screenshot of the Linux command you used. Or, type this command directly into the template.


<div class="css-10k4sfe" id="bkmrk--40"><div class="css-r172lo"><div class="css-kz1sc2"><div class="css-1r5pb9u"><div class="cds-AccordionRoot-focusContainer"><div class="cds-AccordionRoot-container cds-AccordionRoot-silent" id="bkmrk--41"></div></div></div></div></div></div>The research team has archived <var>.project\_x.txt</var>, which is why it’s a hidden file. This file should not have write permissions for anyone, but the user and group should be able to read the file. Use a Linux command to assign <var>.project\_x.txt</var> the appropriate authorization.

Describe the command you used and its output in the **Change file permissions on a hidden file** section of the **File permissions in Linux** template. In the **Manage authorization** lab, take a screenshot of the Linux command you used. Or, type this command directly into the template.


<div class="css-10k4sfe" id="bkmrk--42"><div class="css-r172lo"><div class="css-kz1sc2"><div class="css-1r5pb9u"><div class="cds-AccordionRoot-focusContainer"><div class="cds-AccordionRoot-container cds-AccordionRoot-silent" id="bkmrk--43"></div></div></div></div></div></div>The files and directories in the projects directory belong to the <var>researcher2</var> user. Only <var>researcher2</var> should be allowed to access the <var>drafts</var> directory and its contents. Use a Linux command to modify the permissions accordingly.

Describe the command you used and its output in the **Change directory permissions** section of the **File permissions in Linux** template. In the **Manage authorization** lab, take a screenshot of the Linux command you used. Or, type this command directly into the template.


<div class="css-10k4sfe" id="bkmrk--44"><div class="css-r172lo"><div class="css-kz1sc2"><div class="css-1r5pb9u"><div class="cds-AccordionRoot-focusContainer"><div class="cds-AccordionRoot-container cds-AccordionRoot-silent" id="bkmrk--45"></div></div></div></div></div></div>To finalize the document and make its purpose clear to potential employers, be sure to complete the **Project description** and **Summary** sections of the **File permissions in Linux** template.

In the Project description section, give a general overview of the scenario and what you accomplish through Linux. Write two to four sentences.

In the Summary section, provide a short summary of the previous tasks and connect them to the scenario. Write approximately two to four sentences.

## What to Include in Your Response

Be sure to include the following in your completed activity:

<div class="css-10k4sfe" id="bkmrk-screenshots-of-your-"><div class="css-r172lo"><div class="cds-137 css-1emeb4e cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">- Screenshots of your commands or typed versions of the commands
- Explanations of your commands
- A project description at the beginning
- A summary at the end
- Details on using <var>chmod</var> to update file permissions
- Details on checking file permissions with <var>ls -la</var>
- Details on interpreting the 10-character string that represents file permissions
- Details on hidden files and directories

</div></div></div></div></div>
<div class="css-10k4sfe" id="bkmrk--46"><div class="css-r172lo"><div class="css-kz1sc2"><div class="css-1r5pb9u"><div class="cds-AccordionRoot-focusContainer"><div class="cds-AccordionRoot-container cds-AccordionRoot-silent" id="bkmrk--47"></div></div></div></div></div></div>The following is a self-assessment for your **Use Linux commands to manage file permissions** portfolio activity. You will use these statements to review your own work. The self-assessment process is an important part of the learning experience because it allows you to *objectively* assess your **Use Linux commands to manage file permissions** portfolio activity.

There are a total of 8 points possible for this activity and each statement is worth 1 point.

To complete the self-assessment, first open your **Use Linux commands to manage file permissions** portfolio activity. Then respond yes or no to each statement.

When you complete and submit your responses, you will receive a percentage score. This score will help you confirm whether you completed the required steps of the activity. The recommended passing grade for this project is at least 80% (or 7/8 points). If you want to increase your score, you can revise your project and then resubmit your responses to reflect any changes you made. Try to achieve at least 7 points before continuing on to the next course item.

### 1.

<div aria-labelledby="p3IjRJFbEe2Hmg5W0a3aqw-legend" class="rc-FormPartsQuestion" id="bkmrk-question-1" role="group"><div class="rc-FormPartsQuestion__row" data-test="legend"><div class="rc-FormPartsQuestion__numberCell"><span class="screenreader-only">Question 1</span></div><div class="rc-FormPartsQuestion__contentCell"><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div></div>Your document includes screenshots or typed versions of your commands.

<div aria-labelledby="p3IjRJFbEe2Hmg5W0a3aqw-legend" class="rc-FormPartsQuestion" id="bkmrk-1-point" role="group"><div class="rc-FormPartsQuestion__row" data-test="legend" id="bkmrk-1-point-1"><div class="rc-FormPartsQuestion__contentCell" id="bkmrk--48"><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div><div class="rc-FormPartsQuestion__pointsCell"><div class="css-1mvreox"><span class="cds-137 css-mu0bf1 cds-139">1 point</span></div></div></div><div class="rc-FormPartsQuestion__row" data-testid="form-part"><div class="rc-FormPartsQuestion__numberCell">  
</div><div class="rc-FormPartsQuestion__contentCell"><div aria-labelledby="p3IjRJFbEe2Hmg5W0a3aqw-legend" class="rc-FormPartsMcq" role="group"><div class="css-18k2uoc"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label>  
</div></div></div></div></div></div><div class="css-18k2uoc" id="bkmrk--49"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML rc-Option__input-text" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div>Yes

<div class="css-18k2uoc" id="bkmrk--50"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label>  
</div></div><div aria-labelledby="p3IjRJFbEe2Hmg5W0a3aqw-legend" class="rc-FormPartsQuestion" id="bkmrk--51" role="group"><div class="rc-FormPartsQuestion__row" data-testid="form-part"><div class="rc-FormPartsQuestion__contentCell"><div aria-labelledby="p3IjRJFbEe2Hmg5W0a3aqw-legend" class="rc-FormPartsMcq" role="group"><div class="css-18k2uoc"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML rc-Option__input-text" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div></div></div></div></div>No

### 2.

<div aria-labelledby="sJ_RhbngEe2PVBJ-i9H_oQ-legend" class="rc-FormPartsQuestion" id="bkmrk-question-2" role="group"><div class="rc-FormPartsQuestion__row" data-test="legend"><div class="rc-FormPartsQuestion__numberCell"><span class="screenreader-only">Question 2</span></div><div class="rc-FormPartsQuestion__contentCell"><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div></div>Your document includes a description of the project at the beginning.

<div aria-labelledby="sJ_RhbngEe2PVBJ-i9H_oQ-legend" class="rc-FormPartsQuestion" id="bkmrk-1-point-2" role="group"><div class="rc-FormPartsQuestion__row" data-test="legend" id="bkmrk-1-point-3"><div class="rc-FormPartsQuestion__contentCell" id="bkmrk--52"><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div><div class="rc-FormPartsQuestion__pointsCell"><div class="css-1mvreox"><span class="cds-137 css-mu0bf1 cds-139">1 point</span></div></div></div><div class="rc-FormPartsQuestion__row" data-testid="form-part"><div class="rc-FormPartsQuestion__numberCell">  
</div><div class="rc-FormPartsQuestion__contentCell"><div aria-labelledby="sJ_RhbngEe2PVBJ-i9H_oQ-legend" class="rc-FormPartsMcq" role="group"><div class="css-18k2uoc"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label>  
</div></div></div></div></div></div><div class="css-18k2uoc" id="bkmrk--53"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML rc-Option__input-text" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div>Yes

<div class="css-18k2uoc" id="bkmrk--54"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label>  
</div></div><div aria-labelledby="sJ_RhbngEe2PVBJ-i9H_oQ-legend" class="rc-FormPartsQuestion" id="bkmrk--55" role="group"><div class="rc-FormPartsQuestion__row" data-testid="form-part"><div class="rc-FormPartsQuestion__contentCell"><div aria-labelledby="sJ_RhbngEe2PVBJ-i9H_oQ-legend" class="rc-FormPartsMcq" role="group"><div class="css-18k2uoc"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML rc-Option__input-text" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div></div></div></div></div>No

### 3.

<div aria-labelledby="MZxyc7nhEe2cjAoY9ZXj2w-legend" class="rc-FormPartsQuestion" id="bkmrk-question-3" role="group"><div class="rc-FormPartsQuestion__row" data-test="legend"><div class="rc-FormPartsQuestion__numberCell"><span class="screenreader-only">Question 3</span></div><div class="rc-FormPartsQuestion__contentCell"><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div></div>Your document includes explanations of your commands and their output.

<div aria-labelledby="MZxyc7nhEe2cjAoY9ZXj2w-legend" class="rc-FormPartsQuestion" id="bkmrk-1-point-4" role="group"><div class="rc-FormPartsQuestion__row" data-test="legend" id="bkmrk-1-point-5"><div class="rc-FormPartsQuestion__contentCell" id="bkmrk--56"><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div><div class="rc-FormPartsQuestion__pointsCell"><div class="css-1mvreox"><span class="cds-137 css-mu0bf1 cds-139">1 point</span></div></div></div><div class="rc-FormPartsQuestion__row" data-testid="form-part"><div class="rc-FormPartsQuestion__numberCell">  
</div><div class="rc-FormPartsQuestion__contentCell"><div aria-labelledby="MZxyc7nhEe2cjAoY9ZXj2w-legend" class="rc-FormPartsMcq" role="group"><div class="css-18k2uoc"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label>  
</div></div></div></div></div></div><div class="css-18k2uoc" id="bkmrk--57"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML rc-Option__input-text" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div>Yes

<div class="css-18k2uoc" id="bkmrk--58"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label>  
</div></div><div aria-labelledby="MZxyc7nhEe2cjAoY9ZXj2w-legend" class="rc-FormPartsQuestion" id="bkmrk--59" role="group"><div class="rc-FormPartsQuestion__row" data-testid="form-part"><div class="rc-FormPartsQuestion__contentCell"><div aria-labelledby="MZxyc7nhEe2cjAoY9ZXj2w-legend" class="rc-FormPartsMcq" role="group"><div class="css-18k2uoc"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML rc-Option__input-text" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div></div></div></div></div>No

### 4.

<div aria-labelledby="SOh_bLnhEe2uxQ79iEqrwQ-legend" class="rc-FormPartsQuestion" id="bkmrk-question-4" role="group"><div class="rc-FormPartsQuestion__row" data-test="legend"><div class="rc-FormPartsQuestion__numberCell"><span class="screenreader-only">Question 4</span></div><div class="rc-FormPartsQuestion__contentCell"><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div></div>Your document includes a summary at the end.

<div aria-labelledby="SOh_bLnhEe2uxQ79iEqrwQ-legend" class="rc-FormPartsQuestion" id="bkmrk-1-point-6" role="group"><div class="rc-FormPartsQuestion__row" data-test="legend" id="bkmrk-1-point-7"><div class="rc-FormPartsQuestion__contentCell" id="bkmrk--60"><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div><div class="rc-FormPartsQuestion__pointsCell"><div class="css-1mvreox"><span class="cds-137 css-mu0bf1 cds-139">1 point</span></div></div></div><div class="rc-FormPartsQuestion__row" data-testid="form-part"><div class="rc-FormPartsQuestion__numberCell">  
</div><div class="rc-FormPartsQuestion__contentCell"><div aria-labelledby="SOh_bLnhEe2uxQ79iEqrwQ-legend" class="rc-FormPartsMcq" role="group"><div class="css-18k2uoc"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label>  
</div></div></div></div></div></div><div class="css-18k2uoc" id="bkmrk--61"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML rc-Option__input-text" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div>Yes

<div class="css-18k2uoc" id="bkmrk--62"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label>  
</div></div><div aria-labelledby="SOh_bLnhEe2uxQ79iEqrwQ-legend" class="rc-FormPartsQuestion" id="bkmrk--63" role="group"><div class="rc-FormPartsQuestion__row" data-testid="form-part"><div class="rc-FormPartsQuestion__contentCell"><div aria-labelledby="SOh_bLnhEe2uxQ79iEqrwQ-legend" class="rc-FormPartsMcq" role="group"><div class="css-18k2uoc"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML rc-Option__input-text" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div></div></div></div></div>No

### 5.

<div aria-labelledby="Y8vkZ7nhEe2PVBJ-i9H_oQ-legend" class="rc-FormPartsQuestion" id="bkmrk-question-5" role="group"><div class="rc-FormPartsQuestion__row" data-test="legend"><div class="rc-FormPartsQuestion__numberCell"><span class="screenreader-only">Question 5</span></div><div class="rc-FormPartsQuestion__contentCell"><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div></div>Your document includes details on using <var>chmod</var> to update file permissions.

<div aria-labelledby="Y8vkZ7nhEe2PVBJ-i9H_oQ-legend" class="rc-FormPartsQuestion" id="bkmrk-1-point-8" role="group"><div class="rc-FormPartsQuestion__row" data-test="legend" id="bkmrk-1-point-9"><div class="rc-FormPartsQuestion__contentCell" id="bkmrk--64"><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div><div class="rc-FormPartsQuestion__pointsCell"><div class="css-1mvreox"><span class="cds-137 css-mu0bf1 cds-139">1 point</span></div></div></div><div class="rc-FormPartsQuestion__row" data-testid="form-part"><div class="rc-FormPartsQuestion__numberCell">  
</div><div class="rc-FormPartsQuestion__contentCell"><div aria-labelledby="Y8vkZ7nhEe2PVBJ-i9H_oQ-legend" class="rc-FormPartsMcq" role="group"><div class="css-18k2uoc"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label>  
</div></div></div></div></div></div><div class="css-18k2uoc" id="bkmrk--65"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML rc-Option__input-text" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div>Yes

<div class="css-18k2uoc" id="bkmrk--66"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label>  
</div></div><div aria-labelledby="Y8vkZ7nhEe2PVBJ-i9H_oQ-legend" class="rc-FormPartsQuestion" id="bkmrk--67" role="group"><div class="rc-FormPartsQuestion__row" data-testid="form-part"><div class="rc-FormPartsQuestion__contentCell"><div aria-labelledby="Y8vkZ7nhEe2PVBJ-i9H_oQ-legend" class="rc-FormPartsMcq" role="group"><div class="css-18k2uoc"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML rc-Option__input-text" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div></div></div></div></div>No

### 6.

<div aria-labelledby="l-SHqbnhEe2cjAoY9ZXj2w-legend" class="rc-FormPartsQuestion" id="bkmrk-question-6" role="group"><div class="rc-FormPartsQuestion__row" data-test="legend"><div class="rc-FormPartsQuestion__numberCell"><span class="screenreader-only">Question 6</span></div><div class="rc-FormPartsQuestion__contentCell"><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div></div>Your document includes details on checking file permissions with <var>ls -la</var>.

<div aria-labelledby="l-SHqbnhEe2cjAoY9ZXj2w-legend" class="rc-FormPartsQuestion" id="bkmrk-1-point-10" role="group"><div class="rc-FormPartsQuestion__row" data-test="legend" id="bkmrk-1-point-11"><div class="rc-FormPartsQuestion__contentCell" id="bkmrk--68"><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div><div class="rc-FormPartsQuestion__pointsCell"><div class="css-1mvreox"><span class="cds-137 css-mu0bf1 cds-139">1 point</span></div></div></div><div class="rc-FormPartsQuestion__row" data-testid="form-part"><div class="rc-FormPartsQuestion__numberCell">  
</div><div class="rc-FormPartsQuestion__contentCell"><div aria-labelledby="l-SHqbnhEe2cjAoY9ZXj2w-legend" class="rc-FormPartsMcq" role="group"><div class="css-18k2uoc"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label>  
</div></div></div></div></div></div><div class="css-18k2uoc" id="bkmrk--69"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML rc-Option__input-text" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div>Yes

<div class="css-18k2uoc" id="bkmrk--70"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label>  
</div></div><div aria-labelledby="l-SHqbnhEe2cjAoY9ZXj2w-legend" class="rc-FormPartsQuestion" id="bkmrk--71" role="group"><div class="rc-FormPartsQuestion__row" data-testid="form-part"><div class="rc-FormPartsQuestion__contentCell"><div aria-labelledby="l-SHqbnhEe2cjAoY9ZXj2w-legend" class="rc-FormPartsMcq" role="group"><div class="css-18k2uoc"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML rc-Option__input-text" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div></div></div></div></div>No

### 7.

<div aria-labelledby="ugtb1LnhEe2uxQ79iEqrwQ-legend" class="rc-FormPartsQuestion" id="bkmrk-question-7" role="group"><div class="rc-FormPartsQuestion__row" data-test="legend"><div class="rc-FormPartsQuestion__numberCell"><span class="screenreader-only">Question 7</span></div><div class="rc-FormPartsQuestion__contentCell"><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div></div>Your document includes details on interpreting the 10-character string that represents file permissions.

<div aria-labelledby="ugtb1LnhEe2uxQ79iEqrwQ-legend" class="rc-FormPartsQuestion" id="bkmrk-1-point-12" role="group"><div class="rc-FormPartsQuestion__row" data-test="legend" id="bkmrk-1-point-13"><div class="rc-FormPartsQuestion__contentCell" id="bkmrk--72"><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div><div class="rc-FormPartsQuestion__pointsCell"><div class="css-1mvreox"><span class="cds-137 css-mu0bf1 cds-139">1 point</span></div></div></div><div class="rc-FormPartsQuestion__row" data-testid="form-part"><div class="rc-FormPartsQuestion__numberCell">  
</div><div class="rc-FormPartsQuestion__contentCell"><div aria-labelledby="ugtb1LnhEe2uxQ79iEqrwQ-legend" class="rc-FormPartsMcq" role="group"><div class="css-18k2uoc"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label>  
</div></div></div></div></div></div><div class="css-18k2uoc" id="bkmrk--73"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML rc-Option__input-text" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div>Yes

<div class="css-18k2uoc" id="bkmrk--74"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label>  
</div></div><div aria-labelledby="ugtb1LnhEe2uxQ79iEqrwQ-legend" class="rc-FormPartsQuestion" id="bkmrk--75" role="group"><div class="rc-FormPartsQuestion__row" data-testid="form-part"><div class="rc-FormPartsQuestion__contentCell"><div aria-labelledby="ugtb1LnhEe2uxQ79iEqrwQ-legend" class="rc-FormPartsMcq" role="group"><div class="css-18k2uoc"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML rc-Option__input-text" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div></div></div></div></div>No

### 8.

<div aria-labelledby="zlQTwbnhEe2cjAoY9ZXj2w-legend" class="rc-FormPartsQuestion" id="bkmrk-question-8" role="group"><div class="rc-FormPartsQuestion__row" data-test="legend"><div class="rc-FormPartsQuestion__numberCell"><span class="screenreader-only">Question 8</span></div><div class="rc-FormPartsQuestion__contentCell"><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div></div>Your document includes details on hidden files and directories.

<div aria-labelledby="zlQTwbnhEe2cjAoY9ZXj2w-legend" class="rc-FormPartsQuestion" id="bkmrk-1-point-14" role="group"><div class="rc-FormPartsQuestion__row" data-test="legend" id="bkmrk-1-point-15"><div class="rc-FormPartsQuestion__contentCell" id="bkmrk--76"><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div><div class="rc-FormPartsQuestion__pointsCell"><div class="css-1mvreox"><span class="cds-137 css-mu0bf1 cds-139">1 point</span></div></div></div><div class="rc-FormPartsQuestion__row" data-testid="form-part"><div class="rc-FormPartsQuestion__numberCell">  
</div><div class="rc-FormPartsQuestion__contentCell"><div aria-labelledby="zlQTwbnhEe2cjAoY9ZXj2w-legend" class="rc-FormPartsMcq" role="group"><div class="css-18k2uoc"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label>  
</div></div></div></div></div></div><div class="css-18k2uoc" id="bkmrk--77"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML rc-Option__input-text" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div>Yes

<div class="css-18k2uoc" id="bkmrk--78"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label>  
</div></div><div id="bkmrk--79"><div aria-labelledby="zlQTwbnhEe2cjAoY9ZXj2w-legend" class="rc-FormPartsQuestion" role="group"><div class="rc-FormPartsQuestion__row" data-testid="form-part"><div class="rc-FormPartsQuestion__contentCell"><div aria-labelledby="zlQTwbnhEe2cjAoY9ZXj2w-legend" class="rc-FormPartsMcq" role="group"><div class="css-18k2uoc"><div class="rc-Option"><label class="_1oyudm1w cui-Checkbox cui-active"></label><div class="cds-137 css-80vnnb cds-139"><div class="rc-CML rc-Option__input-text" dir="auto"><div class="css-1k5v0wb" data-testid="cml-viewer">  
</div></div></div></div></div></div></div></div></div></div>No

<div id="bkmrk--80"><div class="css-1k6gshx"><div><div class="css-5x16xy" data-test="HonorCodeAgreement">  
</div></div></div></div><div id="bkmrk--81"><div class="css-5x16xy" data-test="HonorCodeAgreement"><div class="css-1u4swui"><div data-test="agreement-text"><div class="css-kd6l09">  
</div></div></div></div></div><div class="css-d8g9f1" id="bkmrk--82">  
</div><div class="rc-ItemFeedbackContent horizontal-box css-lfchfm" id="bkmrk--83"><div class="css-e40v4" data-testid="like-button"><div class="rc-LikeContent"><div>  
</div></div></div></div><div class="css-e40v4" data-testid="dislike-button" id="bkmrk--84"><div class="rc-LikeContent"><div>  
</div></div></div><div class="rc-FlagContent css-8dn4zy" id="bkmrk--85"></div>

# Core commands for navigation and reading files

<div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-welcome-back.-i-hope"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Welcome back. I hope you're learning" class="rc-Phrase css-ugczj4" data-cue="1" data-cue-index="0" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Welcome back. I hope you're learning </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">a lot about how to communicate with the Linux OS. </span></div><div aria-label="toggle video from As we continue our journey into" class="rc-Phrase css-ugczj4" data-cue="3" data-cue-index="2" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">As we continue our journey into </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">utilizing the Linux command line, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we'll focus on how to navigate the Linux file system. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-now%2C-i-want-you-to-i"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Now, I want you to imagine a tree." class="rc-Phrase css-ugczj4" data-cue="6" data-cue-index="5" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Now, I want you to imagine a tree. </span></div><div aria-label="toggle video from What did you notice first about the tree?" class="rc-Phrase css-ugczj4" data-cue="7" data-cue-index="6" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">What did you notice first about the tree? </span></div><div aria-label="toggle video from Would you say the trunk or the branches?" class="rc-Phrase css-ugczj4" data-cue="8" data-cue-index="7" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Would you say the trunk or the branches? </span></div><div aria-label="toggle video from These might definitely get your attention," class="rc-Phrase css-ugczj4" data-cue="9" data-cue-index="8" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">These might definitely get your attention, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">but what about its roots? </span></div><div aria-label="toggle video from Everything about a tree starts in the roots." class="rc-Phrase css-ugczj4" data-cue="11" data-cue-index="10" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Everything about a tree starts in the roots. </span></div><div aria-label="toggle video from Everything about a tree starts in the roots." class="rc-Phrase css-ugczj4" data-cue="11" data-cue-index="10" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Something similar happens when we </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">think about the Linux file system. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--1"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-previously%2C-we-learn"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Previously, we learned about" class="rc-Phrase css-ugczj4" data-cue="14" data-cue-index="13" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Previously, we learned about </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the components of the Linux architecture. </span></div><div aria-label="toggle video from The Filesystem Hierarchy Standard," class="rc-Phrase css-ugczj4" data-cue="16" data-cue-index="15" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The Filesystem Hierarchy Standard, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">or FHS, is </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the component of the Linux OS that organizes data. </span></div><div aria-label="toggle video from This file system is" class="rc-Phrase css-ugczj4" data-cue="19" data-cue-index="18" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This file system is </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">a very important part of Linux because </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">everything we do in Linux is considered </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">a file somewhere in the system's directory. </span></div><div aria-label="toggle video from The FHS is a hierarchical system," class="rc-Phrase css-ugczj4" data-cue="23" data-cue-index="22" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The FHS is a hierarchical system, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and just like with a tree, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">everything grows and branches out from the root. </span></div><div aria-label="toggle video from The root directory is" class="rc-Phrase css-ugczj4" data-cue="26" data-cue-index="25" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The root directory is </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the highest-level directory in Linux. </span></div><div aria-label="toggle video from It's designated by a single slash." class="rc-Phrase css-ugczj4" data-cue="28" data-cue-index="27" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">It's designated by a single slash. </span></div><div aria-label="toggle video from It's designated by a single slash." class="rc-Phrase css-ugczj4" data-cue="28" data-cue-index="27" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Subdirectories branch off from the root directory. </span></div><div aria-label="toggle video from The subdirectories branch out" class="rc-Phrase css-ugczj4" data-cue="30" data-cue-index="29" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The subdirectories branch out </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">further and further away from the root directory. </span></div><div aria-label="toggle video from When describing the directory structure in Linux, slashes" class="rc-Phrase css-ugczj4" data-cue="32" data-cue-index="31" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">When describing the directory structure in Linux, slashes </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">are used when tracing </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">back through these branches to the root. </span></div><div aria-label="toggle video from For example, here," class="rc-Phrase css-ugczj4" data-cue="35" data-cue-index="34" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">For example, here, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the first slash indicates the root directory. </span></div><div aria-label="toggle video from Then it branches out a level into the home subdirectory." class="rc-Phrase css-ugczj4" data-cue="37" data-cue-index="36" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Then it branches out a level into the home subdirectory. </span></div><div aria-label="toggle video from Another slash indicates it is branching out again." class="rc-Phrase css-ugczj4" data-cue="38" data-cue-index="37" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Another slash indicates it is branching out again. </span></div><div aria-label="toggle video from This time it's to" class="rc-Phrase css-ugczj4" data-cue="39" data-cue-index="38" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This time it's to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the analyst subdirectory that is located within home. </span></div><div aria-label="toggle video from When working in security," class="rc-Phrase css-ugczj4" data-cue="41" data-cue-index="40" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">When working in security, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">it is essential that you learn to navigate </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">a file system to locate and analyze logs, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">such as log files. </span></div><div aria-label="toggle video from You'll analyze these log files for" class="rc-Phrase css-ugczj4" data-cue="45" data-cue-index="44" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">You'll analyze these log files for </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">application usage and authentication. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--2"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-with-that-background"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from With that background, we're now ready to learn" class="rc-Phrase css-ugczj4" data-cue="47" data-cue-index="46" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">With that background, we're now ready to learn </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the commands commonly used </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">for navigating the file system. </span></div><div aria-label="toggle video from First, pwd prints the working directory onto the screen." class="rc-Phrase css-ugczj4" data-cue="50" data-cue-index="49" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">First, pwd prints the working directory onto the screen. </span></div><div aria-label="toggle video from When you use this command," class="rc-Phrase css-ugczj4" data-cue="51" data-cue-index="50" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">When you use this command, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the output tells you which directory you're currently in. </span></div><div aria-label="toggle video from When you use this command," class="rc-Phrase css-ugczj4" data-cue="51" data-cue-index="50" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Next, ls displays the names of files and </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">directories in the current working directory. And finally, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">cd navigates between directories. </span></div><div aria-label="toggle video from This is the command you'll use" class="rc-Phrase css-ugczj4" data-cue="56" data-cue-index="55" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This is the command you'll use </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">when you want to change directories. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--3"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-let%27s-use-these-comm"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Let's use these commands in Bash." class="rc-Phrase css-ugczj4" data-cue="58" data-cue-index="57" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's use these commands in Bash. </span></div><div aria-label="toggle video from First, we'll type the command" class="rc-Phrase css-ugczj4" data-cue="59" data-cue-index="58" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">First, we'll type the command </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">pwd to display the current location and then press enter. </span></div><div aria-label="toggle video from The output is the path to" class="rc-Phrase css-ugczj4" data-cue="61" data-cue-index="60" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The output is the path to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the analyst directory where we're currently working. </span></div><div aria-label="toggle video from Next, let's input ls to display" class="rc-Phrase css-ugczj4" data-cue="63" data-cue-index="62" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Next, let's input ls to display </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the files and directories within the analyst directory. </span></div><div aria-label="toggle video from The output is the name of" class="rc-Phrase css-ugczj4" data-cue="65" data-cue-index="64" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The output is the name of </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">four directories: logs, oldreports, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">projects, and reports, and one file named updates.txt. </span></div><div aria-label="toggle video from So let's say we now want to go into" class="rc-Phrase css-ugczj4" data-cue="68" data-cue-index="67" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">So let's say we now want to go into </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the logs directory to check for unauthorized access. </span></div><div aria-label="toggle video from We'll input: cd logs" class="rc-Phrase css-ugczj4" data-cue="70" data-cue-index="69" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We'll input: cd logs </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">to change directories. </span></div><div aria-label="toggle video from We won't get any output" class="rc-Phrase css-ugczj4" data-cue="72" data-cue-index="71" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We won't get any output </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">on the screen from the cd command, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">but if we enter pwd again, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">its output indicates that the working directory is logs. </span></div><div aria-label="toggle video from Logs is a subdirectory of the analyst directory." class="rc-Phrase css-ugczj4" data-cue="76" data-cue-index="75" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Logs is a subdirectory of the analyst directory. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--4"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-as-a-security-analys"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from As a security analyst," class="rc-Phrase css-ugczj4" data-cue="77" data-cue-index="76" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">As a security analyst, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">you'll also need to know how to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">read file content in Linux. </span></div><div aria-label="toggle video from For example, you may need to read" class="rc-Phrase css-ugczj4" data-cue="80" data-cue-index="79" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">For example, you may need to read </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">files that contain configuration settings to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">identify potential vulnerabilities. </span></div><div aria-label="toggle video from For example, you may need to read" class="rc-Phrase css-ugczj4" data-cue="80" data-cue-index="79" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Or, you might look </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">at user access reports </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">while investigating unauthorized access. </span></div><div aria-label="toggle video from When reading file content," class="rc-Phrase css-ugczj4" data-cue="85" data-cue-index="84" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">When reading file content, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">there are some commands that will help you. </span></div><div aria-label="toggle video from First, cat displays the content of a file." class="rc-Phrase css-ugczj4" data-cue="87" data-cue-index="86" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">First, cat displays the content of a file. </span></div><div aria-label="toggle video from First, cat displays the content of a file." class="rc-Phrase css-ugczj4" data-cue="87" data-cue-index="86" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This is useful, but sometimes you </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">won't want the full contents of a large file. </span></div><div aria-label="toggle video from In these cases, you can use the head command." class="rc-Phrase css-ugczj4" data-cue="90" data-cue-index="89" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In these cases, you can use the head command. </span></div><div aria-label="toggle video from In these cases, you can use the head command." class="rc-Phrase css-ugczj4" data-cue="90" data-cue-index="89" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">It displays just the beginning of </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">a file, by default ten lines. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--5"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-let%27s-try-out-these-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Let's try out these commands." class="rc-Phrase css-ugczj4" data-cue="93" data-cue-index="92" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's try out these commands. </span></div><div aria-label="toggle video from Imagine that we want to read the contents of" class="rc-Phrase css-ugczj4" data-cue="94" data-cue-index="93" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Imagine that we want to read the contents of </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">access.txt, and we're </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">already in the working directory where it's located. </span></div><div aria-label="toggle video from First, we input the cat command" class="rc-Phrase css-ugczj4" data-cue="97" data-cue-index="96" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">First, we input the cat command </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and then follow it with the name of the file, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">access.txt.</span></div><div aria-label="toggle video from First, we input the cat command" class="rc-Phrase css-ugczj4" data-cue="97" data-cue-index="96" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139"> And </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Bash returns the full contents of this file. </span></div><div aria-label="toggle video from Let's compare that to the head command." class="rc-Phrase css-ugczj4" data-cue="101" data-cue-index="100" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's compare that to the head command. </span></div><div aria-label="toggle video from Let's compare that to the head command." class="rc-Phrase css-ugczj4" data-cue="101" data-cue-index="100" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">When we input the head command followed by our file name, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">only the first 10 lines of this file are displayed. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--6"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="phrases" id="bkmrk-wow%2C-this-section-ha"><div aria-label="toggle video from Wow, this section had lots" class="rc-Phrase css-ugczj4" data-cue="104" data-cue-index="103" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Wow, this section had lots </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">of action, and it's just the beginning! </span></div><div aria-label="toggle video from I'm glad you learned how security analysts can use" class="rc-Phrase css-ugczj4" data-cue="106" data-cue-index="105" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">I'm glad you learned how security analysts can use </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">essential commands to navigate the system. </span></div><div aria-label="toggle video from Next, we'll explore how to manage the system." class="rc-Phrase css-ugczj4" data-cue="108" data-cue-index="107" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Next, we'll explore how to manage the system. </span></div></div>

# Navigate Linux and read file content

In this reading, you’ll review how to navigate the file system using Linux commands in Bash. You’ll further explore the organization of the Linux Filesystem Hierarchy Standard, review several common Linux commands for navigation and reading file content, and learn a couple of new commands.

## Filesystem Hierarchy Standard (FHS)

Previously, you learned that the **Filesystem Hierarchy Standard** **(FHS)** is the component of Linux that organizes data. The FHS is important because it defines how directories, directory contents, and other storage is organized in the operating system.

This diagram illustrates the hierarchy of relationships under the FHS:

<div class="rc-CML" dir="auto" id="bkmrk-"><div><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml" data-track-page="item_layout" role="presentation"><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml_link" data-track-page="item_layout"><div class="css-1k5v0wb" data-testid="cml-viewer"><div><figure contenteditable="false" role="figure">![Flowchart starts with the root directory at the top and branches down into multiple subdirectories.](https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/j0RYvFG7TpGNNfni5SSa0Q_012d7d577b564b4fa3ead21d3f69ebf1_Dvcfull14z4M8iWFX3SE6wnrTefQLql8gas9ICAiKpixcG31SsHLbQmACjE1B4qfpEwTcHfkiD1hxEVGhjyYngw0-fXASC-TSuTgXTBpz_qS4pmXtp-Y7i7giD3GJKCkvajg0PzNebmAf6wDKOBNL-SrMDhBJhsE4yH5Es2_bKRVPC0goRafLVPJs81beg?expiry=1688688000000&hmac=wJrU0NP40u2Z7UeZDqrJNIT6IBHtLTixNycjNUzUfJA)</figure></div></div></div></div></div></div>Under the FHS, a file’s location can be described by a file path. A **file path** is the location of a file or directory. In the file path, the different levels of the hierarchy are separated by a forward slash (<var>/</var>).

### **Root directory**

The **root directory** is the highest-level directory in Linux, and it’s always represented with a forward slash (<var>/</var>). All subdirectories branch off the root directory. Subdirectories can continue branching out to as many levels as necessary.

### Standard FHS directories

Directly below the root directory, you’ll find standard FHS directories. In the diagram, <var>home</var>, <var>bin</var>, and <var>etc</var> are standard FHS directories. Here are a few examples of what standard directories contain:

<div class="rc-CML" dir="auto" id="bkmrk-%2Fhome%3A-each-user-in-"><div><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml" data-track-page="item_layout" role="presentation"><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml_link" data-track-page="item_layout"><div class="css-1k5v0wb" data-testid="cml-viewer">- <var>/home</var>: Each user in the system gets their own home directory.
- <var>/bin</var>: This directory stands for “binary” and contains binary files and other executables. Executables are files that contain a series of commands a computer needs to follow to run programs and perform other functions.
- <var>/etc</var>: This directory stores the system’s configuration files.
- <var>/tmp</var>: This directory stores many temporary files. The <var>/tmp</var> directory is commonly used by attackers because anyone in the system can modify data in these files.
- <var>/mnt</var>: This directory stands for “mount” and stores media, such as USB drives and hard drives.

</div></div></div></div></div>**Pro Tip**: You can use the <var>man hier</var> command to learn more about the FHS and its standard directories.

### **User-specific subdirectories**

Under <var>home</var> are subdirectories for specific users. In the diagram, these users are <var>analyst</var> and <var>analyst2</var>. Each user has their own personal subdirectories, such as <var>projects</var>, <var>logs</var>, or <var>reports</var>.

**Note:** When the path leads to a subdirectory below the user’s home directory, the user’s home directory can be represented as the tilde (<var>~</var>). For example, <var>/home/analyst/logs</var> can also be represented as <var>~/logs</var>.

You can navigate to specific subdirectories using their absolute or relative file paths. The **absolute file path** is the full file path, which starts from the root. For example, <var>/home/analyst/projects</var> is an absolute file path. The **relative file path** is the file path that starts from a user's current directory.

**Note:** Relative file paths can use a dot (<var>.</var>) to represent the current directory, or two dots (<var>..</var>) to represent the parent of the current directory. An example of a relative file path could be <var>../projects</var>.

## Key commands for navigating the file system

The following Linux commands can be used to navigate the file system: <var>pwd</var>, <var>ls</var>, and <var>cd</var>.

### **pwd**

The <var>pwd</var> command prints the working directory to the screen. Or in other words, it returns the directory that you’re currently in.

The output gives you the absolute path to this directory. For example, if you’re in your <var>home</var> directory and your username is <var>analyst</var>, entering <var>pwd</var> returns <var>/home/analyst</var>.

**Pro Tip**: To learn what your username is, use the <var>whoami</var> command. The <var>whoami</var> command returns the username of the current user. For example, if your username is <var>analyst</var>, entering <var>whoami</var> returns <var>analyst</var>.

### **ls**

The <var>ls</var> command displays the names of the files and directories in the current working directory. For example, in the video, <var>ls</var> returned directories such as <var>logs</var>, and a file called <var>updates.txt</var>.

**Note**: If you want to return the contents of a directory that’s not your current working directory, you can add an argument after <var>ls</var> with the absolute or relative file path to the desired directory. For example, if you’re in the <var>/home/analyst</var> directory but want to list the contents of its <var>projects</var> subdirectory, you can enter <var>ls /home/analyst/projects</var> or just <var>ls projects</var>.

### **cd**

The <var>cd</var> command navigates between directories. When you need to change directories, you should use this command.

To navigate to a subdirectory of the current directory, you can add an argument after <var>cd</var> with the subdirectory name. For example, if you’re in the <var>/home/analyst</var> directory and want to navigate to its <var>projects</var> subdirectory, you can enter <var>cd projects</var>.

You can also navigate to any specific directory by entering the absolute file path. For example, if you’re in <var>/home/analyst/projects</var>, entering <var>cd /home/analyst/logs</var> changes your current directory to <var>/home/analyst/logs</var>.

**Pro Tip**: You can use the relative file path and enter <var>cd ..</var> to go up one level in the file structure. For example, if the current directory is <var>/home/analyst/projects</var>, entering <var>cd ..</var> would change your working directory to <var>/home/analyst</var>.

## Common commands for reading file content

The following Linux commands are useful for reading file content: <var>cat</var>, <var>head</var>, <var>tail</var>, and <var>less</var>.

### **cat**

The <var>cat</var> command displays the content of a file. For example, entering <var>cat updates.txt</var> returns everything in the <var>updates.txt</var> file.

h.l.

The `cat` command in Linux is short for "concatenate", which means to link things together in a series or chain. The `cat` command is one of the most commonly used commands in Unix-like operating systems like Linux. It reads data from files and outputs their contents. It can also concatenate and display the contents of more than one file.

### **head**

The <var>head</var> command displays just the beginning of a file, by default 10 lines. The <var>head</var> command can be useful when you want to know the basic contents of a file but don’t need the full contents. Entering <var>head updates.txt</var> returns only the first 10 lines of the <var>updates.txt</var> file.

**Pro Tip**: If you want to change the number of lines returned by <var>head</var>, you can specify the number of lines by including <var>-n</var>. For example, if you only want to display the first five lines of the <var>updates.txt</var> file, enter <var>head -n 5 updates.txt</var>.

### **tail**

The <var>tail</var> command does the opposite of <var>head</var>. This command can be used to display just the end of a file, by default 10 lines. Entering <var>tail updates.txt</var> returns only the last 10 lines of the <var>updates.txt</var> file.

**Pro Tip**: You can use <var>tail</var> to read the most recent information in a log file.

### **less**

The <var>less</var> command returns the content of a file one page at a time. For example, entering <var>less updates.txt</var> changes the terminal window to display the contents of <var>updates.txt</var> one page at a time. This allows you to easily move forward and backward through the content.

Once you’ve accessed your content with the <var>less</var> command, you can use several keyboard controls to move through the file:

<div class="rc-CML" dir="auto" id="bkmrk-space-bar%3A-move-forw"><div><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml" data-track-page="item_layout" role="presentation"><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml_link" data-track-page="item_layout"><div class="css-1k5v0wb" data-testid="cml-viewer">- <var>Space bar</var>: Move forward one page
- <var>b</var>: Move back one page
- <var>Down arrow</var>: Move forward one line
- <var>Up arrow</var>: Move back one line
- <var>q</var>: Quit and return to the previous terminal window

</div></div></div></div></div>note to future NaruZkurai, this control scheme is ascinine, i will be ripping this command then creating one called  
nzkread

## Key takeaways

It’s important for security analysts to be able to navigate Linux and the file system of the FHS. Some key commands for navigating the file system include <var>pwd</var>, <var>ls</var>, and <var>cd</var>. Reading file content is also an important skill in the security profession. This can be done with commands such as <var>cat</var>, <var>head</var>, <var>tail</var>, and <var>less</var>.

# Find what you need with Linux

<div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-now-that-we-covered%3A"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Now that we covered: pwd, ls," class="rc-Phrase css-ugczj4" data-cue="1" data-cue-index="0" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Now that we covered: pwd, ls, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and cd and are familiar with </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">these basic commands for </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">navigating the Linux file system, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">let's look at a couple of ways to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">find what you need within this system. </span></div><div aria-label="toggle video from As a security analyst," class="rc-Phrase css-ugczj4" data-cue="7" data-cue-index="6" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">As a security analyst, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">your work will likely involve </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">filtering for the information you need. </span></div><div aria-label="toggle video from Filtering means searching your system for" class="rc-Phrase css-ugczj4" data-cue="10" data-cue-index="9" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Filtering means searching your system for </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">specific information that can </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">help you solve complex problems. </span></div><div aria-label="toggle video from For example, imagine that your team" class="rc-Phrase css-ugczj4" data-cue="13" data-cue-index="12" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">For example, imagine that your team </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">determines a piece of </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">malware contains a string of characters. </span></div><div aria-label="toggle video from You might be tasked with finding other files with" class="rc-Phrase css-ugczj4" data-cue="16" data-cue-index="15" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">You might be tasked with finding other files with </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the same string to determine if </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">those files contain the same malware. </span></div><div aria-label="toggle video from Later, we'll learn more about how" class="rc-Phrase css-ugczj4" data-cue="19" data-cue-index="18" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Later, we'll learn more about how </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">you can use SQL to filter a database, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">but Linux is a good place to start basic filtering. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-first%2C-we%27ll-start-w"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from First, we'll start with grep." class="rc-Phrase css-ugczj4" data-cue="22" data-cue-index="21" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">First, we'll start with grep. </span></div><div aria-label="toggle video from First, we'll start with grep." class="rc-Phrase css-ugczj4" data-cue="22" data-cue-index="21" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The grep command searches a specified file and </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">returns all lines in </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the file containing a specified string. </span></div><div aria-label="toggle video from First, we'll start with grep." class="rc-Phrase css-ugczj4" data-cue="22" data-cue-index="21" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Here's an example of this. </span></div><div aria-label="toggle video from Let's say we have a file called updates.txt," class="rc-Phrase css-ugczj4" data-cue="27" data-cue-index="26" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's say we have a file called updates.txt, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and we're currently looking for lines that </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">contain the word: OS. </span></div><div aria-label="toggle video from If the file is large," class="rc-Phrase css-ugczj4" data-cue="30" data-cue-index="29" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">If the file is large, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">it would take a long time to visually scan for this. </span></div><div aria-label="toggle video from Instead, after navigating to" class="rc-Phrase css-ugczj4" data-cue="32" data-cue-index="31" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Instead, after navigating to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the directory that contains updates.txt, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we'll type the command: </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">grep OS updates.txt into the shell. </span></div><div aria-label="toggle video from Notice how the grep command is followed by two arguments." class="rc-Phrase css-ugczj4" data-cue="36" data-cue-index="35" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Notice how the grep command is followed by two arguments. </span></div><div aria-label="toggle video from Notice how the grep command is followed by two arguments." class="rc-Phrase css-ugczj4" data-cue="36" data-cue-index="35" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The first argument is the string we're searching for; </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">in this case, OS. </span></div><div aria-label="toggle video from The second argument is the name of the file" class="rc-Phrase css-ugczj4" data-cue="39" data-cue-index="38" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The second argument is the name of the file </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we're searching through, updates.txt. </span></div><div aria-label="toggle video from When we press enter," class="rc-Phrase css-ugczj4" data-cue="41" data-cue-index="40" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">When we press enter, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Bash returns all lines containing the word OS. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--1"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-now-let%27s-talk-about"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Now let's talk about piping." class="rc-Phrase css-ugczj4" data-cue="43" data-cue-index="42" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Now let's talk about piping. </span></div><div aria-label="toggle video from Piping is a Linux command that" class="rc-Phrase css-ugczj4" data-cue="44" data-cue-index="43" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Piping is a Linux command that </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">can be used for a variety of purposes. </span></div><div aria-label="toggle video from In a moment, we'll focus on" class="rc-Phrase css-ugczj4" data-cue="46" data-cue-index="45" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In a moment, we'll focus on </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">how it can be used for filtering. </span></div><div aria-label="toggle video from But first, let's talk about the general idea of piping." class="rc-Phrase css-ugczj4" data-cue="48" data-cue-index="47" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">But first, let's talk about the general idea of piping. </span></div><div aria-label="toggle video from The piping command sends a standard output of" class="rc-Phrase css-ugczj4" data-cue="49" data-cue-index="48" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The piping command sends a standard output of </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">one command as standard input </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">into another command for further processing. </span></div><div aria-label="toggle video from It's represented by the vertical bar character." class="rc-Phrase css-ugczj4" data-cue="52" data-cue-index="51" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">It's represented by the vertical bar character. </span></div><div aria-label="toggle video from It's represented by the vertical bar character." class="rc-Phrase css-ugczj4" data-cue="52" data-cue-index="51" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In our context, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we can refer to this as the pipe character. </span></div><div aria-label="toggle video from Take a moment and imagine a physical pipe." class="rc-Phrase css-ugczj4" data-cue="55" data-cue-index="54" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Take a moment and imagine a physical pipe. </span></div><div aria-label="toggle video from Physical pipes have two ends." class="rc-Phrase css-ugczj4" data-cue="56" data-cue-index="55" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Physical pipes have two ends. </span></div><div aria-label="toggle video from On one end, for example," class="rc-Phrase css-ugczj4" data-cue="57" data-cue-index="56" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">On one end, for example, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">water might enter the pipe from a hot water tank. </span></div><div aria-label="toggle video from Then, it travels through the pipe and" class="rc-Phrase css-ugczj4" data-cue="59" data-cue-index="58" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Then, it travels through the pipe and </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">comes out on the other end in a sink. </span></div><div aria-label="toggle video from Similarly, in Linux," class="rc-Phrase css-ugczj4" data-cue="61" data-cue-index="60" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Similarly, in Linux, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">piping also involves redirection. </span></div><div aria-label="toggle video from Output from one command is sent through" class="rc-Phrase css-ugczj4" data-cue="63" data-cue-index="62" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Output from one command is sent through </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the pipe and then is used on the other side of the pipe. </span></div><div aria-label="toggle video from Earlier in this video," class="rc-Phrase css-ugczj4" data-cue="65" data-cue-index="64" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Earlier in this video, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">I explained how grep can be used to filter for </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">strings of characters within a file. </span></div><div aria-label="toggle video from Grep can also be incorporated after a pipe." class="rc-Phrase css-ugczj4" data-cue="68" data-cue-index="67" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Grep can also be incorporated after a pipe. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--2"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-let%27s-focus-on-this-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Let's focus on this example." class="rc-Phrase css-ugczj4" data-cue="69" data-cue-index="68" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's focus on this example. </span></div><div aria-label="toggle video from The first command, ls," class="rc-Phrase css-ugczj4" data-cue="70" data-cue-index="69" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The first command, ls, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">instructs the operating system to output the file </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and directory contents of their reports subdirectory. </span></div><div aria-label="toggle video from But because the command is followed by the pipe," class="rc-Phrase css-ugczj4" data-cue="73" data-cue-index="72" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">But because the command is followed by the pipe, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the output isn't returned to the screen. </span></div><div aria-label="toggle video from Instead, it's sent to the next command." class="rc-Phrase css-ugczj4" data-cue="75" data-cue-index="74" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Instead, it's sent to the next command. </span></div><div aria-label="toggle video from As we just learned," class="rc-Phrase css-ugczj4" data-cue="76" data-cue-index="75" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">As we just learned, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">grep searches for a specified string of characters; </span></div><div aria-label="toggle video from in this case, it's users." class="rc-Phrase css-ugczj4" data-cue="78" data-cue-index="77" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">in this case, it's users. </span></div><div aria-label="toggle video from But where is it searching?" class="rc-Phrase css-ugczj4" data-cue="79" data-cue-index="78" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">But where is it searching? </span></div><div aria-label="toggle video from Since grep follows a pipe," class="rc-Phrase css-ugczj4" data-cue="80" data-cue-index="79" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Since grep follows a pipe, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the output of the previous command </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">indicates where to search. </span></div><div aria-label="toggle video from In this case, that output is a list of" class="rc-Phrase css-ugczj4" data-cue="83" data-cue-index="82" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In this case, that output is a list of </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">files and directories within the reports subdirectory. </span></div><div aria-label="toggle video from It will return all files and" class="rc-Phrase css-ugczj4" data-cue="85" data-cue-index="84" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">It will return all files and </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">directories that contain the word: users. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--3"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-let%27s-explore-this-i"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Let's explore this in Bash." class="rc-Phrase css-ugczj4" data-cue="87" data-cue-index="86" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's explore this in Bash. </span></div><div aria-label="toggle video from So we can better understand how the filter works," class="rc-Phrase css-ugczj4" data-cue="88" data-cue-index="87" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">So we can better understand how the filter works, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">let's first output everything in the reports directory. </span></div><div aria-label="toggle video from If we were already in the directory," class="rc-Phrase css-ugczj4" data-cue="90" data-cue-index="89" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">If we were already in the directory, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we would just need to input ls. </span></div><div aria-label="toggle video from But since we're not, we'll also" class="rc-Phrase css-ugczj4" data-cue="92" data-cue-index="91" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">But since we're not, we'll also </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">specify the path to this directory. </span></div><div aria-label="toggle video from When we press enter," class="rc-Phrase css-ugczj4" data-cue="94" data-cue-index="93" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">When we press enter, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the output indicates there are </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">seven files in the reports directory. </span></div><div aria-label="toggle video from Because we want to return" class="rc-Phrase css-ugczj4" data-cue="97" data-cue-index="96" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Because we want to return </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">only the files that contain the word users, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we'll combine this ls command </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">with piping and the grep command. </span></div><div aria-label="toggle video from As the output demonstrates," class="rc-Phrase css-ugczj4" data-cue="101" data-cue-index="100" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">As the output demonstrates, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Linux has been instructed to return </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">only files that contain the word users. </span></div><div aria-label="toggle video from only files that contain the word users." class="rc-Phrase css-ugczj4" data-cue="103" data-cue-index="102" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The two files that don't contain </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">this string no longer appear. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--4"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="phrases" id="bkmrk-so-now-you-have-two-"><div aria-label="toggle video from So now you have two different ways that you can" class="rc-Phrase css-ugczj4" data-cue="106" data-cue-index="105" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">So now you have two different ways that you can </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">filter in Linux while working as an analyst. </span></div><div aria-label="toggle video from Navigating through files and" class="rc-Phrase css-ugczj4" data-cue="108" data-cue-index="107" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Navigating through files and </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">filtering are just part of what you need to know. </span></div><div aria-label="toggle video from Let's keep exploring the Linux command line." class="rc-Phrase css-ugczj4" data-cue="110" data-cue-index="109" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's keep exploring the Linux command line. </span></div></div>

# Filter content in Linux

In this reading, you’ll continue exploring Linux commands, which can help you filter for the information you need. You’ll learn a new Linux command, <var>find</var>, which can help you search files and directories for specific information.

## Filtering for information

You previously explored how filtering for information is an important skill for security analysts. **Filtering** is selecting data that match a certain condition. For example, if you had a virus in your system that only affected the <var>.txt</var> files, you could use filtering to find these files quickly. Filtering allows you to search based on specific criteria, such as file extension or a string of text.

## grep

The <var>grep</var> command searches a specified file and returns all lines in the file containing a specified string. The <var>grep</var> command commonly takes two arguments: a specific string to search for and a specific file to search through.

For example, entering <var>grep OS updates.txt</var> returns all lines containing <var>OS</var> in the <var>updates.txt</var> file. In this example, <var>OS</var> is the specific string to search for, and <var>updates.txt</var> is the specific file to search through.

## Piping

The pipe command is accessed using the pipe character (<var>|</var>). **Piping** sends the standard output of one command as standard input to another command for further processing. As a reminder, **standard output** is information returned by the OS through the shell, and **standard input** is information received by the OS via the command line.

The pipe character (<var>|</var>) is located in various places on a keyboard. On many keyboards, it’s located on the same key as the backslash character (<var>\\</var>). On some keyboards, the <var>|</var> can look different and have a small space through the middle of the line. If you can’t find the <var>|</var>, search online for its location on your particular keyboard.

When used with <var>grep</var>, the pipe can help you find directories and files containing a specific word in their names. For example, <var>ls /home/analyst/reports | grep users</var> returns the file and directory names in the <var>reports</var> directory that contain <var>users</var>. Before the pipe, <var>ls</var> indicates to list the names of the files and directories in <var>reports</var>. Then, it sends this output to the command after the pipe. In this case, <var>grep users</var> returns all of the file or directory names containing <var>users</var> from the input it received.

**Note:** Piping is a general form of redirection in Linux and can be used for multiple tasks other than filtering. You can think of piping as a general tool that you can use whenever you want the output of one command to become the input of another command.

## find

The <var>find</var> command searches for directories and files that meet specified criteria. There’s a wide range of criteria that can be specified with <var>find</var>. For example, you can search for files and directories that

<div class="rc-CML" dir="auto" id="bkmrk-contain-a-specific-s"><div><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml" data-track-page="item_layout" role="presentation"><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml_link" data-track-page="item_layout"><div class="css-1k5v0wb" data-testid="cml-viewer">- Contain a specific string in the name,
- Are a certain file size, or
- Were last modified within a certain time frame.

</div></div></div></div></div>When using <var>find</var>, the first argument after <var>find</var> indicates where to start searching. For example, entering <var>find /home/analyst/projects</var> searches for everything starting at the <var>projects</var> directory.

After this first argument, you need to indicate your criteria for the search. If you don’t include a specific search criteria with your second argument, your search will likely return a lot of directories and files.

Specifying criteria involves options. **Options** modify the behavior of a command and commonly begin with a hyphen (<var>-</var>).

### **-name and -iname**

One key criteria analysts might use with <var>find</var> is to find file or directory names that contain a specific string. The specific string you’re searching for must be entered in quotes after the <var>-name</var> or <var>-iname</var> options. The difference between these two options is that <var>-name</var> is case-sensitive, and <var>-iname</var> is not.

For example, you might want to find all files in the <var>projects</var> directory that contain the word “log” in the file name. To do this, you’d enter <var>find /home/analyst/projects -name "\*log\*"</var>. You could also enter <var>find /home/analyst/projects -iname "\*log\*"</var>.

In these examples, the output would be all files in the <var>projects</var> directory that contain <var>log</var> surrounded by zero or more characters. The <var>"\*log\*"</var> portion of the command is the search criteria that indicates to search for the string “log”. When <var>-name</var> is the option, files with names that include <var>Log</var> or <var>LOG</var>, for example, wouldn’t be returned because this option is case-sensitive. However, they would be returned when <var>-iname</var> is the option.

**Note**: An asterisk (<var>\*</var>) is used as a wildcard to represent zero or more unknown characters.

### **-mtime**

Security analysts might also use <var>find</var> to find files or directories last modified within a certain time frame. The <var>-mtime</var> option can be used for this search. For example, entering <var>find /home/analyst/projects -mtime -3</var> returns all files and directories in the <var>projects</var> directory that have been modified within the past three days.

The <var>-mtime</var> option search is based on days, so entering <var>-mtime +1</var> indicates all files or directories last modified more than one day ago, and entering <var>-mtime -1</var> indicates all files or directories last modified less than one day ago.

**Note:** The option <var>-mmin</var> can be used instead of <var>-mtime</var> if you want to base the search on minutes rather than days.

## Key takeaways

Filtering for information using Linux commands is an important skill for security analysts so that they can customize data to fit their needs. Three key Linux commands for this are <var>grep</var>, piping (<var>|</var>), and <var>find</var>. These commands can be used to navigate and filter for information in the file system.

# Create and modify directories and files

<div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-let%27s-make-some-bran"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Let's make some branches!" class="rc-Phrase css-ugczj4" data-cue="1" data-cue-index="0" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's make some branches! </span></div><div aria-label="toggle video from What do I mean by that?" class="rc-Phrase css-ugczj4" data-cue="2" data-cue-index="1" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">What do I mean by that? </span></div><div aria-label="toggle video from Well, in a previous video," class="rc-Phrase css-ugczj4" data-cue="3" data-cue-index="2" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Well, in a previous video, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we discussed root directories and </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">how other subdirectories branch </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">off of the root directory. </span></div><div aria-label="toggle video from Let's think again about" class="rc-Phrase css-ugczj4" data-cue="7" data-cue-index="6" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's think again about </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the file directory system as a tree. </span></div><div aria-label="toggle video from The subdirectories are the branches of the tree." class="rc-Phrase css-ugczj4" data-cue="9" data-cue-index="8" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The subdirectories are the branches of the tree. </span></div><div aria-label="toggle video from They're all connected from the same root" class="rc-Phrase css-ugczj4" data-cue="10" data-cue-index="9" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">They're all connected from the same root </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">but can grow to make a complex tree. </span></div><div aria-label="toggle video from In this video, we'll create" class="rc-Phrase css-ugczj4" data-cue="12" data-cue-index="11" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In this video, we'll create </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">directories and files and learn how to modify them. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-when-it-comes-to-wor"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from When it comes to working with data in" class="rc-Phrase css-ugczj4" data-cue="14" data-cue-index="13" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">When it comes to working with data in </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">security, organization is key. </span></div><div aria-label="toggle video from If we know where information is located," class="rc-Phrase css-ugczj4" data-cue="16" data-cue-index="15" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">If we know where information is located, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">it makes it easier to detect </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">issues and keep information safe. </span></div><div aria-label="toggle video from In a previous video," class="rc-Phrase css-ugczj4" data-cue="19" data-cue-index="18" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In a previous video, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we've already discussed navigating between directories, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">but let's take a moment to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">examine directories more closely. </span></div><div aria-label="toggle video from It's possible you're familiar with the concept" class="rc-Phrase css-ugczj4" data-cue="23" data-cue-index="22" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">It's possible you're familiar with the concept </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">of folders for organizing information. </span></div><div aria-label="toggle video from It's possible you're familiar with the concept" class="rc-Phrase css-ugczj4" data-cue="23" data-cue-index="22" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In Linux, we have directories. </span></div><div aria-label="toggle video from Directories help organize files and subdirectories." class="rc-Phrase css-ugczj4" data-cue="26" data-cue-index="25" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Directories help organize files and subdirectories. </span></div><div aria-label="toggle video from For example, within a directory for reports," class="rc-Phrase css-ugczj4" data-cue="27" data-cue-index="26" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">For example, within a directory for reports</span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">an analyst may need to create two subdirectories: </span></div><div aria-label="toggle video from For example, within a directory for reports," class="rc-Phrase css-ugczj4" data-cue="27" data-cue-index="26" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">one for drafts and one for final reports. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--1"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-now-that-we-know-why"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Now that we know why we need directories," class="rc-Phrase css-ugczj4" data-cue="30" data-cue-index="29" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Now that we know why we need directories, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">et's take a look at </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">some essential Linux commands for </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">managing directories and files. </span></div><div aria-label="toggle video from First, let's take note of" class="rc-Phrase css-ugczj4" data-cue="34" data-cue-index="33" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">First, let's take note of </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">commands for creating and removing directories. </span></div><div aria-label="toggle video from The mkdir command creates a new directory." class="rc-Phrase css-ugczj4" data-cue="36" data-cue-index="35" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The mkdir command creates a new directory. </span></div><div aria-label="toggle video from The mkdir command creates a new directory." class="rc-Phrase css-ugczj4" data-cue="36" data-cue-index="35" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In contrast, rmdir removes or deletes a directory. </span></div><div aria-label="toggle video from A helpful feature of this command is" class="rc-Phrase css-ugczj4" data-cue="38" data-cue-index="37" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">A helpful feature of this command is </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">its built-in warning that lets you </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">know a directory is not empty. </span></div><div aria-label="toggle video from This saves you from accidentally deleting files." class="rc-Phrase css-ugczj4" data-cue="41" data-cue-index="40" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This saves you from accidentally deleting files. </span></div><div aria-label="toggle video from This saves you from accidentally deleting files." class="rc-Phrase css-ugczj4" data-cue="41" data-cue-index="40" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Next, you'll use </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">other commands for creating and removing files. </span></div><div aria-label="toggle video from The touch command creates a new file," class="rc-Phrase css-ugczj4" data-cue="44" data-cue-index="43" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The touch command creates a new file, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and then the rm command removes or deletes a file. </span></div><div aria-label="toggle video from And last, we have our commands for copying" class="rc-Phrase css-ugczj4" data-cue="46" data-cue-index="45" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">And last, we have our commands for copying </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and moving files or directories. </span></div><div aria-label="toggle video from The mv command moves a file or directory to new location," class="rc-Phrase css-ugczj4" data-cue="48" data-cue-index="47" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The mv command moves a file or directory to new location, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and cp copies a file or directory into a new location. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--2"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-now%2C-we%27re-ready-to-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Now, we're ready to try out these commands." class="rc-Phrase css-ugczj4" data-cue="50" data-cue-index="49" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Now, we're ready to try out these commands. </span></div><div aria-label="toggle video from First, let's use the pwd command," class="rc-Phrase css-ugczj4" data-cue="51" data-cue-index="50" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">First, let's use the pwd command, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and then let's display the names of the files and </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">directories in the analyst directory with the ls command. </span></div><div aria-label="toggle video from Imagine that we no longer need" class="rc-Phrase css-ugczj4" data-cue="54" data-cue-index="53" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Imagine that we no longer need </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the oldreports directory that </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">appears among the file contents. </span></div><div aria-label="toggle video from Let's take a look at how to remove it." class="rc-Phrase css-ugczj4" data-cue="57" data-cue-index="56" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's take a look at how to remove it. </span></div><div aria-label="toggle video from We input the rmdir command and follow it with" class="rc-Phrase css-ugczj4" data-cue="58" data-cue-index="57" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We input the rmdir command and follow it with </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the name of the directory we want to remove: oldreports. </span></div><div aria-label="toggle video from We can use the ls command to confirm that" class="rc-Phrase css-ugczj4" data-cue="60" data-cue-index="59" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We can use the ls command to confirm that </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">oldreports has been deleted </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and no longer appears among the contents. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--3"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-now%2C-let%27s-make-anot"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Now, let's make another change." class="rc-Phrase css-ugczj4" data-cue="63" data-cue-index="62" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Now, let's make another change. </span></div><div aria-label="toggle video from We want a new directory for drafts of reports." class="rc-Phrase css-ugczj4" data-cue="64" data-cue-index="63" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We want a new directory for drafts of reports. </span></div><div aria-label="toggle video from We need to use the command: mkdir" class="rc-Phrase css-ugczj4" data-cue="65" data-cue-index="64" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We need to use the command: mkdir </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and specify a name for this directory: drafts. </span></div><div aria-label="toggle video from If we input ls again," class="rc-Phrase css-ugczj4" data-cue="67" data-cue-index="66" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">If we input ls again, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we'll notice the new directory drafts </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">included among the contents of the analyst directory. </span></div><div aria-label="toggle video from Let's change into this new directory" class="rc-Phrase css-ugczj4" data-cue="70" data-cue-index="69" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's change into this new directory </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">by entering: cd drafts. </span></div><div aria-label="toggle video from If we run ls," class="rc-Phrase css-ugczj4" data-cue="72" data-cue-index="71" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">If we run ls, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">it doesn't return any output, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">indicating that this directory is currently empty. </span></div><div aria-label="toggle video from But next, we'll add some files to it." class="rc-Phrase css-ugczj4" data-cue="75" data-cue-index="74" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">But next, we'll add some files to it. </span></div><div aria-label="toggle video from Let's say we want to draft new reports on" class="rc-Phrase css-ugczj4" data-cue="76" data-cue-index="75" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's say we want to draft new reports on </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">recently installed email and OS patches. </span></div><div aria-label="toggle video from To create these files," class="rc-Phrase css-ugczj4" data-cue="78" data-cue-index="77" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">To create these files, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we input: touch email\_patches.txt </span></div><div aria-label="toggle video from and then: touch OS_patches.txt." class="rc-Phrase css-ugczj4" data-cue="80" data-cue-index="79" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and then: touch OS\_patches.txt. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--4"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-running-ls-indicates"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Running ls indicates that" class="rc-Phrase css-ugczj4" data-cue="81" data-cue-index="80" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Running ls indicates that </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">these files are now in the drafts directory. </span></div><div aria-label="toggle video from What if we realize that we only need a new report on" class="rc-Phrase css-ugczj4" data-cue="83" data-cue-index="82" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">What if we realize that we only need a new report on </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">OS patches and we want </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">to delete the email patches report? </span></div><div aria-label="toggle video from To do this, we input the rm command and specify the file" class="rc-Phrase css-ugczj4" data-cue="86" data-cue-index="85" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">To do this, we input the rm command and specify the file </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">to delete as: email\_patches.txt. </span></div><div aria-label="toggle video from Running ls confirms that it's been deleted." class="rc-Phrase css-ugczj4" data-cue="88" data-cue-index="87" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Running ls confirms that it's been deleted. </span></div><div aria-label="toggle video from Running ls confirms that it's been deleted." class="rc-Phrase css-ugczj4" data-cue="88" data-cue-index="87" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Now, let's focus on our commands for moving and copying. </span></div><div aria-label="toggle video from We realized that we have a file called email" class="rc-Phrase css-ugczj4" data-cue="90" data-cue-index="89" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We realized that we have a file called email </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">policy in the reports folder </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">that is currently in draft format. </span></div><div aria-label="toggle video from We want to move it into the newly created drafts folder." class="rc-Phrase css-ugczj4" data-cue="93" data-cue-index="92" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We want to move it into the newly created drafts folder. </span></div><div aria-label="toggle video from We want to move it into the newly created drafts folder." class="rc-Phrase css-ugczj4" data-cue="93" data-cue-index="92" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">To do this, we need to change </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">into the directory that currently has that file. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--5"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-running-ls-in-that-d"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Running ls in that directory indicates that it contains" class="rc-Phrase css-ugczj4" data-cue="96" data-cue-index="95" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Running ls in that directory indicates that it contains </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">several files, including email\_policy.txt. </span></div><div aria-label="toggle video from Then to move that file," class="rc-Phrase css-ugczj4" data-cue="98" data-cue-index="97" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Then to move that file, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we'll enter the mv command followed by two arguments. </span></div><div aria-label="toggle video from The first argument" class="rc-Phrase css-ugczj4" data-cue="100" data-cue-index="99" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The first argument </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">after mv identifies the file to be moved. </span></div><div aria-label="toggle video from The second argument indicates where to move it." class="rc-Phrase css-ugczj4" data-cue="102" data-cue-index="101" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The second argument indicates where to move it. </span></div><div aria-label="toggle video from If we change directories into" class="rc-Phrase css-ugczj4" data-cue="103" data-cue-index="102" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">If we change directories into </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">drafts and then display its contents, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we'll notice that the email policy file </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">has been moved to this directory. </span></div><div aria-label="toggle video from We'll change back into reports." class="rc-Phrase css-ugczj4" data-cue="107" data-cue-index="106" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We'll change back into reports. </span></div><div aria-label="toggle video from Displaying the file contents confirms that" class="rc-Phrase css-ugczj4" data-cue="108" data-cue-index="107" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Displaying the file contents confirms that </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">email\_policy is no longer there. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--6"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-okay%2C-one-more-thing"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Okay, one more thing. vulnerabilities.txt is" class="rc-Phrase css-ugczj4" data-cue="110" data-cue-index="109" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Okay, one more thing. vulnerabilities.txt is </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">a file that we want to keep in the reports directory. </span></div><div aria-label="toggle video from But since it affects an upcoming project," class="rc-Phrase css-ugczj4" data-cue="112" data-cue-index="111" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">But since it affects an upcoming project, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we also want to copy it into the project's directory. </span></div><div aria-label="toggle video from Since we're already in the directory that has this file," class="rc-Phrase css-ugczj4" data-cue="114" data-cue-index="113" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Since we're already in the directory that has this file, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we'll use the cp command to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">copy it into the projects directory. </span></div><div aria-label="toggle video from Notice that the first argument" class="rc-Phrase css-ugczj4" data-cue="117" data-cue-index="116" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Notice that the first argument </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">indicates which file to copy, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and the second argument provides </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the path to the directory that it will be copied into. </span></div><div aria-label="toggle video from Notice that the first argument" class="rc-Phrase css-ugczj4" data-cue="117" data-cue-index="116" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">When we press Enter, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">this copies the vulnerabilities file into </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the projects directory while also </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">leaving the original within reports. </span></div><div aria-label="toggle video from Isn't it cool what we can do with these commands?" class="rc-Phrase css-ugczj4" data-cue="125" data-cue-index="124" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Isn't it cool what we can do with these commands? </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--7"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-now%2C-let%27s-focus-on%C2%A0"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Now, let's focus on" class="rc-Phrase css-ugczj4" data-cue="126" data-cue-index="125" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Now, let's focus on </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">one more concept related to modifying files. </span></div><div aria-label="toggle video from In addition to using commands," class="rc-Phrase css-ugczj4" data-cue="128" data-cue-index="127" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In addition to using commands, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">you can also use applications to help you edit files. </span></div><div aria-label="toggle video from As a security analyst," class="rc-Phrase css-ugczj4" data-cue="130" data-cue-index="129" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">As a security analyst, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">file editors are often necessary for </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">your daily tasks, like writing or editing reports. </span></div><div aria-label="toggle video from A popular file editor is nano." class="rc-Phrase css-ugczj4" data-cue="133" data-cue-index="132" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">A popular file editor is nano. </span></div><div aria-label="toggle video from A popular file editor is nano." class="rc-Phrase css-ugczj4" data-cue="133" data-cue-index="132" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">It's good for beginners. </span></div><div aria-label="toggle video from You can access this tool through the nano command." class="rc-Phrase css-ugczj4" data-cue="135" data-cue-index="134" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">You can access this tool through the nano command. </span></div><div aria-label="toggle video from Let's get familiar with nano together." class="rc-Phrase css-ugczj4" data-cue="136" data-cue-index="135" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's get familiar with nano together. </span></div><div aria-label="toggle video from We'll add a title to" class="rc-Phrase css-ugczj4" data-cue="137" data-cue-index="136" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We'll add a title to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">our new draft report: OS\_patches.txt. </span></div><div aria-label="toggle video from First, we change into" class="rc-Phrase css-ugczj4" data-cue="139" data-cue-index="138" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">First, we change into </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the directory containing that file, </span></div><div aria-label="toggle video from then we input nano" class="rc-Phrase css-ugczj4" data-cue="141" data-cue-index="140" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">then we input nano </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">followed by the name of the file we want </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">to edit: OS\_patches.txt. </span></div><div aria-label="toggle video from This brings up the nano file editor with that file open." class="rc-Phrase css-ugczj4" data-cue="144" data-cue-index="143" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This brings up the nano file editor with that file open. </span></div><div aria-label="toggle video from For now, we'll just enter" class="rc-Phrase css-ugczj4" data-cue="145" data-cue-index="144" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">For now, we'll just enter </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the title OS Patches by typing this into the editor. </span></div><div aria-label="toggle video from We need to save this before" class="rc-Phrase css-ugczj4" data-cue="147" data-cue-index="146" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We need to save this before </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">returning to the command line, and to do so, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we press Ctrl+O </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and then enter to save it with the current file name. </span></div><div aria-label="toggle video from We need to save this before" class="rc-Phrase css-ugczj4" data-cue="147" data-cue-index="146" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Then to exit, we press Ctrl+X. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--8"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="phrases" id="bkmrk-great-work%21-we%27ve-co"><div aria-label="toggle video from Great work!" class="rc-Phrase css-ugczj4" data-cue="152" data-cue-index="151" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Great work! </span></div><div aria-label="toggle video from We've covered a lot of topics here—from" class="rc-Phrase css-ugczj4" data-cue="153" data-cue-index="152" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We've covered a lot of topics here—from </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">creating and removing directories and files </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">to copying or moving them, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and just now, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we've added editing files. </span></div><div aria-label="toggle video from You're well on your way to learning Linux commands!" class="rc-Phrase css-ugczj4" data-cue="158" data-cue-index="157" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">You're well on your way to learning Linux commands! </span></div></div>

# Manage directories and files

Previously, you explored how to manage the file system using Linux commands. The following commands were introduced: <var>mkdir</var>, <var>rmdir</var>, <var>touch</var>, <var>rm</var>, <var>mv</var>, and <var>cp</var>. In this reading, you’ll review these commands, the nano text editor, and learn another way to write to files.

## Creating and modifying directories

### **mkdir**

The <var>mkdir</var> command creates a new directory. Like all of the commands presented in this reading, you can either provide the new directory as the absolute file path, which starts from the root, or as a relative file path, which starts from your current directory.

For example, if you want to create a new directory called <var>network</var> in your <var>/home/analyst/logs</var> directory, you can enter <var>mkdir /home/analyst/logs/network</var> to create this new directory. If you’re already in the <var>/home/analyst/logs</var> directory, you can also create this new directory by entering <var>mkdir network</var>.

**Pro Tip**: You can use the <var>ls</var> command to confirm the new directory was added.

### **rmdir**

The <var>rmdir</var> command removes, or deletes, a directory. For example, entering <var>rmdir /home/analyst/logs/network</var> would remove this empty directory from the file system.

**Note**: The <var>rmdir</var> command cannot delete directories with files or subdirectories inside. For example, entering <var>rmdir /home/analyst</var> returns an error message.

## Creating and modifying files

### **touch and rm**

The <var>touch</var> command creates a new file. This file won’t have any content inside. If your current directory is <var>/home/analyst/reports</var>, entering <var>touch permissions.txt</var> creates a new file in the <var>reports</var> subdirectory called <var>permissions.txt</var>.

The <var>rm</var> command removes, or deletes, a file. This command should be used carefully because it’s not easy to recover files deleted with <var>rm</var>. To remove the permissions file you just created, enter <var>rm permissions.txt</var>.

**Pro Tip:** You can verify that <var>permissions.txt</var> was successfully created or removed by entering <var>ls</var>.

### **mv and cp**

You can also use <var>mv</var> and <var>cp</var> when working with files. The <var>mv</var> command moves a file or directory to a new location, and the <var>cp</var> command copies a file or directory into a new location. The first argument after <var>mv</var> or <var>cp</var> is the file or directory you want to move or copy, and the second argument is the location you want to move or copy it to.

To move <var>permissions.txt</var> into the <var>logs</var> subdirectory, enter <var>mv permissions.txt /home/analyst/logs</var>. Moving a file removes the file from its original location. However, copying a file doesn’t remove it from its original location. To copy <var>permissions.txt</var> into the <var>logs</var> subdirectory while also keeping it in its original location, enter <var>cp permissions.txt /home/analyst/logs</var>.

**Note**: The <var>mv</var> command can also be used to rename files. To rename a file, pass the new name in as the second argument instead of the new location. For example, entering <var>mv permissions.txt perm.txt</var> renames the <var>permissions.txt</var> file to <var>perm.txt</var>.

## nano text editor

**nano** is a command-line file editor that is available by default in many Linux distributions. Many beginners find it easy to use, and it’s widely used in the security profession. You can perform multiple basic tasks in nano, such as creating new files and modifying file contents.

To open an existing file in nano from the directory that contains it, enter <var>nano</var> followed by the file name. For example, entering <var>nano permissions.txt</var> from the <var>/home/analyst/reports</var> directory opens a new nano editing window with the <var>permissions.txt</var> file open for editing. You can also provide the absolute file path to the file if you’re not in the directory that contains it.

You can also create a new file in nano by entering <var>nano</var> followed by a new file name. For example, entering <var>nano authorized\_users.txt</var> from the <var>/home/analyst/reports</var> directory creates the <var>authorized\_users.txt</var> file within that directory and opens it in a new nano editing window.

Since there isn't an auto-saving feature in nano, it’s important to save your work before exiting. To save a file in nano, use the keyboard shortcut <var>Ctrl + O</var>. You’ll be prompted to confirm the file name before saving. To exit out of nano, use the keyboard shortcut <var>Ctrl + X</var>.

**Note**: Vim and Emacs are also popular command-line text editors.

## Standard output redirection

There’s an additional way you can write to files. Previously, you learned about standard input and standard output. **Standard input** is information received by the OS via the command line, and **standard output** is information returned by the OS through the shell.

You’ve also learned about piping. **Piping** sends the standard output of one command as standard input to another command for further processing. It uses the pipe character (<var>|</var>).

In addition to the pipe (<var>|</var>), you can also use the right angle bracket (<var>&gt;</var>) and double right angle bracket (<var>&gt;&gt;</var>) operators to redirect standard output.

When used with <var>echo</var>, the <var>&gt;</var> and <var>&gt;&gt;</var> operators can be used to send the output of <var>echo</var> to a specified file rather than the screen. The difference between the two is that <var>&gt;</var> overwrites your existing file, and <var>&gt;&gt;</var> adds your content to the end of the existing file instead of overwriting it. The <var>&gt;</var> operator should be used carefully, because it’s not easy to recover overwritten files.

When you’re inside the directory containing the <var>permissions.txt</var> file, entering <var>echo "last updated date" &gt;&gt; permissions.txt</var> adds the string “last updated date” to the file contents. Entering <var>echo "time" &gt; permissions.txt</var> after this command overwrites the entire file contents of <var>permissions.txt</var> with the string “time”.

**Note:** Both the <var>&gt;</var> and <var>&gt;&gt;</var> operators will create a new file if one doesn’t already exist with your specified name.

## Key takeaways

Knowing how to manage the file system in Linux is an important skill for security analysts. Useful commands for this include: <var>mkdir</var>, <var>rmdir</var>, <var>touch</var>, <var>rm</var>, <var>mv</var>, and <var>cp</var>. When security analysts need to write to files, they can use the nano text editor, or the <var>&gt;</var> and <var>&gt;&gt;</var> operators.

# File permissions and ownership

<div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-hi-there.-it%27s-great"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from current lecture segment: Hi there. It's great to have you back!" class="rc-Phrase active css-ugczj4" data-cue="1" data-cue-index="0" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Hi there. It's great to have you back! </span></div><div aria-label="toggle video from Let's continue to learn more about how to" class="rc-Phrase css-ugczj4" data-cue="2" data-cue-index="1" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's continue to learn more about how to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">work in Linux as a security analyst. </span></div><div aria-label="toggle video from In this video, we'll explore" class="rc-Phrase css-ugczj4" data-cue="4" data-cue-index="3" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In this video, we'll explore </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">file and directory permissions. </span></div><div aria-label="toggle video from We'll learn how Linux represents permissions" class="rc-Phrase css-ugczj4" data-cue="6" data-cue-index="5" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We'll learn how Linux represents permissions </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and how you can check for the permissions </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">associated with files and directories. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-permissions-are-the-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Permissions are the type of" class="rc-Phrase css-ugczj4" data-cue="9" data-cue-index="8" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Permissions are the type of </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">access granted for a file or directory. </span></div><div aria-label="toggle video from Permissions are related to authorization." class="rc-Phrase css-ugczj4" data-cue="11" data-cue-index="10" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Permissions are related to authorization. </span></div><div aria-label="toggle video from Authorization is the concept of granting" class="rc-Phrase css-ugczj4" data-cue="12" data-cue-index="11" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Authorization is the concept of granting </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">access to specific resources in a system. </span></div><div aria-label="toggle video from Authorization allows you to limit" class="rc-Phrase css-ugczj4" data-cue="14" data-cue-index="13" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Authorization allows you to limit </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">access to specified files or directories. </span></div><div aria-label="toggle video from A good rule to follow is that" class="rc-Phrase css-ugczj4" data-cue="16" data-cue-index="15" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">A good rule to follow is that </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">data access is on a need-to-know basis. </span></div><div aria-label="toggle video from You can imagine the security risk" class="rc-Phrase css-ugczj4" data-cue="18" data-cue-index="17" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">You can imagine the security risk </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">it would impose if anyone </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">could access or modify </span></div><div aria-label="toggle video from anything they wanted to on a system." class="rc-Phrase css-ugczj4" data-cue="21" data-cue-index="20" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">anything they wanted to on a system. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--1"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-there-are-three-type"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from There are three types of permissions in" class="rc-Phrase css-ugczj4" data-cue="22" data-cue-index="21" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">There are three types of permissions in </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Linux that an authorized user can have. </span></div><div aria-label="toggle video from The first type of permission is read." class="rc-Phrase css-ugczj4" data-cue="24" data-cue-index="23" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The first type of permission is read. </span></div><div aria-label="toggle video from The first type of permission is read." class="rc-Phrase css-ugczj4" data-cue="24" data-cue-index="23" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">On a file, read permissions </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">means contents on the file can be read. </span></div><div aria-label="toggle video from On a directory," class="rc-Phrase css-ugczj4" data-cue="27" data-cue-index="26" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">On a directory, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">this permission means you can read </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">all files in that directory. </span></div><div aria-label="toggle video from Next are write permissions." class="rc-Phrase css-ugczj4" data-cue="30" data-cue-index="29" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Next are write permissions. </span></div><div aria-label="toggle video from Next are write permissions." class="rc-Phrase css-ugczj4" data-cue="30" data-cue-index="29" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Write permissions on a file allow </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">modifications of contents of the file. </span></div><div aria-label="toggle video from On a directory, write permissions indicate that" class="rc-Phrase css-ugczj4" data-cue="33" data-cue-index="32" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">On a directory, write permissions indicate that </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">new files can be created in that directory. </span></div><div aria-label="toggle video from Finally, there are also execute permissions." class="rc-Phrase css-ugczj4" data-cue="35" data-cue-index="34" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Finally, there are also execute permissions. </span></div><div aria-label="toggle video from Execute permissions on files mean that" class="rc-Phrase css-ugczj4" data-cue="36" data-cue-index="35" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Execute permissions on files mean that </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the file can be executed if it's an executable file. </span></div><div aria-label="toggle video from Execute permissions on directories allow users to" class="rc-Phrase css-ugczj4" data-cue="38" data-cue-index="37" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Execute permissions on directories allow users to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">enter into a directory and access its files. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--2"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-permissions-are-gran"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Permissions are granted for" class="rc-Phrase css-ugczj4" data-cue="40" data-cue-index="39" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Permissions are granted for </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">three different types of owners. </span></div><div aria-label="toggle video from The first type is the user." class="rc-Phrase css-ugczj4" data-cue="42" data-cue-index="41" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The first type is the user. </span></div><div aria-label="toggle video from The user is the owner of the file." class="rc-Phrase css-ugczj4" data-cue="43" data-cue-index="42" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The user is the owner of the file. </span></div><div aria-label="toggle video from When you create a file," class="rc-Phrase css-ugczj4" data-cue="44" data-cue-index="43" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">When you create a file, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">you become the owner of the file, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">but the ownership can be changed. </span></div><div aria-label="toggle video from Group is the next type." class="rc-Phrase css-ugczj4" data-cue="47" data-cue-index="46" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Group is the next type. </span></div><div aria-label="toggle video from Every user is a part of a certain group." class="rc-Phrase css-ugczj4" data-cue="48" data-cue-index="47" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Every user is a part of a certain group. </span></div><div aria-label="toggle video from A group consists of several users," class="rc-Phrase css-ugczj4" data-cue="49" data-cue-index="48" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">A group consists of several users, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and this is one way to manage a multi-user environment. </span></div><div aria-label="toggle video from Finally, there is other." class="rc-Phrase css-ugczj4" data-cue="51" data-cue-index="50" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Finally, there is other. </span></div><div aria-label="toggle video from Other can be considered all other users on the system." class="rc-Phrase css-ugczj4" data-cue="52" data-cue-index="51" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Other can be considered all other users on the system. </span></div><div aria-label="toggle video from Basically, anyone else with access" class="rc-Phrase css-ugczj4" data-cue="53" data-cue-index="52" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Basically, anyone else with access </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">to the system belongs to this group. </span></div><div aria-label="toggle video from In Linux, file permissions are" class="rc-Phrase css-ugczj4" data-cue="55" data-cue-index="54" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In Linux, file permissions are </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">represented with a 10-character string. </span></div><div aria-label="toggle video from For a directory with full permissions for the user group," class="rc-Phrase css-ugczj4" data-cue="57" data-cue-index="56" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">For a directory with full permissions for the user group, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">this string would be: drwxrwxrwx. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--3"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-let%27s-examine-what-t"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Let's examine what this means more closely." class="rc-Phrase css-ugczj4" data-cue="59" data-cue-index="58" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's examine what this means more closely. </span></div><div aria-label="toggle video from The first character indicates the file type." class="rc-Phrase css-ugczj4" data-cue="60" data-cue-index="59" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The first character indicates the file type. </span></div><div aria-label="toggle video from As shown in this example," class="rc-Phrase css-ugczj4" data-cue="61" data-cue-index="60" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">As shown in this example, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">d is used to indicate it is a directory. </span></div><div aria-label="toggle video from If this character contains a hyphen instead," class="rc-Phrase css-ugczj4" data-cue="63" data-cue-index="62" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">If this character contains a hyphen instead, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">it would be a regular file. </span></div><div aria-label="toggle video from The second, third, and" class="rc-Phrase css-ugczj4" data-cue="65" data-cue-index="64" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The second, third, and </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">fourth characters indicate the permissions for the user. </span></div><div aria-label="toggle video from In this example, r" class="rc-Phrase css-ugczj4" data-cue="67" data-cue-index="66" role="button" tabindex="0">- <span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In this example, </span>
- <span aria-hidden="true" class="cds-137 css-80vnnb cds-139">r </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">indicates the user has read permissions, </span>
- <span aria-hidden="true" class="cds-137 css-80vnnb cds-139">w indicates the user has write permissions, </span>
- <span aria-hidden="true" class="cds-137 css-80vnnb cds-139">x indicates the user has execute permissions. </span>

</div></div></div></div><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">If one of these permissions was missing, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">there would be a hyphen instead of the letter. </span>

<div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-in-the-same-way%2C-the"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from In this example, r" class="rc-Phrase css-ugczj4" data-cue="67" data-cue-index="66" role="button" tabindex="0">  
</div><div aria-label="toggle video from In the same way, the fifth, sixth," class="rc-Phrase css-ugczj4" data-cue="73" data-cue-index="72" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In the same way, the fifth, sixth, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and seventh characters indicate </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">permissions for the next owner type group. </span></div><div aria-label="toggle video from As it shows here," class="rc-Phrase css-ugczj4" data-cue="76" data-cue-index="75" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">As it shows here, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the type group also has read, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">write, and execute permissions. </span></div><div aria-label="toggle video from There are no hyphens to indicate that" class="rc-Phrase css-ugczj4" data-cue="79" data-cue-index="78" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">There are no hyphens to indicate that </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">any of these permissions haven't been granted. </span></div><div aria-label="toggle video from Finally, the eighth through tenth characters" class="rc-Phrase css-ugczj4" data-cue="81" data-cue-index="80" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Finally, the eighth through tenth characters </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">indicate permissions for the last owner type: other. </span></div><div aria-label="toggle video from They also have read, write," class="rc-Phrase css-ugczj4" data-cue="83" data-cue-index="82" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">They also have read, write, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and execute permissions in this example. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--4"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-ensuring-files-and-d"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Ensuring files and directories are set" class="rc-Phrase css-ugczj4" data-cue="85" data-cue-index="84" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Ensuring files and directories are set </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">with their appropriate access permissions is </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">critical to protecting sensitive files and </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">maintaining the overall security of a system. </span></div><div aria-label="toggle video from For example, payroll departments" class="rc-Phrase css-ugczj4" data-cue="89" data-cue-index="88" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">For example, payroll departments </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">handle sensitive information. </span></div><div aria-label="toggle video from If someone outside of" class="rc-Phrase css-ugczj4" data-cue="91" data-cue-index="90" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">If someone outside of </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the payroll group could read this file, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">this would be a privacy concern. </span></div><div aria-label="toggle video from Another example is when the user," class="rc-Phrase css-ugczj4" data-cue="94" data-cue-index="93" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Another example is when the user, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the group, and other can all write to a file. </span></div><div aria-label="toggle video from This type of file is considered a world-writable file." class="rc-Phrase css-ugczj4" data-cue="96" data-cue-index="95" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This type of file is considered a world-writable file. </span></div><div aria-label="toggle video from World-writable files can pose significant security risks." class="rc-Phrase css-ugczj4" data-cue="97" data-cue-index="96" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">World-writable files can pose significant security risks. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--5"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-so-how-do-we-check-p"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from So how do we check permissions?" class="rc-Phrase css-ugczj4" data-cue="98" data-cue-index="97" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">So how do we check permissions? </span></div><div aria-label="toggle video from First, we need to understand what options are." class="rc-Phrase css-ugczj4" data-cue="99" data-cue-index="98" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">First, we need to understand what options are. </span></div><div aria-label="toggle video from Options modify the behavior of the command." class="rc-Phrase css-ugczj4" data-cue="100" data-cue-index="99" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Options modify the behavior of the command. </span></div><div aria-label="toggle video from The options for a command" class="rc-Phrase css-ugczj4" data-cue="101" data-cue-index="100" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The options for a command </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">can be a single letter or a full word. </span></div><div aria-label="toggle video from Checking permissions involves adding" class="rc-Phrase css-ugczj4" data-cue="103" data-cue-index="102" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Checking permissions involves adding </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">options to the ls command. </span></div><div aria-label="toggle video from First, ls -l displays" class="rc-Phrase css-ugczj4" data-cue="105" data-cue-index="104" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">First, ls -l displays </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">permissions to files and directories. </span></div><div aria-label="toggle video from You might also want to display" class="rc-Phrase css-ugczj4" data-cue="107" data-cue-index="106" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">You might also want to display </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">hidden files and identify their permissions. </span></div><div aria-label="toggle video from Hidden files, which begin with" class="rc-Phrase css-ugczj4" data-cue="109" data-cue-index="108" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Hidden files, which begin with </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">a period before their name, don't </span></div><div aria-label="toggle video from normally appear when you use ls to display file contents." class="rc-Phrase css-ugczj4" data-cue="111" data-cue-index="110" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">normally appear when you use ls to display file contents. </span></div><div aria-label="toggle video from Entering ls -a displays hidden files." class="rc-Phrase css-ugczj4" data-cue="112" data-cue-index="111" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Entering ls -a displays hidden files. </span></div><div aria-label="toggle video from Then you can combine these two options to do both." class="rc-Phrase css-ugczj4" data-cue="113" data-cue-index="112" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Then you can combine these two options to do both. </span></div><div aria-label="toggle video from Entering ls -la displays permissions" class="rc-Phrase css-ugczj4" data-cue="114" data-cue-index="113" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Entering ls -la displays permissions </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">to files and directories, including hidden files. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--6"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-let%27s-get-into-bash-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Let's get into Bash and try out these options." class="rc-Phrase css-ugczj4" data-cue="116" data-cue-index="115" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's get into Bash and try out these options. </span></div><div aria-label="toggle video from Right now, we're in the project subdirectory." class="rc-Phrase css-ugczj4" data-cue="117" data-cue-index="116" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Right now, we're in the project subdirectory. </span></div><div aria-label="toggle video from First, let's use the ls command to display its contents." class="rc-Phrase css-ugczj4" data-cue="118" data-cue-index="117" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">First, let's use the ls command to display its contents. </span></div><div aria-label="toggle video from The output displays the files in this directory," class="rc-Phrase css-ugczj4" data-cue="119" data-cue-index="118" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The output displays the files in this directory, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">but we don't know anything about their permissions. </span></div><div aria-label="toggle video from By using ls -l instead," class="rc-Phrase css-ugczj4" data-cue="121" data-cue-index="120" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">By using ls -l instead, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we get expanded information on </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">these files. Let's do this. </span></div><div aria-label="toggle video from The file names are now on the right side of each row." class="rc-Phrase css-ugczj4" data-cue="124" data-cue-index="123" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The file names are now on the right side of each row. </span></div><div aria-label="toggle video from The first piece of information in each row" class="rc-Phrase css-ugczj4" data-cue="125" data-cue-index="124" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The first piece of information in each row </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">shows the permissions in </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the format that we discussed earlier. </span></div><div aria-label="toggle video from Since these are all files and not directories," class="rc-Phrase css-ugczj4" data-cue="128" data-cue-index="127" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Since these are all files and not directories, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">notice how the first character is a hyphen. </span></div><div aria-label="toggle video from Let's focus on one specific file: project1.txt." class="rc-Phrase css-ugczj4" data-cue="130" data-cue-index="129" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's focus on one specific file: project1.txt. </span></div><div aria-label="toggle video from The second through fourth characters of its" class="rc-Phrase css-ugczj4" data-cue="131" data-cue-index="130" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The second through fourth characters of its </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">permissions show us the user </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">has both read and write permissions </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">but lacks execute permissions. </span></div><div aria-label="toggle video from In both the fifth through" class="rc-Phrase css-ugczj4" data-cue="135" data-cue-index="134" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In both the fifth through </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">seventh characters and eighth through tenth characters, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the sequence is r--. </span></div><div aria-label="toggle video from This means group and other have only read privileges." class="rc-Phrase css-ugczj4" data-cue="138" data-cue-index="137" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This means group and other have only read privileges. </span></div><div aria-label="toggle video from After the permissions, ls -l first displays the username." class="rc-Phrase css-ugczj4" data-cue="139" data-cue-index="138" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">After the permissions, ls -l first displays the username. </span></div><div aria-label="toggle video from Here, that's us, analyst." class="rc-Phrase css-ugczj4" data-cue="140" data-cue-index="139" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Here, that's us, analyst. </span></div><div aria-label="toggle video from Next comes the group name;" class="rc-Phrase css-ugczj4" data-cue="141" data-cue-index="140" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Next comes the group name; </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">in our case, the security group. </span></div><div aria-label="toggle video from Now let's use ls -a" class="rc-Phrase css-ugczj4" data-cue="143" data-cue-index="142" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Now let's use ls -a </span></div><div aria-label="toggle video from The output includes two more files—hidden" class="rc-Phrase css-ugczj4" data-cue="144" data-cue-index="143" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The output includes two more files—hidden </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">files with the names: .hidden1.txt </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and .hidden2.txt </span></div><div aria-label="toggle video from Finally, we can also use" class="rc-Phrase css-ugczj4" data-cue="147" data-cue-index="146" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Finally, we can also use </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">ls -la to show the permissions for all files, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">including these hidden files. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--7"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="phrases" id="bkmrk-i-thought-that-was-p"><div aria-label="toggle video from I thought that was pretty interesting. Did you?" class="rc-Phrase css-ugczj4" data-cue="150" data-cue-index="149" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">I thought that was pretty interesting. Did you? </span></div><div aria-label="toggle video from You now know a little more about" class="rc-Phrase css-ugczj4" data-cue="151" data-cue-index="150" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">You now know a little more about </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">file permissions and ownership. </span></div><div aria-label="toggle video from This will be helpful when working in" class="rc-Phrase css-ugczj4" data-cue="153" data-cue-index="152" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This will be helpful when working in </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">security because monitoring and </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">setting correct permissions is </span></div><div aria-label="toggle video from essential for protecting information." class="rc-Phrase css-ugczj4" data-cue="156" data-cue-index="155" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">essential for protecting information. </span></div><div aria-label="toggle video from Take a small break and meet me in the next video." class="rc-Phrase css-ugczj4" data-cue="157" data-cue-index="156" role="button"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Take a small break and meet me in the next video. </span></div></div>

# Permission commands

Previously, you explored file permissions and the commands that you can use to display and change them. In this reading, you’ll review these concepts and also focus on an example of how these commands work together when putting the principle of least privilege into practice.

## Reading permissions

In Linux, permissions are represented with a 10-character string. Permissions include:

<div class="rc-CML" dir="auto" id="bkmrk-read%3A-for-files%2C-thi"><div><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml" data-track-page="item_layout" role="presentation"><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml_link" data-track-page="item_layout"><div class="css-1k5v0wb" data-testid="cml-viewer">- **read**: for files, this is the ability to read the file contents; for directories, this is the ability to read all contents in the directory including both files and subdirectories
- **write**: for files, this is the ability to make modifications on the file contents; for directories, this is the ability to create new files in the directory
- **execute**: for files, this is the ability to execute the file if it’s a program; for directories, this is the ability to enter the directory and access its files

</div></div></div></div></div>These permissions are given to these types of owners:

<div class="rc-CML" dir="auto" id="bkmrk-user%3A-the-owner-of-t"><div><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml" data-track-page="item_layout" role="presentation"><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml_link" data-track-page="item_layout"><div class="css-1k5v0wb" data-testid="cml-viewer">- **user**: the owner of the file
- **group**: a larger group that the owner is a part of
- **other**: all other users on the system

</div></div></div></div></div>Each character in the 10-character string conveys different information about these permissions. The following table describes the purpose of each character:

<div class="rc-CML" dir="auto" id="bkmrk-character-example-me"><div><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml" data-track-page="item_layout" role="presentation"><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml_link" data-track-page="item_layout"><div class="css-1k5v0wb" data-testid="cml-viewer"><div class="css-1yr0py9"><table><thead><tr><th scope="col">**Character**

</th><th scope="col">**Example**

</th><th scope="col">**Meaning**

</th></tr></thead><tbody><tr><td>1st

</td><td>**d**rwxrwxrwx

</td><td>file type

- <var>d</var> for directory
- <var>-</var> for a regular file

</td></tr><tr><td>2nd

</td><td>d**r**wxrwxrwx

</td><td>read permissions for the user

- <var>r</var> if the user has read permissions
- <var>-</var> if the user lacks read permissions

</td></tr><tr><td>3rd

</td><td>dr**w**xrwxrwx

</td><td>write permissions for the user

- <var>w</var> if the user has write permissions
- <var>-</var> if the user lacks write permissions

</td></tr><tr><td>4th

</td><td>drw**x**rwxrwx

</td><td>execute permissions for the user

- <var>x</var> if the user has execute permissions
- <var>-</var> if the user lacks execute permissions

</td></tr><tr><td>5th

</td><td>drwx**r**wxrwx

</td><td>read permissions for the group

- <var>r</var> if the group has read permissions
- <var>-</var> if the group lacks read permissions

</td></tr><tr><td>6th

</td><td>drwxr**w**xrwx

</td><td>write permissions for the group

- <var>w</var> if the group has write permissions
- <var>-</var> if the group lacks write permissions

</td></tr><tr><td>7th

</td><td>drwxrw**x**rwx

</td><td>execute permissions for the group

- <var>x</var> if the group has execute permissions
- <var>-</var> if the group lacks execute permissions

</td></tr><tr><td>8th

</td><td>drwxrwx**r**wx

</td><td>read permissions for other

- <var>r</var> if the other owner type has read permissions
- <var>-</var> if the other owner type lacks read permissions

</td></tr><tr><td>9th

</td><td>drwxrwxr**w**x

</td><td>write permissions for other

- <var>w</var> if the other owner type has write permissions
- <var>-</var> if the other owner type lacks write permissions

</td></tr><tr><td>10th

</td><td>drwxrwxrw**x**

</td><td>execute permissions for other

- <var>x</var> if the other owner type has execute permissions
- <var>-</var> if the other owner type lacks execute permissions

</td></tr></tbody></table>

</div></div></div></div></div></div>## Exploring existing permissions

You can use the <var>ls</var> command to investigate who has permissions on files and directories. Previously, you learned that <var>ls</var> displays the names of files in directories in the current working directory.

There are additional options you can add to the <var>ls</var> command to make your command more specific. Some of these options provide details about permissions. Here are a few important <var>ls</var> options for security analysts:

<div class="rc-CML" dir="auto" id="bkmrk-ls--a%3A-displays-hidd"><div><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml" data-track-page="item_layout" role="presentation"><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml_link" data-track-page="item_layout"><div class="css-1k5v0wb" data-testid="cml-viewer">- <var>ls -a</var>: Displays hidden files. Hidden files start with a period (<var>.</var>) at the beginning.
- <var>ls -l</var>: Displays permissions to files and directories. Also displays other additional information, including owner name, group, file size, and the time of last modification.
- <var>ls -la</var>: Displays permissions to files and directories, including hidden files. This is a combination of the other two options.

</div></div></div></div></div>## Changing permissions

The **principle of least privilege** is the concept of granting only the minimal access and authorization required to complete a task or function. In other words, users should not have privileges that are beyond what is necessary. Not following the principle of least privilege can create security risks.

The <var>chmod</var> command can help you manage this authorization. The <var>chmod</var> command changes permissions on files and directories.

### **Using chmod**

The <var>chmod</var> command requires two arguments. The first argument indicates how to change permissions, and the second argument indicates the file or directory that you want to change permissions for. For example, the following command would add all permissions to <var>login\_sessions.txt</var>:

<var>chmod u+rwx,g+rwx,o+rwx login\_sessions.txt</var>

If you wanted to take all the permissions away, you could use

<var>chmod u-rwx,g-rwx,o-rwx login\_sessions.txt</var>

Another way to assign these permissions is to use the equals sign (<var>=</var>) in this first argument. Using <var>=</var> with <var>chmod</var> sets, or assigns, the permissions exactly as specified. For example, the following command would set read permissions for <var>login\_sessions.txt</var> for user, group, and other:

<var>chmod u=r,g=r,o=r login\_sessions.txt</var>

This command overwrites existing permissions. For instance, if the user previously had write permissions, these write permissions are removed after you specify only read permissions with <var>=</var>.

The following table reviews how each character is used within the first argument of <var>chmod</var>:

<div class="rc-CML" dir="auto" id="bkmrk-character-descriptio"><div><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml" data-track-page="item_layout" role="presentation"><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml_link" data-track-page="item_layout"><div class="css-1k5v0wb" data-testid="cml-viewer"><div class="css-1yr0py9"><table><thead><tr><th scope="col">**Character**

</th><th scope="col">**Description**

</th></tr></thead><tbody><tr><td><var>u</var>

</td><td>indicates changes will be made to user permissions

</td></tr><tr><td><var>g</var>

</td><td>indicates changes will be made to group permissions

</td></tr><tr><td><var>o</var>

</td><td>indicates changes will be made to other permissions

</td></tr><tr><td><var>+</var>

</td><td>adds permissions to the user, group, or other

</td></tr><tr><td><var>-</var>

</td><td>removes permissions from the user, group, or other

</td></tr><tr><td><var>=</var>

</td><td>assigns permissions for the user, group, or other

</td></tr></tbody></table>

</div></div></div></div></div></div>**Note:** When there are permission changes to more than one owner type, commas are needed to separate changes for each owner type. You should not add spaces after those commas.

### **The principle of least privilege in action**

As a security analyst, you may encounter a situation like this one: There’s a file called <var>bonuses.txt</var> within a compensation directory. The owner of this file is a member of the Human Resources department with a username of <var>hrrep1</var>. It has been decided that <var>hrrep1</var> needs access to this file. But, since this file contains confidential information, no one else in the <var>hr</var> group needs access.

You run <var>ls -l</var> to check the permissions of files in the compensation directory and discover that the permissions for <var>bonuses.txt</var> are <var>-rw-rw----</var>. The group owner type has read and write permissions that do not align with the principle of least privilege.

To remedy the situation, you input <var>chmod g-rw bonuses.txt</var>. Now, only the user who needs to access this file to carry out their job responsibilities can access this file.

## Key takeaways

Managing directory and file permissions may be a part of your work as a security analyst. Using <var>ls</var> with the <var>-l</var> and <var>-la</var> options allows you to investigate directory and file permissions. Using <var>chmod</var> allows you to change user permissions and ensure they are aligned with the principle of least privilege.

# File permissions and ownership

<div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-hi-there.-it%27s-great"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Hi there. It's great to have you back!" class="rc-Phrase css-ugczj4" data-cue="1" data-cue-index="0" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Hi there. It's great to have you back! </span></div><div aria-label="toggle video from Let's continue to learn more about how to" class="rc-Phrase css-ugczj4" data-cue="2" data-cue-index="1" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's continue to learn more about how to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">work in Linux as a security analyst. </span></div><div aria-label="toggle video from In this video, we'll explore" class="rc-Phrase css-ugczj4" data-cue="4" data-cue-index="3" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In this video, we'll explore </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">file and directory permissions. </span></div><div aria-label="toggle video from We'll learn how Linux represents permissions" class="rc-Phrase css-ugczj4" data-cue="6" data-cue-index="5" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We'll learn how Linux represents permissions </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and how you can check for the permissions </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">associated with files and directories. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-permissions-are-the-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Permissions are the type of" class="rc-Phrase css-ugczj4" data-cue="9" data-cue-index="8" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Permissions are the type of </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">access granted for a file or directory. </span></div><div aria-label="toggle video from Permissions are related to authorization." class="rc-Phrase css-ugczj4" data-cue="11" data-cue-index="10" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Permissions are related to authorization. </span></div><div aria-label="toggle video from Permissions are related to authorization." class="rc-Phrase css-ugczj4" data-cue="11" data-cue-index="10" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Authorization is the concept of granting </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">access to specific resources in a system. </span></div><div aria-label="toggle video from Authorization allows you to limit" class="rc-Phrase css-ugczj4" data-cue="14" data-cue-index="13" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Authorization allows you to limit </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">access to specified files or directories. </span></div><div aria-label="toggle video from A good rule to follow is that" class="rc-Phrase css-ugczj4" data-cue="16" data-cue-index="15" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">A good rule to follow is that </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">data access is on a need-to-know basis. </span></div><div aria-label="toggle video from You can imagine the security risk" class="rc-Phrase css-ugczj4" data-cue="18" data-cue-index="17" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">You can imagine the security risk </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">it would impose if anyone </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">could access or modify </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">anything they wanted to on a system. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--1"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-there-are-three-type"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from There are three types of permissions in" class="rc-Phrase css-ugczj4" data-cue="22" data-cue-index="21" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">There are three types of permissions in </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Linux that an authorized user can have. </span></div><div aria-label="toggle video from The first type of permission is read." class="rc-Phrase css-ugczj4" data-cue="24" data-cue-index="23" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The first type of permission is read. </span></div><div aria-label="toggle video from On a file, read permissions" class="rc-Phrase css-ugczj4" data-cue="25" data-cue-index="24" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">On a file, read permissions </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">means contents on the file can be read. </span></div><div aria-label="toggle video from On a directory," class="rc-Phrase css-ugczj4" data-cue="27" data-cue-index="26" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">On a directory, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">this permission means you can read </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">all files in that directory. </span></div><div aria-label="toggle video from Next are write permissions." class="rc-Phrase css-ugczj4" data-cue="30" data-cue-index="29" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Next are write permissions. </span></div><div aria-label="toggle video from Write permissions on a file allow" class="rc-Phrase css-ugczj4" data-cue="31" data-cue-index="30" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Write permissions on a file allow </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">modifications of contents of the file. </span></div><div aria-label="toggle video from On a directory, write permissions indicate that" class="rc-Phrase css-ugczj4" data-cue="33" data-cue-index="32" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">On a directory, write permissions indicate that </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">new files can be created in that directory. </span></div><div aria-label="toggle video from Finally, there are also execute permissions." class="rc-Phrase css-ugczj4" data-cue="35" data-cue-index="34" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Finally, there are also execute permissions. </span></div><div aria-label="toggle video from Execute permissions on files mean that" class="rc-Phrase css-ugczj4" data-cue="36" data-cue-index="35" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Execute permissions on files mean that </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the file can be executed if it's an executable file. </span></div><div aria-label="toggle video from Execute permissions on directories allow users to" class="rc-Phrase css-ugczj4" data-cue="38" data-cue-index="37" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Execute permissions on directories allow users to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">enter into a directory and access its files. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--2"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-permissions-are-gran"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Permissions are granted for" class="rc-Phrase css-ugczj4" data-cue="40" data-cue-index="39" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Permissions are granted for </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">three different types of owners. </span></div><div aria-label="toggle video from The first type is the user." class="rc-Phrase css-ugczj4" data-cue="42" data-cue-index="41" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The first type is the user. </span></div><div aria-label="toggle video from The user is the owner of the file." class="rc-Phrase css-ugczj4" data-cue="43" data-cue-index="42" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The user is the owner of the file. </span></div><div aria-label="toggle video from When you create a file," class="rc-Phrase css-ugczj4" data-cue="44" data-cue-index="43" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">When you create a file, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">you become the owner of the file, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">but the ownership can be changed. </span></div><div aria-label="toggle video from Group is the next type." class="rc-Phrase css-ugczj4" data-cue="47" data-cue-index="46" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Group is the next type. </span></div><div aria-label="toggle video from Every user is a part of a certain group." class="rc-Phrase css-ugczj4" data-cue="48" data-cue-index="47" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Every user is a part of a certain group. </span></div><div aria-label="toggle video from A group consists of several users," class="rc-Phrase css-ugczj4" data-cue="49" data-cue-index="48" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">A group consists of several users, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and this is one way to manage a multi-user environment. </span></div><div aria-label="toggle video from Finally, there is other." class="rc-Phrase css-ugczj4" data-cue="51" data-cue-index="50" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Finally, there is other. </span></div><div aria-label="toggle video from Other can be considered all other users on the system." class="rc-Phrase css-ugczj4" data-cue="52" data-cue-index="51" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Other can be considered all other users on the system. </span></div><div aria-label="toggle video from Basically, anyone else with access" class="rc-Phrase css-ugczj4" data-cue="53" data-cue-index="52" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Basically, anyone else with access </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">to the system belongs to this group. </span></div><div aria-label="toggle video from In Linux, file permissions are" class="rc-Phrase css-ugczj4" data-cue="55" data-cue-index="54" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In Linux, file permissions are </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">represented with a 10-character string. </span></div><div aria-label="toggle video from For a directory with full permissions for the user group," class="rc-Phrase css-ugczj4" data-cue="57" data-cue-index="56" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">For a directory with full permissions for the user group, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">this string would be: drwxrwxrwx. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--3"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-let%27s-examine-what-t"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Let's examine what this means more closely." class="rc-Phrase css-ugczj4" data-cue="59" data-cue-index="58" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's examine what this means more closely. </span></div><div aria-label="toggle video from The first character indicates the file type." class="rc-Phrase css-ugczj4" data-cue="60" data-cue-index="59" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The first character indicates the file type. </span></div><div aria-label="toggle video from As shown in this example," class="rc-Phrase css-ugczj4" data-cue="61" data-cue-index="60" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">As shown in this example, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">d is used to indicate it is a directory. </span></div><div aria-label="toggle video from If this character contains a hyphen instead," class="rc-Phrase css-ugczj4" data-cue="63" data-cue-index="62" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">If this character contains a hyphen instead, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">it would be a regular file. </span></div><div aria-label="toggle video from The second, third, and" class="rc-Phrase css-ugczj4" data-cue="65" data-cue-index="64" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The second, third, and </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">fourth characters indicate the permissions for the user. </span></div><div aria-label="toggle video from In this example, r" class="rc-Phrase css-ugczj4" data-cue="67" data-cue-index="66" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In this example, r </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">indicates the user has read permissions, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">w indicates the user has write permissions, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and x indicates the user has execute permissions. </span></div><div aria-label="toggle video from In this example, r" class="rc-Phrase css-ugczj4" data-cue="67" data-cue-index="66" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">If one of these permissions was missing, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">there would be a hyphen instead of the letter. </span></div><div aria-label="toggle video from In the same way, the fifth, sixth," class="rc-Phrase css-ugczj4" data-cue="73" data-cue-index="72" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In the same way, the fifth, sixth, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and seventh characters indicate </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">permissions for the next owner type group. </span></div><div aria-label="toggle video from As it shows here," class="rc-Phrase css-ugczj4" data-cue="76" data-cue-index="75" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">As it shows here, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the type group also has read, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">write, and execute permissions. </span></div><div aria-label="toggle video from There are no hyphens to indicate that" class="rc-Phrase css-ugczj4" data-cue="79" data-cue-index="78" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">There are no hyphens to indicate that </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">any of these permissions haven't been granted. </span></div><div aria-label="toggle video from Finally, the eighth through tenth characters" class="rc-Phrase css-ugczj4" data-cue="81" data-cue-index="80" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Finally, the eighth through tenth characters </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">indicate permissions for the last owner type: other. </span></div><div aria-label="toggle video from They also have read, write," class="rc-Phrase css-ugczj4" data-cue="83" data-cue-index="82" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">They also have read, write, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and execute permissions in this example. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--4"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-ensuring-files-and-d"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Ensuring files and directories are set" class="rc-Phrase css-ugczj4" data-cue="85" data-cue-index="84" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Ensuring files and directories are set </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">with their appropriate access permissions is </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">critical to protecting sensitive files and </span></div><div aria-label="toggle video from maintaining the overall security of a system." class="rc-Phrase css-ugczj4" data-cue="88" data-cue-index="87" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">maintaining the overall security of a system. </span></div><div aria-label="toggle video from For example, payroll departments" class="rc-Phrase css-ugczj4" data-cue="89" data-cue-index="88" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">For example, payroll departments </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">handle sensitive information. </span></div><div aria-label="toggle video from If someone outside of" class="rc-Phrase css-ugczj4" data-cue="91" data-cue-index="90" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">If someone outside of </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the payroll group could read this file, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">this would be a privacy concern. </span></div><div aria-label="toggle video from Another example is when the user," class="rc-Phrase css-ugczj4" data-cue="94" data-cue-index="93" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Another example is when the user, </span></div><div aria-label="toggle video from the group, and other can all write to a file." class="rc-Phrase css-ugczj4" data-cue="95" data-cue-index="94" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the group, and other can all write to a file. </span></div><div aria-label="toggle video from This type of file is considered a world-writable file." class="rc-Phrase css-ugczj4" data-cue="96" data-cue-index="95" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This type of file is considered a world-writable file. </span></div><div aria-label="toggle video from World-writable files can pose significant security risks." class="rc-Phrase css-ugczj4" data-cue="97" data-cue-index="96" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">World-writable files can pose significant security risks. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--5"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-so-how-do-we-check-p"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from So how do we check permissions?" class="rc-Phrase css-ugczj4" data-cue="98" data-cue-index="97" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">So how do we check permissions? </span></div><div aria-label="toggle video from First, we need to understand what options are." class="rc-Phrase css-ugczj4" data-cue="99" data-cue-index="98" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">First, we need to understand what options are. </span></div><div aria-label="toggle video from Options modify the behavior of the command." class="rc-Phrase css-ugczj4" data-cue="100" data-cue-index="99" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Options modify the behavior of the command. </span></div><div aria-label="toggle video from The options for a command" class="rc-Phrase css-ugczj4" data-cue="101" data-cue-index="100" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The options for a command </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">can be a single letter or a full word. </span></div><div aria-label="toggle video from Checking permissions involves adding" class="rc-Phrase css-ugczj4" data-cue="103" data-cue-index="102" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Checking permissions involves adding </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">options to the ls command. </span></div><div aria-label="toggle video from First, ls -l displays" class="rc-Phrase css-ugczj4" data-cue="105" data-cue-index="104" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">First, ls -l displays </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">permissions to files and directories. </span></div><div aria-label="toggle video from You might also want to display" class="rc-Phrase css-ugczj4" data-cue="107" data-cue-index="106" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">You might also want to display </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">hidden files and identify their permissions. </span></div><div aria-label="toggle video from Hidden files, which begin with" class="rc-Phrase css-ugczj4" data-cue="109" data-cue-index="108" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Hidden files, which begin with </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">a period before their name, don't </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">normally appear when you use ls to display file contents. </span></div><div aria-label="toggle video from Entering ls -a displays hidden files." class="rc-Phrase css-ugczj4" data-cue="112" data-cue-index="111" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Entering ls -a displays hidden files. </span></div><div aria-label="toggle video from Then you can combine these two options to do both." class="rc-Phrase css-ugczj4" data-cue="113" data-cue-index="112" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Then you can combine these two options to do both. </span></div><div aria-label="toggle video from Entering ls -la displays permissions" class="rc-Phrase css-ugczj4" data-cue="114" data-cue-index="113" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Entering ls -la displays permissions </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">to files and directories, including hidden files. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--6"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-let%27s-get-into-bash-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Let's get into Bash and try out these options." class="rc-Phrase css-ugczj4" data-cue="116" data-cue-index="115" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's get into Bash and try out these options. </span></div><div aria-label="toggle video from Right now, we're in the project subdirectory." class="rc-Phrase css-ugczj4" data-cue="117" data-cue-index="116" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Right now, we're in the project subdirectory. </span></div><div aria-label="toggle video from First, let's use the ls command to display its contents." class="rc-Phrase css-ugczj4" data-cue="118" data-cue-index="117" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">First, let's use the ls command to display its contents. </span></div><div aria-label="toggle video from The output displays the files in this directory," class="rc-Phrase css-ugczj4" data-cue="119" data-cue-index="118" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The output displays the files in this directory, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">but we don't know anything about their permissions. </span></div><div aria-label="toggle video from By using ls -l instead," class="rc-Phrase css-ugczj4" data-cue="121" data-cue-index="120" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">By using ls -l instead, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we get expanded information on </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">these files. Let's do this. </span></div><div aria-label="toggle video from The file names are now on the right side of each row." class="rc-Phrase css-ugczj4" data-cue="124" data-cue-index="123" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The file names are now on the right side of each row. </span></div><div aria-label="toggle video from The first piece of information in each row" class="rc-Phrase css-ugczj4" data-cue="125" data-cue-index="124" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The first piece of information in each row </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">shows the permissions in </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the format that we discussed earlier. </span></div><div aria-label="toggle video from Since these are all files and not directories," class="rc-Phrase css-ugczj4" data-cue="128" data-cue-index="127" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Since these are all files and not directories, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">notice how the first character is a hyphen. </span></div><div aria-label="toggle video from Let's focus on one specific file: project1.txt." class="rc-Phrase css-ugczj4" data-cue="130" data-cue-index="129" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's focus on one specific file: project1.txt. </span></div><div aria-label="toggle video from The second through fourth characters of its" class="rc-Phrase css-ugczj4" data-cue="131" data-cue-index="130" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The second through fourth characters of its </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">permissions show us the user </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">has both read and write permissions </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">but lacks execute permissions. </span></div><div aria-label="toggle video from In both the fifth through" class="rc-Phrase css-ugczj4" data-cue="135" data-cue-index="134" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In both the fifth through </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">seventh characters and eighth through tenth characters, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the sequence is r--. </span></div><div aria-label="toggle video from This means group and other have only read privileges." class="rc-Phrase css-ugczj4" data-cue="138" data-cue-index="137" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This means group and other have only read privileges. </span></div><div aria-label="toggle video from After the permissions, ls -l first displays the username." class="rc-Phrase css-ugczj4" data-cue="139" data-cue-index="138" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">After the permissions, ls -l first displays the username. </span></div><div aria-label="toggle video from Here, that's us, analyst." class="rc-Phrase css-ugczj4" data-cue="140" data-cue-index="139" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Here, that's us, analyst. </span></div><div aria-label="toggle video from Next comes the group name;" class="rc-Phrase css-ugczj4" data-cue="141" data-cue-index="140" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Next comes the group name; </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">in our case, the security group. </span></div><div aria-label="toggle video from Now let's use ls -a" class="rc-Phrase css-ugczj4" data-cue="143" data-cue-index="142" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Now let's use ls -a </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The output includes two more files—hidden </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">files with the names: .hidden1.txt </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and .hidden2.txt </span></div><div aria-label="toggle video from Finally, we can also use" class="rc-Phrase css-ugczj4" data-cue="147" data-cue-index="146" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Finally, we can also use </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">ls -la to show the permissions for all files, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">including these hidden files. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--7"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-arowdh cds-3 cds-grid-item cds-48 cds-73" id="bkmrk-i-thought-that-was-p"><div><div class="rc-TranscriptHighlighter css-79elbk"><div class="rc-Transcript css-9li235" data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="interactive_transcript" data-track-page="item_layout" role="presentation"><div class="cds-1 css-xl5mb3 cds-2"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from I thought that was pretty interesting. Did you?" class="rc-Phrase css-ugczj4" data-cue="150" data-cue-index="149" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">I thought that was pretty interesting. Did you? </span></div><div aria-label="toggle video from You now know a little more about" class="rc-Phrase css-ugczj4" data-cue="151" data-cue-index="150" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">You now know a little more about </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">file permissions and ownership. </span></div><div aria-label="toggle video from This will be helpful when working in" class="rc-Phrase css-ugczj4" data-cue="153" data-cue-index="152" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This will be helpful when working in </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">security because monitoring and </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">setting correct permissions is </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">essential for protecting information. </span></div><div aria-label="toggle video from Take a small break and meet me in the next video." class="rc-Phrase css-ugczj4" data-cue="157" data-cue-index="156" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Take a small break and meet me in the next video. </span></div></div></div></div></div></div></div></div><div class="cds-1 css-hcqebr cds-3 cds-grid-item cds-48 cds-66" id="bkmrk--8"><div class="cds-316 cds-formControl-root css-4p0j7c cds-319"></div></div>

# Change permissions

<div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-hi-there%21-in-the-pre"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Hi there! In the previous video," class="rc-Phrase css-ugczj4" data-cue="1" data-cue-index="0" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Hi there! In the previous video, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">you learned how to check permissions for a user. </span></div><div aria-label="toggle video from In this video, we're going" class="rc-Phrase css-ugczj4" data-cue="3" data-cue-index="2" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In this video, we're going </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">to learn about changing permissions. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-when-working-as-a-se"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from When working as a security analyst," class="rc-Phrase css-ugczj4" data-cue="5" data-cue-index="4" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">When working as a security analyst, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">there may be many reasons to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">change permissions for a user. </span></div><div aria-label="toggle video from A user may have changed departments" class="rc-Phrase css-ugczj4" data-cue="8" data-cue-index="7" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">A user may have changed departments </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">or been assigned to a different work group. </span></div><div aria-label="toggle video from A user might simply no longer be working on" class="rc-Phrase css-ugczj4" data-cue="10" data-cue-index="9" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">A user might simply no longer be working on </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">a project that requires certain permissions. </span></div><div aria-label="toggle video from These changes are necessary in order to protect" class="rc-Phrase css-ugczj4" data-cue="12" data-cue-index="11" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">These changes are necessary in order to protect </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">system files from being </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">accidentally or deliberately altered or deleted. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--1"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-let%27s-explore-a-rela"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Let's explore a related command" class="rc-Phrase css-ugczj4" data-cue="15" data-cue-index="14" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's explore a related command </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">that helps control this access. </span></div><div aria-label="toggle video from In this video, we'll learn about chmod." class="rc-Phrase css-ugczj4" data-cue="17" data-cue-index="16" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In this video, we'll learn about chmod. </span></div><div aria-label="toggle video from chmod changes permissions on files and directories." class="rc-Phrase css-ugczj4" data-cue="18" data-cue-index="17" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">chmod changes permissions on files and directories. </span></div><div aria-label="toggle video from The command chmod stands for change mode." class="rc-Phrase css-ugczj4" data-cue="19" data-cue-index="18" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The command chmod stands for change mode. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--2"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-there-are-two-modes-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from There are two modes for changing permissions," class="rc-Phrase css-ugczj4" data-cue="20" data-cue-index="19" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">There are two modes for changing permissions, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">but we'll focus on symbolic. The best way to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">learn about how chmod works is through an example. </span></div><div aria-label="toggle video from I know this has a lot of details," class="rc-Phrase css-ugczj4" data-cue="23" data-cue-index="22" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">I know this has a lot of details, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">but we'll break this down. </span></div><div aria-label="toggle video from Also, please keep in mind that, like many Linux commands," class="rc-Phrase css-ugczj4" data-cue="25" data-cue-index="24" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Also, please keep in mind that, like many Linux commands, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">you don't have to memorize </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the information and can always find a reference. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--3"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-with-chmod%2C-you-need"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from With chmod, you need to identify which" class="rc-Phrase css-ugczj4" data-cue="28" data-cue-index="27" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">With chmod, you need to identify which </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">file or directory you want to adjust permissions for. </span></div><div aria-label="toggle video from This is the final argument," class="rc-Phrase css-ugczj4" data-cue="30" data-cue-index="29" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This is the final argument, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">in this case, a file named: access.txt. </span></div><div aria-label="toggle video from The first argument, added directly after" class="rc-Phrase css-ugczj4" data-cue="32" data-cue-index="31" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The first argument, added directly after </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the chmod command, indicates how to change permissions. </span></div><div aria-label="toggle video from Right now, this might seem hard to interpret," class="rc-Phrase css-ugczj4" data-cue="34" data-cue-index="33" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Right now, this might seem hard to interpret, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">but soon we'll understand why </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">this is called symbolic mode. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--4"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-previously%2C-we-learn"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Previously, we learned about the three types" class="rc-Phrase css-ugczj4" data-cue="37" data-cue-index="36" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Previously, we learned about the three types </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">of owners: user, group, and other. </span></div><div aria-label="toggle video from To identify these with chmod," class="rc-Phrase css-ugczj4" data-cue="39" data-cue-index="38" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">To identify these with chmod, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we use u to represent the user, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">g to represent the group, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and o to represent other. </span></div><div aria-label="toggle video from In this particular example," class="rc-Phrase css-ugczj4" data-cue="43" data-cue-index="42" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In this particular example, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">g indicates we will make </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">some changes to group permissions, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and o to permissions for other. </span></div><div aria-label="toggle video from These owner types are separated" class="rc-Phrase css-ugczj4" data-cue="47" data-cue-index="46" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">These owner types are separated </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">by a comma in this argument. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--5"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-but-do-we-want-to-ad"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from But do we want to add or take away permissions?" class="rc-Phrase css-ugczj4" data-cue="49" data-cue-index="48" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">But do we want to add or take away permissions? </span></div><div aria-label="toggle video from Well, for this, we use mathematical operators." class="rc-Phrase css-ugczj4" data-cue="50" data-cue-index="49" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Well, for this, we use mathematical operators. </span></div><div aria-label="toggle video from So, the plus sign after g" class="rc-Phrase css-ugczj4" data-cue="51" data-cue-index="50" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">So, the plus sign after g </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">means we want to add permissions for group. </span></div><div aria-label="toggle video from The minus sign after o" class="rc-Phrase css-ugczj4" data-cue="53" data-cue-index="52" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The minus sign after o </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">means we want to take them away from other. </span></div><div aria-label="toggle video from The minus sign after o" class="rc-Phrase css-ugczj4" data-cue="53" data-cue-index="52" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">And the last question is: what kind of changes? </span></div><div aria-label="toggle video from We've already learned that r represents read permissions," class="rc-Phrase css-ugczj4" data-cue="56" data-cue-index="55" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We've already learned that r represents read permissions, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">w represents write permissions, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and x represents execute permissions. </span></div><div aria-label="toggle video from So in this case, the w indicates" class="rc-Phrase css-ugczj4" data-cue="59" data-cue-index="58" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">So in this case, the w indicates </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">that we're adding write permissions to the group, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and r indicates that we are taking </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">away read permissions from other. </span></div><div aria-label="toggle video from This is still very complex." class="rc-Phrase css-ugczj4" data-cue="63" data-cue-index="62" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This is still very complex. </span></div><div aria-label="toggle video from But now that we've broken it down," class="rc-Phrase css-ugczj4" data-cue="64" data-cue-index="63" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">But now that we've broken it down, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">perhaps it doesn't seem quite </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">so much like a foreign language. </span></div><div aria-label="toggle video from And remember, you don't have to memorize this all." class="rc-Phrase css-ugczj4" data-cue="67" data-cue-index="66" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">And remember, you don't have to memorize this all. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--6"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-let%27s-give-this-new-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Let's give this new command a try." class="rc-Phrase css-ugczj4" data-cue="68" data-cue-index="67" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's give this new command a try. </span></div><div aria-label="toggle video from We'll start out in the logs sub-directory." class="rc-Phrase css-ugczj4" data-cue="69" data-cue-index="68" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We'll start out in the logs sub-directory. </span></div><div aria-label="toggle video from If we use the ls -l command," class="rc-Phrase css-ugczj4" data-cue="70" data-cue-index="69" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">If we use the ls -l command, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">it will output the permissions for the file. </span></div><div aria-label="toggle video from It shows the permissions for the only file" class="rc-Phrase css-ugczj4" data-cue="72" data-cue-index="71" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">It shows the permissions for the only file </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">in this directory: access.txt. </span></div><div aria-label="toggle video from Previously, we learned how to read these permissions." class="rc-Phrase css-ugczj4" data-cue="74" data-cue-index="73" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Previously, we learned how to read these permissions. </span></div><div aria-label="toggle video from Previously, we learned how to read these permissions." class="rc-Phrase css-ugczj4" data-cue="74" data-cue-index="73" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The second through fourth characters </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">indicate that the user has read and write permissions. </span></div><div aria-label="toggle video from The fifth through seventh characters" class="rc-Phrase css-ugczj4" data-cue="77" data-cue-index="76" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The fifth through seventh characters </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">show the group only has read permissions. </span></div><div aria-label="toggle video from And the eighth to tenth characters show" class="rc-Phrase css-ugczj4" data-cue="79" data-cue-index="78" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">And the eighth to tenth characters show </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">that other only has read permissions. </span></div><div aria-label="toggle video from We need to adjust these permissions." class="rc-Phrase css-ugczj4" data-cue="81" data-cue-index="80" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We need to adjust these permissions. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--7"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-we-want-to-ensure-an"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from We want to ensure analysts in" class="rc-Phrase css-ugczj4" data-cue="82" data-cue-index="81" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We want to ensure analysts in </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the security group have write permission, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">but takeaway read permissions from the owner-type other, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">so we add write permissions for </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">group and remove read permissions for other. </span></div><div aria-label="toggle video from Let's run ls -l again." class="rc-Phrase css-ugczj4" data-cue="87" data-cue-index="86" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's run ls -l again. </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This shows a change in the permissions for access.txt. </span></div><div aria-label="toggle video from Notice how in the middle segment" class="rc-Phrase css-ugczj4" data-cue="89" data-cue-index="88" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Notice how in the middle segment </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">of permissions for the group, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">w has been added to give write permissions. </span></div><div aria-label="toggle video from And another change is that" class="rc-Phrase css-ugczj4" data-cue="92" data-cue-index="91" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">And another change is that </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the r has been removed in the last segment, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">indicating that read permissions </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">for other have been removed. </span></div><div aria-label="toggle video from As mentioned earlier, these hyphens" class="rc-Phrase css-ugczj4" data-cue="96" data-cue-index="95" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">As mentioned earlier, these hyphens </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">indicate a lack of permissions. </span></div><div aria-label="toggle video from Now, other is lacking all permissions." class="rc-Phrase css-ugczj4" data-cue="98" data-cue-index="97" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Now, other is lacking all permissions. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--8"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-arowdh cds-3 cds-grid-item cds-48 cds-73" id="bkmrk-though-it-requires-p"><div><div class="rc-TranscriptHighlighter css-79elbk"><div class="rc-Transcript css-9li235" data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="interactive_transcript" data-track-page="item_layout" role="presentation"><div class="cds-1 css-xl5mb3 cds-2"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Though it requires practice," class="rc-Phrase css-ugczj4" data-cue="99" data-cue-index="98" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Though it requires practice, </span></div><div aria-label="toggle video from working in Linux becomes more natural with time." class="rc-Phrase css-ugczj4" data-cue="100" data-cue-index="99" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">working in Linux becomes more natural with time. </span></div><div aria-label="toggle video from I'm glad you're learning a little" class="rc-Phrase css-ugczj4" data-cue="101" data-cue-index="100" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">I'm glad you're learning a little </span></div><div aria-label="toggle video from more about how to use Linux." class="rc-Phrase css-ugczj4" data-cue="102" data-cue-index="101" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">more about how to use Linux. </span></div></div></div></div></div></div></div></div><div class="cds-1 css-hcqebr cds-3 cds-grid-item cds-48 cds-66" id="bkmrk--9"><div class="cds-412 cds-formControl-root css-4p0j7c cds-415"></div></div>

# Permission commands

Previously, you explored file permissions and the commands that you can use to display and change them. In this reading, you’ll review these concepts and also focus on an example of how these commands work together when putting the principle of least privilege into practice.

## Reading permissions

In Linux, permissions are represented with a 10-character string. Permissions include:

<div class="rc-CML" dir="auto" id="bkmrk-read%3A-for-files%2C-thi"><div><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml" data-track-page="item_layout" role="presentation"><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml_link" data-track-page="item_layout"><div class="css-1k5v0wb" data-testid="cml-viewer">- **read**: for files, this is the ability to read the file contents; for directories, this is the ability to read all contents in the directory including both files and subdirectories
- **write**: for files, this is the ability to make modifications on the file contents; for directories, this is the ability to create new files in the directory
- **execute**: for files, this is the ability to execute the file if it’s a program; for directories, this is the ability to enter the directory and access its files

</div></div></div></div></div>These permissions are given to these types of owners:

<div class="rc-CML" dir="auto" id="bkmrk-user%3A-the-owner-of-t"><div><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml" data-track-page="item_layout" role="presentation"><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml_link" data-track-page="item_layout"><div class="css-1k5v0wb" data-testid="cml-viewer">- **user**: the owner of the file
- **group**: a larger group that the owner is a part of
- **other**: all other users on the system

</div></div></div></div></div>Each character in the 10-character string conveys different information about these permissions. The following table describes the purpose of each character:

<div class="rc-CML" dir="auto" id="bkmrk-character-example-me"><div><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml" data-track-page="item_layout" role="presentation"><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml_link" data-track-page="item_layout"><div class="css-1k5v0wb" data-testid="cml-viewer"><div class="css-1yr0py9"><table><thead><tr><th scope="col">**Character**

</th><th scope="col">**Example**

</th><th scope="col">**Meaning**

</th></tr></thead><tbody><tr><td>1st

</td><td>**d**rwxrwxrwx

</td><td>file type

- <var>d</var> for directory
- <var>-</var> for a regular file

</td></tr><tr><td>2nd

</td><td>d**r**wxrwxrwx

</td><td>read permissions for the user

- <var>r</var> if the user has read permissions
- <var>-</var> if the user lacks read permissions

</td></tr><tr><td>3rd

</td><td>dr**w**xrwxrwx

</td><td>write permissions for the user

- <var>w</var> if the user has write permissions
- <var>-</var> if the user lacks write permissions

</td></tr><tr><td>4th

</td><td>drw**x**rwxrwx

</td><td>execute permissions for the user

- <var>x</var> if the user has execute permissions
- <var>-</var> if the user lacks execute permissions

</td></tr><tr><td>5th

</td><td>drwx**r**wxrwx

</td><td>read permissions for the group

- <var>r</var> if the group has read permissions
- <var>-</var> if the group lacks read permissions

</td></tr><tr><td>6th

</td><td>drwxr**w**xrwx

</td><td>write permissions for the group

- <var>w</var> if the group has write permissions
- <var>-</var> if the group lacks write permissions

</td></tr><tr><td>7th

</td><td>drwxrw**x**rwx

</td><td>execute permissions for the group

- <var>x</var> if the group has execute permissions
- <var>-</var> if the group lacks execute permissions

</td></tr><tr><td>8th

</td><td>drwxrwx**r**wx

</td><td>read permissions for other

- <var>r</var> if the other owner type has read permissions
- <var>-</var> if the other owner type lacks read permissions

</td></tr><tr><td>9th

</td><td>drwxrwxr**w**x

</td><td>write permissions for other

- <var>w</var> if the other owner type has write permissions
- <var>-</var> if the other owner type lacks write permissions

</td></tr><tr><td>10th

</td><td>drwxrwxrw**x**

</td><td>execute permissions for other

- <var>x</var> if the other owner type has execute permissions
- <var>-</var> if the other owner type lacks execute permissions

</td></tr></tbody></table>

</div></div></div></div></div></div>## Exploring existing permissions

You can use the <var>ls</var> command to investigate who has permissions on files and directories. Previously, you learned that <var>ls</var> displays the names of files in directories in the current working directory.

There are additional options you can add to the <var>ls</var> command to make your command more specific. Some of these options provide details about permissions. Here are a few important <var>ls</var> options for security analysts:

<div class="rc-CML" dir="auto" id="bkmrk-ls--a%3A-displays-hidd"><div><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml" data-track-page="item_layout" role="presentation"><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml_link" data-track-page="item_layout"><div class="css-1k5v0wb" data-testid="cml-viewer">- <var>ls -a</var>: Displays hidden files. Hidden files start with a period (<var>.</var>) at the beginning.
- <var>ls -l</var>: Displays permissions to files and directories. Also displays other additional information, including owner name, group, file size, and the time of last modification.
- <var>ls -la</var>: Displays permissions to files and directories, including hidden files. This is a combination of the other two options.

</div></div></div></div></div>## Changing permissions

The **principle of least privilege** is the concept of granting only the minimal access and authorization required to complete a task or function. In other words, users should not have privileges that are beyond what is necessary. Not following the principle of least privilege can create security risks.

The <var>chmod</var> command can help you manage this authorization. The <var>chmod</var> command changes permissions on files and directories.

### **Using chmod**

The <var>chmod</var> command requires two arguments. The first argument indicates how to change permissions, and the second argument indicates the file or directory that you want to change permissions for. For example, the following command would add all permissions to <var>login\_sessions.txt</var>:

<var>chmod u+rwx,g+rwx,o+rwx login\_sessions.txt</var>

If you wanted to take all the permissions away, you could use

<var>chmod u-rwx,g-rwx,o-rwx login\_sessions.txt</var>

Another way to assign these permissions is to use the equals sign (<var>=</var>) in this first argument. Using <var>=</var> with <var>chmod</var> sets, or assigns, the permissions exactly as specified. For example, the following command would set read permissions for <var>login\_sessions.txt</var> for user, group, and other:

<var>chmod u=r,g=r,o=r login\_sessions.txt</var>

This command overwrites existing permissions. For instance, if the user previously had write permissions, these write permissions are removed after you specify only read permissions with <var>=</var>.

The following table reviews how each character is used within the first argument of <var>chmod</var>:

<div class="rc-CML" dir="auto" id="bkmrk-character-descriptio"><div><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml" data-track-page="item_layout" role="presentation"><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml_link" data-track-page="item_layout"><div class="css-1k5v0wb" data-testid="cml-viewer"><div class="css-1yr0py9"><table><thead><tr><th scope="col">**Character**

</th><th scope="col">**Description**

</th></tr></thead><tbody><tr><td><var>u</var>

</td><td>indicates changes will be made to user permissions

</td></tr><tr><td><var>g</var>

</td><td>indicates changes will be made to group permissions

</td></tr><tr><td><var>o</var>

</td><td>indicates changes will be made to other permissions

</td></tr><tr><td><var>+</var>

</td><td>adds permissions to the user, group, or other

</td></tr><tr><td><var>-</var>

</td><td>removes permissions from the user, group, or other

</td></tr><tr><td><var>=</var>

</td><td>assigns permissions for the user, group, or other

</td></tr></tbody></table>

</div></div></div></div></div></div>**Note:** When there are permission changes to more than one owner type, commas are needed to separate changes for each owner type. You should not add spaces after those commas.

### **The principle of least privilege in action**

As a security analyst, you may encounter a situation like this one: There’s a file called <var>bonuses.txt</var> within a compensation directory. The owner of this file is a member of the Human Resources department with a username of <var>hrrep1</var>. It has been decided that <var>hrrep1</var> needs access to this file. But, since this file contains confidential information, no one else in the <var>hr</var> group needs access.

You run <var>ls -l</var> to check the permissions of files in the compensation directory and discover that the permissions for <var>bonuses.txt</var> are <var>-rw-rw----</var>. The group owner type has read and write permissions that do not align with the principle of least privilege.

To remedy the situation, you input <var>chmod g-rw bonuses.txt</var>. Now, only the user who needs to access this file to carry out their job responsibilities can access this file.

## Key takeaways

Managing directory and file permissions may be a part of your work as a security analyst. Using <var>ls</var> with the <var>-l</var> and <var>-la</var> options allows you to investigate directory and file permissions. Using <var>chmod</var> allows you to change user permissions and ensure they are aligned with the principle of least privilege.

# Add and delete users

<div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-welcome-back%21-in-thi"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Welcome back! In this video, we are" class="rc-Phrase css-ugczj4" data-cue="1" data-cue-index="0" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Welcome back! In this video, we are </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">going to discuss adding and deleting users. </span></div><div aria-label="toggle video from current lecture segment: This is related to the concept of authentication." class="rc-Phrase active css-ugczj4" data-cue="3" data-cue-index="2" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This is related to the concept of authentication. </span></div><div aria-label="toggle video from Authentication is the process of a user" class="rc-Phrase css-ugczj4" data-cue="4" data-cue-index="3" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Authentication is the process of a user </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">proving that they are who they say </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">they are in the system. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-just-like-in-a-physi"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Just like in a physical building," class="rc-Phrase css-ugczj4" data-cue="7" data-cue-index="6" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Just like in a physical building, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">not all users should be allowed in. </span></div><div aria-label="toggle video from Not all users should get access to the system." class="rc-Phrase css-ugczj4" data-cue="9" data-cue-index="8" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Not all users should get access to the system. </span></div><div aria-label="toggle video from But we also want to make sure everyone" class="rc-Phrase css-ugczj4" data-cue="10" data-cue-index="9" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">But we also want to make sure everyone </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">who should have access to the system has it. </span></div><div aria-label="toggle video from That's why we need to add users." class="rc-Phrase css-ugczj4" data-cue="12" data-cue-index="11" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">That's why we need to add users. </span></div><div aria-label="toggle video from New users can be new to" class="rc-Phrase css-ugczj4" data-cue="13" data-cue-index="12" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">New users can be new to </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the organization or new to a group. </span></div><div aria-label="toggle video from This could be related to a change in" class="rc-Phrase css-ugczj4" data-cue="15" data-cue-index="14" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This could be related to a change in </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">organizational structure or simply a directive </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">from management to move someone. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--1"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-and-also%2C-when-users"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from And also, when users leave the organization," class="rc-Phrase css-ugczj4" data-cue="18" data-cue-index="17" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">And also, when users leave the organization, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">they need to be deleted. </span></div><div aria-label="toggle video from They should no longer have" class="rc-Phrase css-ugczj4" data-cue="20" data-cue-index="19" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">They should no longer have </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">access to any part of the system. </span></div><div aria-label="toggle video from Or if they simply changed groups," class="rc-Phrase css-ugczj4" data-cue="22" data-cue-index="21" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Or if they simply changed groups, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">they should be deleted from groups </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">that they are no longer a part of. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--2"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-now-that-we%27ve-sorte"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Now that we've sorted out why it's" class="rc-Phrase css-ugczj4" data-cue="25" data-cue-index="24" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Now that we've sorted out why it's </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">important to add and delete users, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">let's discuss a different type of user, the root user. </span></div><div aria-label="toggle video from A root user, or superuser," class="rc-Phrase css-ugczj4" data-cue="28" data-cue-index="27" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">A root user, or superuser, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">is a user with elevated privileges to modify the system. </span></div><div aria-label="toggle video from Regular users have limitations," class="rc-Phrase css-ugczj4" data-cue="30" data-cue-index="29" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Regular users have limitations, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">where the root does not. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--3"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-individuals-who-need"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Individuals who need to perform" class="rc-Phrase css-ugczj4" data-cue="32" data-cue-index="31" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Individuals who need to perform </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">specific tasks can be temporarily added as root users. </span></div><div aria-label="toggle video from Root users can create, modify," class="rc-Phrase css-ugczj4" data-cue="34" data-cue-index="33" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Root users can create, modify, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">or delete any file and run any program. </span></div><div aria-label="toggle video from Only root users or accounts with" class="rc-Phrase css-ugczj4" data-cue="36" data-cue-index="35" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Only root users or accounts with </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">root privileges can add new users. </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">So you may be wondering how you become a superuser. </span></div><div aria-label="toggle video from Well, one way is logging in as the root user," class="rc-Phrase css-ugczj4" data-cue="39" data-cue-index="38" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Well, one way is logging in as the root user, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">but running commands as the root user is </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">considered to be bad practice when using Linux. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--4"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-why-is-running-comma"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Why is running commands as" class="rc-Phrase css-ugczj4" data-cue="42" data-cue-index="41" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Why is running commands as </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">a root user potentially problematic? </span></div><div aria-label="toggle video from The first problem with logging in" class="rc-Phrase css-ugczj4" data-cue="44" data-cue-index="43" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">The first problem with logging in </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">as root is the security risks. </span></div><div aria-label="toggle video from Malicious actors will try to breach the root account." class="rc-Phrase css-ugczj4" data-cue="46" data-cue-index="45" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Malicious actors will try to breach the root account. </span></div><div aria-label="toggle video from Since it's the most powerful account, to stay safe," class="rc-Phrase css-ugczj4" data-cue="47" data-cue-index="46" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Since it's the most powerful account, to stay safe, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the root account should have logins disabled. </span></div><div aria-label="toggle video from Another problem is that it's very" class="rc-Phrase css-ugczj4" data-cue="49" data-cue-index="48" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Another problem is that it's very </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">easy to make irreversible mistakes. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--5"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-it%27s-very-easy-to-ty"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from It's very easy to type the wrong command in the CLI," class="rc-Phrase css-ugczj4" data-cue="51" data-cue-index="50" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">It's very easy to type the wrong command in the CLI, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and if you're running as the root user, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">you run a higher risk of making an irreversible mistake, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">such as permanently deleting a directory. </span></div><div aria-label="toggle video from Finally, there's the concern of accountability." class="rc-Phrase css-ugczj4" data-cue="55" data-cue-index="54" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Finally, there's the concern of accountability. </span></div><div aria-label="toggle video from In a multi-user environment like Linux," class="rc-Phrase css-ugczj4" data-cue="56" data-cue-index="55" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In a multi-user environment like Linux, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">there are many users. </span></div><div aria-label="toggle video from If a user is running as root," class="rc-Phrase css-ugczj4" data-cue="58" data-cue-index="57" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">If a user is running as root, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">there is no way to track who exactly ran a command. </span></div><div aria-label="toggle video from One solution to help solve this problem is sudo." class="rc-Phrase css-ugczj4" data-cue="60" data-cue-index="59" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">One solution to help solve this problem is sudo. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--6"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-sudo-is-a-command-th"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from sudo is a command that temporarily grants" class="rc-Phrase css-ugczj4" data-cue="61" data-cue-index="60" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">sudo is a command that temporarily grants </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">elevated permissions to specific users. </span></div><div aria-label="toggle video from This provides more of" class="rc-Phrase css-ugczj4" data-cue="63" data-cue-index="62" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This provides more of </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">a controlled approach compared to root, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">which runs every command with root privileges. </span></div><div aria-label="toggle video from sudo solves lots of" class="rc-Phrase css-ugczj4" data-cue="66" data-cue-index="65" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">sudo solves lots of </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">problems associated with running as root. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--7"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-sudo-comes-from-supe"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from sudo comes from super-user-do" class="rc-Phrase css-ugczj4" data-cue="68" data-cue-index="67" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">sudo comes from super-user-do </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and lets you execute commands as </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">an elevated user without having </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">to sign in and out of another account. </span></div><div aria-label="toggle video from Running sudo will prompt you to enter" class="rc-Phrase css-ugczj4" data-cue="72" data-cue-index="71" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Running sudo will prompt you to enter </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the password for the user you're currently logged in as. </span></div><div aria-label="toggle video from Not all users on a system can become a superuser." class="rc-Phrase css-ugczj4" data-cue="74" data-cue-index="73" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Not all users on a system can become a superuser. </span></div><div aria-label="toggle video from Users must be granted sudo access through" class="rc-Phrase css-ugczj4" data-cue="75" data-cue-index="74" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Users must be granted sudo access through </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">a configuration file called the sudoers file. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--8"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-now-that-we%27ve-learn"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Now that we've learned about sudo," class="rc-Phrase css-ugczj4" data-cue="77" data-cue-index="76" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Now that we've learned about sudo, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">let's learn how we can use it with </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">another command to add users. </span></div><div aria-label="toggle video from This command is useradd." class="rc-Phrase css-ugczj4" data-cue="80" data-cue-index="79" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This command is useradd. </span></div><div aria-label="toggle video from This command is useradd." class="rc-Phrase css-ugczj4" data-cue="80" data-cue-index="79" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">useradd adds a user to the system. </span></div><div aria-label="toggle video from Only root or users with" class="rc-Phrase css-ugczj4" data-cue="82" data-cue-index="81" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Only root or users with </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">sudo privileges can use a useradd command. </span></div><div aria-label="toggle video from Let's look at a specific example" class="rc-Phrase css-ugczj4" data-cue="84" data-cue-index="83" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's look at a specific example </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">in which we need to add a user. </span></div><div aria-label="toggle video from We'll imagine a new representative is joining" class="rc-Phrase css-ugczj4" data-cue="86" data-cue-index="85" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We'll imagine a new representative is joining </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the sales department and will be given </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the username of salesrep7. </span></div><div aria-label="toggle video from We're tasked with adding them to the system." class="rc-Phrase css-ugczj4" data-cue="89" data-cue-index="88" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We're tasked with adding them to the system. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--9"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-let%27s-try-adding-the"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Let's try adding the new user." class="rc-Phrase css-ugczj4" data-cue="90" data-cue-index="89" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's try adding the new user. </span></div><div aria-label="toggle video from First, we need to use the sudo command," class="rc-Phrase css-ugczj4" data-cue="91" data-cue-index="90" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">First, we need to use the sudo command, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">followed by the useradd command, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and then last, the username we want to add, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">in this case, salesrep7. </span></div><div aria-label="toggle video from This command doesn't display anything on the screen." class="rc-Phrase css-ugczj4" data-cue="95" data-cue-index="94" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">This command doesn't display anything on the screen. </span></div><div aria-label="toggle video from But since we get a new Bash cursor" class="rc-Phrase css-ugczj4" data-cue="96" data-cue-index="95" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">But since we get a new Bash cursor </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">and not an error message, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">we can feel confident that </span></div><div aria-label="toggle video from the command worked successfully." class="rc-Phrase css-ugczj4" data-cue="99" data-cue-index="98" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the command worked successfully. </span></div><div aria-label="toggle video from If it didn't, an error message would have appeared." class="rc-Phrase css-ugczj4" data-cue="100" data-cue-index="99" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">If it didn't, an error message would have appeared. </span></div><div aria-label="toggle video from Sometimes an error has to do with" class="rc-Phrase css-ugczj4" data-cue="101" data-cue-index="100" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Sometimes an error has to do with </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">something simple like misspelling useradd. </span></div><div aria-label="toggle video from Or, it might be because we didn't have sudo privileges." class="rc-Phrase css-ugczj4" data-cue="103" data-cue-index="102" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Or, it might be because we didn't have sudo privileges. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--10"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-now-let%27s-learn-how-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Now let's learn how to do the opposite." class="rc-Phrase css-ugczj4" data-cue="104" data-cue-index="103" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Now let's learn how to do the opposite. </span></div><div aria-label="toggle video from Let's learn how to delete a user with userdel." class="rc-Phrase css-ugczj4" data-cue="105" data-cue-index="104" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's learn how to delete a user with userdel. </span></div><div aria-label="toggle video from userdel deletes a user from the system." class="rc-Phrase css-ugczj4" data-cue="106" data-cue-index="105" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">userdel deletes a user from the system. </span></div><div aria-label="toggle video from Similarly, we need root permissions that we'll" class="rc-Phrase css-ugczj4" data-cue="107" data-cue-index="106" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Similarly, we need root permissions that we'll </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">access through sudo to use userdel. </span></div><div aria-label="toggle video from Let's go back to our example of the user we added." class="rc-Phrase css-ugczj4" data-cue="109" data-cue-index="108" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's go back to our example of the user we added. </span></div><div aria-label="toggle video from Let's imagine two months later," class="rc-Phrase css-ugczj4" data-cue="110" data-cue-index="109" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's imagine two months later, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">the sales representative that we just </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">added to the system leaves the company. </span></div><div aria-label="toggle video from That user should no longer have access to the system." class="rc-Phrase css-ugczj4" data-cue="113" data-cue-index="112" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">That user should no longer have access to the system. </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Let's delete that user from the system. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--11"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-again%2C-the-sudo-comm"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Again, the sudo command is used first," class="rc-Phrase css-ugczj4" data-cue="115" data-cue-index="114" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Again, the sudo command is used first, </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">then we add the userdel command. </span></div><div aria-label="toggle video from Last, we add the name of the user we want to delete." class="rc-Phrase css-ugczj4" data-cue="117" data-cue-index="116" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Last, we add the name of the user we want to delete. </span></div><div aria-label="toggle video from Again, we know it ran successfully because" class="rc-Phrase css-ugczj4" data-cue="118" data-cue-index="117" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Again, we know it ran successfully because </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">there is a new Bash cursor and not an error message. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--12"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="phrases" id="bkmrk-now%2C-we%27ve-covered-h"><div aria-label="toggle video from Now, we've covered how to add and delete" class="rc-Phrase css-ugczj4" data-cue="120" data-cue-index="119" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Now, we've covered how to add and delete </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">users and how these actions require sudo. </span></div><div aria-label="toggle video from When using sudo, we have to use our best judgment." class="rc-Phrase css-ugczj4" data-cue="122" data-cue-index="121" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">When using sudo, we have to use our best judgment. </span></div><div aria-label="toggle video from These special privileges must be used" class="rc-Phrase css-ugczj4" data-cue="123" data-cue-index="122" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">These special privileges must be used </span><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">responsibly to ensure a secure system. </span></div></div>

# Responsible use of sudo

Previously, you explored authorization, authentication, and Linux commands with <var>sudo</var>, <var>useradd</var>, and <var>userdel</var>. The <var>sudo</var> command is important for security analysts because it allows users to have elevated permissions without risking the system by running commands as the root user. You’ll continue exploring authorization, authentication, and Linux commands in this reading and learn two more commands that can be used with <var>sudo</var>: <var>usermod</var> and <var>chown</var>.

## Responsible use of sudo

To manage authorization and authentication, you need to be a **root user,** or a user with elevated privileges to modify the system. The root user can also be called the “super user.” You become a root user by logging in as the root user. However, running commands as the root user is not recommended in Linux because it can create security risks if malicious actors compromise that account. It’s also easy to make irreversible mistakes, and the system can’t track who ran a command. For these reasons, rather than logging in as the root user, it’s recommended you use <var>sudo</var> in Linux when you need elevated privileges.

The <var>sudo</var> command temporarily grants elevated permissions to specific users. The name of this command comes from “super user do.” Users must be given access in a configuration file to use <var>sudo</var>. This file is called the “sudoers file.” Although using <var>sudo</var> is preferable to logging in as the root user, it's important to be aware that users with the elevated permissions to use <var>sudo</var> might be more at risk in the event of an attack.

You can compare this to a hotel with a master key. The master key can be used to access any room in the hotel. There are some workers at the hotel who need this key to perform their work. For example, to clean all the rooms, the janitor would scan their ID badge and then use this master key. However, if someone outside the hotel’s network gained access to the janitor’s ID badge and master key, they could access any room in the hotel. In this example, the janitor with the master key represents a user using <var>sudo</var> for elevated privileges. Because of the dangers of <var>sudo</var>, only users who really need to use it should have these permissions.

Additionally, even if you need access to <var>sudo</var>, you should be careful about using it with only the commands you need and nothing more. Running commands with <var>sudo</var> allows users to bypass the typical security controls that are in place to prevent elevated access to an attacker.

**Note**: Be aware of <var>sudo</var> if copying commands from an online source. It’s important you don’t use <var>sudo</var> accidentally.

## Authentication and authorization with sudo

You can use <var>sudo</var> with many authentication and authorization management tasks. As a reminder, **authentication** is the process of verifying who someone is, and **authorization** is the concept of granting access to specific resources in a system. Some of the key commands used for these tasks include the following:

### **useradd**

The <var>useradd</var> command adds a user to the system. To add a user with the username of <var>fgarcia</var> with <var>sudo</var>, enter <var>sudo useradd fgarcia</var>. There are additional options you can use with <var>useradd</var>:

<div class="rc-CML" dir="auto" id="bkmrk--g%3A-sets-the-user%E2%80%99s-"><div><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml" data-track-page="item_layout" role="presentation"><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml_link" data-track-page="item_layout"><div class="css-1k5v0wb" data-testid="cml-viewer">- <var>-g</var>: Sets the user’s default group, also called their primary group
- <var>-G</var>: Adds the user to additional groups, also called supplemental or secondary groups

</div></div></div></div></div>To use the <var>-g</var> option, the primary group must be specified after <var>-g</var>. For example, entering <var>sudo useradd -g security fgarcia</var> adds <var>fgarcia</var> as a new user and assigns their primary group to be <var>security</var>.

To use the <var>-G</var> option, the supplemental group must be passed into the command after <var>-G</var>. You can add more than one supplemental group at a time with the <var>-G</var> option. Entering <var>sudo useradd -G finance,admin fgarcia</var> adds <var>fgarcia</var> as a new user and adds them to the existing <var>finance</var> and <var>admin</var> groups.

### **usermod**

The <var>usermod</var> command modifies existing user accounts. The same <var>-g</var> and <var>-G</var> options from the <var>useradd</var> command can be used with <var>usermod</var> if a user already exists.

To change the primary group of an existing user, you need the <var>-g</var> option. For example, entering <var>sudo usermod -g executive fgarcia</var> would change <var>fgarcia</var>’s primary group to the <var>executive</var> group.

To add a supplemental group for an existing user, you need the <var>-G</var> option. You also need a <var>-a</var> option, which appends the user to an existing group and is only used with the <var>-G</var> option. For example, entering <var>sudo usermod -a -G marketing fgarcia</var> would add the existing <var>fgarcia</var> user to the supplemental <var>marketing</var> group.

**Note:** When changing the supplemental group of an existing user, if you don't include the <var>-a</var> option, <var>-G</var> will replace any existing supplemental groups with the groups specified after <var>usermod</var>. Using <var>-a</var> with <var>-G</var> ensures that the new groups are added but existing groups are not replaced.

There are other options you can use with <var>usermod</var> to specify how you want to modify the user, including:

<div class="rc-CML" dir="auto" id="bkmrk--d%3A-changes-the-user"><div><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml" data-track-page="item_layout" role="presentation"><div data-track="true" data-track-action="click" data-track-app="open_course_home" data-track-component="cml_link" data-track-page="item_layout"><div class="css-1k5v0wb" data-testid="cml-viewer">- <var>-d</var>: Changes the user’s home directory.
- <var>-l</var>: Changes the user’s login name.
- <var>-L</var>: Locks the account so the user can’t log in.

</div></div></div></div></div>The option always goes after the <var>usermod</var> command. For example, to change <var>fgarcia</var>’s home directory to <var>/home/garcia\_f</var>, enter <var>sudo usermod -d /home/garcia\_f fgarcia</var>. The option <var>-d</var> directly follows the command <var>usermod</var> before the other two needed arguments.

### **userdel**

The <var>userdel</var> command deletes a user from the system. For example, entering <var>sudo userdel fgarcia</var> deletes <var>fgarcia</var> as a user. Be careful before you delete a user using this command.

The <var>userdel</var> command doesn’t delete the files in the user’s home directory unless you use the <var>-r</var> option. Entering <var>sudo userdel -r fgarcia</var> would delete <var>fgarcia</var> as a user and delete all files in their home directory. Before deleting any user files, you should ensure you have backups in case you need them later.

**Note**: Instead of deleting the user, you could consider deactivating their account with <var>usermod -L</var>. This prevents the user from logging in while still giving you access to their account and associated permissions. For example, if a user left an organization, this option would allow you to identify which files they have ownership over, so you could move this ownership to other users.

### **chown**

The <var>chown</var> command changes ownership of a file or directory. You can use <var>chown</var> to change user or group ownership. To change the user owner of the <var>access.txt</var> file to <var>fgarcia</var>, enter <var>sudo chown fgarcia access.txt</var>. To change the group owner of <var>access.txt</var> to <var>security</var>, enter <var>sudo chown :security access.txt</var>. You must enter a colon (<var>:</var>) before <var>security</var> to designate it as a group name.

Similar to <var>useradd</var>, <var>usermod</var>, and <var>userdel</var>, there are additional options that can be used with <var>chown</var>.

## Key takeaways

Authentication is the process of a user verifying their identity, and authorization is the process of determining what they have access to. You can use the <var>sudo</var> command to temporarily run commands with elevated privileges to complete authentication and authorization management tasks. Specifically, <var>useradd</var>, <var>userdel,</var> <var>usermod</var>, and <var>chown</var> can be used to manage users and file ownership.

# The Linux community

<div class="cds-185 css-xl5mb3 cds-186" id="bkmrk-there-are-so-many-ot"><div class="cds-185 rc-Paragraph css-1lz62pp cds-187 cds-grid-item"><div class="phrases"><div aria-label="toggle video from current lecture segment: There are so many others just like you" class="rc-Phrase active css-ugczj4" data-cue="1" data-cue-index="0" role="button" tabindex="0"><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">There are so many others just like you </span><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">who will be using the command line. </span></div><div aria-label="toggle video from Linux's popularity and ease of use" class="rc-Phrase css-ugczj4" data-cue="3" data-cue-index="2" role="button" tabindex="0"><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">Linux's popularity and ease of use </span><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">has created a large online community </span><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">that constantly publishes information to </span><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">help users learn how to operate Linux. </span></div><div aria-label="toggle video from Since Linux is open-source," class="rc-Phrase css-ugczj4" data-cue="7" data-cue-index="6" role="button" tabindex="0"><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">Since Linux is open-source, </span><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">it has become a global community of </span><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">users that contribute frequently. </span></div></div></div></div><div class="cds-185 css-xl5mb3 cds-186" id="bkmrk-"><div class="cds-185 rc-Paragraph css-1lz62pp cds-187 cds-grid-item">  
</div></div><div class="cds-185 css-xl5mb3 cds-186" id="bkmrk-this-global-communit"><div class="cds-185 rc-Paragraph css-1lz62pp cds-187 cds-grid-item"><div class="phrases"><div aria-label="toggle video from This global community is a huge resource for" class="rc-Phrase css-ugczj4" data-cue="10" data-cue-index="9" role="button" tabindex="0"><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">This global community is a huge resource for </span><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">all Linux users because users </span><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">can find answers for everyday tasks. </span></div><div aria-label="toggle video from Just searching on the internet will provide many answers." class="rc-Phrase css-ugczj4" data-cue="13" data-cue-index="12" role="button" tabindex="0"><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">Just searching on the internet will provide many answers. </span></div><div aria-label="toggle video from The easiest way to troubleshoot a task is to search and" class="rc-Phrase css-ugczj4" data-cue="14" data-cue-index="13" role="button" tabindex="0"><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">The easiest way to troubleshoot a task is to search and </span><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">read about how someone else has done it. </span></div><div aria-label="toggle video from Looking for resources on how to execute" class="rc-Phrase css-ugczj4" data-cue="16" data-cue-index="15" role="button" tabindex="0"><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">Looking for resources on how to execute </span><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">a task is a good way for beginners to continue learning. </span></div></div></div></div><div class="cds-185 css-xl5mb3 cds-186" id="bkmrk--1"><div class="cds-185 rc-Paragraph css-1lz62pp cds-187 cds-grid-item">  
</div></div><div class="cds-185 css-xl5mb3 cds-186" id="bkmrk-so-far%2C-you%27ve-learn"><div class="cds-185 rc-Paragraph css-1lz62pp cds-187 cds-grid-item"><div class="phrases"><div aria-label="toggle video from So far, you've learned how to add users," class="rc-Phrase css-ugczj4" data-cue="18" data-cue-index="17" role="button" tabindex="0"><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">So far, you've learned how to add users, </span><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">but imagine if later you want to add a new group. </span></div><div aria-label="toggle video from One way to learn how to do this is to search online." class="rc-Phrase css-ugczj4" data-cue="20" data-cue-index="19" role="button" tabindex="0"><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">One way to learn how to do this is to search online. </span></div><div aria-label="toggle video from Let's give this a try through a Google search." class="rc-Phrase css-ugczj4" data-cue="21" data-cue-index="20" role="button" tabindex="0"><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">Let's give this a try through a Google search. </span></div><div aria-label="toggle video from The search results give us" class="rc-Phrase css-ugczj4" data-cue="22" data-cue-index="21" role="button" tabindex="0"><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">The search results give us </span><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">many options for adding a group in Linux. </span></div></div></div></div><div class="cds-185 css-xl5mb3 cds-186" id="bkmrk--2"><div class="cds-185 rc-Paragraph css-1lz62pp cds-187 cds-grid-item">  
</div></div><div class="cds-185 css-xl5mb3 cds-186" id="bkmrk-another-reputable-so"><div class="cds-185 rc-Paragraph css-1lz62pp cds-187 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Another reputable source is a" class="rc-Phrase css-ugczj4" data-cue="24" data-cue-index="23" role="button" tabindex="0"><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">Another reputable source is a </span><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">Unix &amp; Linux Stack Exchange. </span></div><div aria-label="toggle video from Their answers are ranked with" class="rc-Phrase css-ugczj4" data-cue="26" data-cue-index="25" role="button" tabindex="0"><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">Their answers are ranked with </span><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">points to display high-quality answers. </span></div><div aria-label="toggle video from Many questions relate to" class="rc-Phrase css-ugczj4" data-cue="28" data-cue-index="27" role="button" tabindex="0"><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">Many questions relate to </span><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">more advanced users and </span><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">are geared towards troubleshooting. </span></div></div></div></div><div class="cds-185 css-xl5mb3 cds-186" id="bkmrk--3"><div class="cds-185 rc-Paragraph css-1lz62pp cds-187 cds-grid-item">  
</div></div><div class="phrases" id="bkmrk-well%2C-now-you-know-w"><div aria-label="toggle video from Well, now you know where to get some extra support" class="rc-Phrase css-ugczj4" data-cue="31" data-cue-index="30" role="button" tabindex="0"><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">Well, now you know where to get some extra support </span><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">whenever in doubt about topics in Linux. </span></div><div aria-label="toggle video from There is a lot of support just a click away." class="rc-Phrase css-ugczj4" data-cue="33" data-cue-index="32" role="button" tabindex="0"><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">There is a lot of support just a click away. </span></div><div aria-label="toggle video from Coming up, we'll learn how to get support" class="rc-Phrase css-ugczj4" data-cue="34" data-cue-index="33" role="button" tabindex="0"><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">Coming up, we'll learn how to get support </span><span aria-hidden="true" class="cds-321 css-80vnnb cds-323">from within the command line itself. Join me. </span></div></div>

# Linux resources

Previously, you were introduced to the Linux community and some resources that exist to help Linux users. Linux has many options available to give users the information they need. This reading will review these resources. When you’re aware of the resources available to you, you can continue to learn Linux independently. You can also discover even more ways that Linux can support your work as a security analyst.

## Linux community

Linux has a large online community, and this is a huge resource for Linux users of all levels. You can likely find the answers to your questions with a simple online search. Troubleshooting issues by searching and reading online is an effective way to discover how others approached your issue. It’s also a great way for beginners to learn more about Linux.

The [UNIX and Linux Stack Exchange<svg aria-labelledby="cds-react-aria-254-title" class="css-1lzqdox" fill="none" focusable="false" height="16" id="bkmrk-" role="img" viewbox="0 0 16 16" width="16"></svg>](https://unix.stackexchange.com/)

is a trusted resource for troubleshooting Linux issues. The Unix and Linux Stack Exchange is a question and answer website where community members can ask and answer questions about Linux. Community members vote on answers, so the higher quality answers are displayed at the top. Many of the questions are related to specific topics from advanced users, and the topics might help you troubleshoot issues as you continue using Linux.

## Integrated Linux support

Linux also has several commands that you can use for support.

### **man**

The <var>man</var> command displays information on other commands and how they work. It’s short for “manual.” To search for information on a command, enter the command after <var>man</var>. For example, entering <var>man chown</var> returns detailed information about <var>chown</var>, including the various options you can use with it. The output of the <var>man</var> command is also called a “man page.”

### **apropos**

The <var>apropos</var> command searches the man page descriptions for a specified string. aprops comes from the French phrase à *propos,* meaning *“to the purpose”.* Man pages can be lengthy and difficult to search through if you’re looking for a specific keyword. To use <var>apropos</var>, enter the keyword after <var>apropos</var>.

You can also include the <var>-a</var> option to search for multiple words. For example, entering <var>apropos -a graph editor</var> outputs man pages that contain both the words “graph" and "editor” in their descriptions.

### **whatis**

The <var>whatis</var> command displays a description of a command on a single line. For example, entering <var>whatis nano</var> outputs the description of <var>nano</var>. This command is useful when you don't need a detailed description, just a general idea of the command. This might be as a reminder. Or, it might be after you discover a new command through a colleague or online resource and want to know more.

## Key takeaways

There are many resources available for troubleshooting issues or getting support for Linux. Linux has a large global community of users who ask and answer questions on online resources, such as the Unix and Linux Stack Exchange. You can also use integrated support commands in Linux, such as <var>man</var>, <var>apropos</var>, and <var>whatis</var>.

## Resources for more information

There are many resources available online that can help you learn new Linux concepts, review topics, or ask and answer questions with the global Linux community. The [Unix and Linux Stack Exchange<svg aria-labelledby="cds-react-aria-255-title" class="css-1lzqdox" fill="none" focusable="false" height="16" id="bkmrk--1" role="img" viewbox="0 0 16 16" width="16"></svg>](https://unix.stackexchange.com/ "This resource is a great place to ask and answer questions about Linux with the online community.")is one example, and you can search online to find others.

# Wrap-up;  Glossary terms from week 3

<div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-congratulations%21-you"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Congratulations! You completed another section in this course." class="rc-Phrase css-ugczj4" data-cue="1" data-cue-index="0" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Congratulations! You completed another section in this course. </span></div><div aria-label="toggle video from Take a minute to think about what you've achieved." class="rc-Phrase css-ugczj4" data-cue="2" data-cue-index="1" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Take a minute to think about what you've achieved. </span></div><div aria-label="toggle video from You learned a lot in this section. Let's recap what we covered." class="rc-Phrase css-ugczj4" data-cue="3" data-cue-index="2" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">You learned a lot in this section. Let's recap what we covered. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-in-this-section%2C-you"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from In this section, you utilized the command line to communicate with the OS." class="rc-Phrase css-ugczj4" data-cue="4" data-cue-index="3" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">In this section, you utilized the command line to communicate with the OS. </span></div><div aria-label="toggle video from current lecture segment: Part of this was using commands for navigating and managing the file system." class="rc-Phrase active css-ugczj4" data-cue="5" data-cue-index="4" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Part of this was using commands for navigating and managing the file system. </span></div><div aria-label="toggle video from And you used other commands for authenticating and authorizing users." class="rc-Phrase css-ugczj4" data-cue="6" data-cue-index="5" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">And you used other commands for authenticating and authorizing users. </span></div><div aria-label="toggle video from These are all tasks that a security analyst is likely to encounter." class="rc-Phrase css-ugczj4" data-cue="7" data-cue-index="6" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">These are all tasks that a security analyst is likely to encounter. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--1"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk-finally%2C-you-learned"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item"><div class="phrases"><div aria-label="toggle video from Finally, you learned about accessing resources that support" class="rc-Phrase css-ugczj4" data-cue="8" data-cue-index="7" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">Finally, you learned about accessing resources that support </span></div><div aria-label="toggle video from learning new Linux commands." class="rc-Phrase css-ugczj4" data-cue="9" data-cue-index="8" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">learning new Linux commands. </span></div><div aria-label="toggle video from With this knowledge, you'll be able to continue learning more and" class="rc-Phrase css-ugczj4" data-cue="10" data-cue-index="9" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">With this knowledge, you'll be able to continue learning more and </span></div><div aria-label="toggle video from more about using the command line." class="rc-Phrase css-ugczj4" data-cue="11" data-cue-index="10" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">more about using the command line. </span></div></div></div></div><div class="cds-1 css-xl5mb3 cds-2" id="bkmrk--2"><div class="cds-1 rc-Paragraph css-1lz62pp cds-3 cds-grid-item">  
</div></div><div class="phrases" id="bkmrk-we-did-it%21-we-learne"><div aria-label="toggle video from We did it! we learned how to communicate with Linux." class="rc-Phrase css-ugczj4" data-cue="12" data-cue-index="11" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">We did it! we learned how to communicate with Linux. </span></div><div aria-label="toggle video from That's a great accomplishment, and" class="rc-Phrase css-ugczj4" data-cue="13" data-cue-index="12" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">That's a great accomplishment, and </span></div><div aria-label="toggle video from one that will be very useful to you in your career as a security analyst." class="rc-Phrase css-ugczj4" data-cue="14" data-cue-index="13" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">one that will be very useful to you in your career as a security analyst. </span></div><div aria-label="toggle video from You should be proud of the work that you've done so far." class="rc-Phrase css-ugczj4" data-cue="15" data-cue-index="14" role="button" tabindex="0"><span aria-hidden="true" class="cds-137 css-80vnnb cds-139">You should be proud of the work that you've done so far. </span></div><div aria-label="toggle video from You should be proud of the work that you've done so far." class="rc-Phrase css-ugczj4" data-cue="15" data-cue-index="14" role="button" tabindex="0">  
</div></div><div class="phrases" id="bkmrk--3"><div aria-label="toggle video from You should be proud of the work that you've done so far." class="rc-Phrase css-ugczj4" data-cue="15" data-cue-index="14" role="button" tabindex="0">---

</div></div>### **Terms and definitions from Course 4, Week 3**

**Absolute file path:** The full file path, which starts from the root

**Argument (Linux):** Specific information needed by a command

**Authentication:** The process of verifying who someone is

**Authorization:** The concept of granting access to specific resources in a system

**Bash:** The default shell in most Linux distributions

**Command:** An instruction telling the computer to do something

**File path:** The location of a file or directory

**Filesystem Hierarchy Standard (FHS):** The component of the Linux OS that organizes data

**Filtering:** Selecting data that match a certain condition

**nano:** A command-line file editor that is available by default in many Linux distributions

**Options:** Input that modifies the behavior of a command

**Permissions:** The type of access granted for a file or directory

**Principle of least privilege:** The concept of granting only the minimal access and authorization required to complete a task or function

**Relative file path:** A file path that starts from the user's current directory

**Root directory:** The highest-level directory in Linux

**Root user (or superuser):** A user with elevated privileges to modify the system

**Standard input:** Information received by the OS via the command line

**Standard output:** Information returned by the OS through the shell