Changes

Jump to: navigation, search
Method 2: Decimal to Binary
# Write down the '''decimal number''' to be converted.
# On the ''right-side'', write the number '''1''' and moving '''leftwards''', keep <u>doubling</u> the numbers until that number is '''greater than''' the decimal number to be converted (refer to the diagram on the right).<br>
# Starting on the rightleft-side of those doubled numbers, compare that number with the decimal number. If that number if less than or equal to the decimal number, then write a '''1''' below and subtract that number from the decimal number to get a remainder. If the number is greater than decimal number (or remainder), then write a '''0''' below.<br><br># Repeat '''step #3''' (moving leftwards rightwards and comparing the number with the decimal's remainder)<br><br>'''NOTE:''' If you are converting to '''8-bit''', '''32-bit''', etc., add '''leading zeros''' if necessary.<br><br>
==== Method 3: Octal to Binary / Binary to Octal ====
# '''Login''' your matrix account and issue a command to '''confirm''' you are located in your '''home''' directory.<br><br>
# Issue a single Linux command to create the following directory structure displayed in the diagram to the right.<br><br>
# Make certain that your current directory is '''your home directory'''.<br><br>'''NOTE:''' You will now run a shell script to confirm that you properly created that directory structure<br>in your ''Matrix '' account.<br><br>
# Issue the following Linux command to run a checking script:<br><span style="color:blue;font-weight:bold;font-family:courier;">bash /home/murray.saul/scripts/week4-check-1</span><br><br>
# If you encounter errors and '''re-run ''' the checking script until you receive a congratulations message, then you can proceed.<br><br>[[Image:file-permission-practice-2.png|right|450px|thumb|]]
# Issue Linux commands to create empty files for each of those newly created directories as show in diagram to the right:<br><br>'''NOTE:''' You will now run another shell script to confirm that you properly created those empty files within those specified directories.<br><br>
# Issue the following Linux command to run a checking script:<br><span style="color:blue;font-weight:bold;font-family:courier;">bash /home/murray.saul/scripts/week4-check-2</span><br><br>
# If you encounter errors and '''re-run ''' the checking script until you receive a congratulations message, then continue the remaining steps.<br><br>Let's get practice understanding permissions, changing permissions, and setting your Linux account to automatically set permissions for newly created directories and regular files.<br><br>
# Issue the following Linux commands:<br><span style="color:blue;font-weight:bold;font-family:courier;">ls -ld ~/documents ~/clients ~/vendors<br>ls -lR ~/documents ~/clients ~/vendors</span><br><br>'''NOTE:''' You should see permissions already set for those newly created directories and regular files. What do these permissions mean for '''same group member''' and '''other group member''' access to those directory and regular files?<br><br>
# Let's limit access to the '''clients''' and '''vendors''' directories to only yourself and same group members. Issue the following Linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">chmod 750 ~/clients ~/vendors</span><br><br>
# Issue the '''ls''' command to confirm that the permissions for those directories have been changed.<br><br>'''NOTE:''' The '''-R''' option for the '''chmod''' command can change the file permissions <u>recursively</u> within a directory structure.<br><br>
# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">chmod 750 -R ~/documents</span><br><br>
# Again, use the '''ls ''' command to confirm the permissions for the '''~/documents''', '''~/document/memos''' , '''~/documents/reports''', and '''~/documents/contracts''' directories.<br><br>
# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">ls -lR ~/documents</span><br>What do you noticed happened to the permissions for the regular files contained in those directories. Did those regular file permissions change?<br><br>We want to now change those regular file permissions to the following settings: <span style="font-weight:bold;font-family:courier;">r w - r - - - - -</span><br><br>
# Issue the following Linux commands: <br><span style="color:blue;font-weight:bold;font-family:courier;">chmod 740 640 ~/documents/memos/memo*.txt<br>chmod 740 640 ~/documents/reports/report*.txt<br>chmod 740 640 ~/dcouments/contracts/contract*.txt</span><br><br>
# Issue the '''ls -lR''' command for the '''~/documents''' directory to confirm that those regular file permission have changed.<br><br>Let's get some practice setting permissions to allow users to make editing changes to regular files.<br><br>
# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">chmod ugo-w ~/documents/memos/memo*.txt</span><br><br>
13,420
edits

Navigation menu