Changes

Jump to: navigation, search

Tutorial2: Unix / Linux File Management

210 bytes added, 15:42, 6 January 2021
Part 2: Viewing Directory Contents / Copying & Moving Directories
'''Perform the Following Steps:'''
<table align="right"><tr valign="top"><td>[[Image:directory-structure-5.png|thumb|right|250px|Output of the '''tree''' command to display directory structure.]]</td><td>[[Image:directory-structure-6.png|thumb|right|250px|Output of the '''ls -R''' command to display directory structure.]]</td></table>
# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">tree/home/your-seneca-id/</span><br><br>'''NOTE:''' You should see the directory structure that you created in the previous section. You can also issue the tree command using a directory pathname to display the directory structure for a specific scope.<br><br>You can also use the '''-R''' option for the ls command to display all directories and subdirectories for a specified directory path (referred to as a '''recursive directory listing''').<br><br># Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">ls -lR/home/your-seneca-id/</span><br><br>What directories do you see?<br><br># Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">ls -lR uli101/home/your-seneca-id/uli101xxx</span><br><br>Note the differences between both of these commands.<br><br>You can copy and move entire directories (and their contents) to other directories.<br><br><table align="right"><tr valign="top"><td>[[Image:directory-structure-7.png|thumb|right|250px|Output of the '''tree''' command to confirm copy of '''uli101uli101xx''' directory (and contents) to the '''xyzxyzxx''' directory.]]</td><td>[[Image:directory-structure-8.png|thumb|right|300px|Output of the '''tree''' command to confirm movement of '''acp100 directory''' directory (and contents) to the '''xyz''' diredtory.]]</td></tr></table># Issue the following Linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">cp -R uli101 xyz100/home/your-seneca-id/uli101xx /home/your-seneca-id/xyz100xx</span><br><br>#Issue the following Linux command to display the directory structure of your home directory to confirm you copied the uli101 uli101xx directory:<br><span style="color:blue;font-weight:bold;font-family:courier;">tree/home/your-seneca-id/</span><br><br># Issue the following Linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">mv acp100 /home/your-seneca-id/acp100xx /home/your-seneca-id/xyz100/uli101uli101xx/tutorials</span><br><br>#Issue the following Linux command to display the directory structure of your home directory to confirm you copied the uli101 directory:<br><span style="color:blue;font-weight:bold;font-family:courier;">tree/home/your-seneca-id/</span><br><br>Let's download and run a checking script to see if you moved and copied the directories correctly.<br><br>
# Make certain that your current directory is '''your home directory'''.<br><br>
# Issue the following Linux command run checking script:<br><span style="color:blue;font-weight:bold;font-family:courier;">bash /home/murray.saul/scripts/week2-check-2</span><br><br>
13,420
edits

Navigation menu