Changes between Version 1 and Version 2 of cypress/BasicLinuxComands/Exercise


Ignore:
Timestamp:
Aug 18, 2015 9:40:48 PM (6 years ago)
Author:
cmaggio
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • cypress/BasicLinuxComands/Exercise

    v1 v2  
    33Let's put some of our new knowledge into practice by creating a new directory to house some files we'll be using throughout the day.
    44
     5== Goal: Create a subdirectory in your home directory ==
     6
     7While logged into Cypress:
     8* Navigate to your home directory by using the '''cd ~''' command.
     9* Check that you are in your home directory by using the '''pwd''' command.
     10
     11{{{
     12[tuhpc002@cypress1 ~]$ cd ~
     13[tuhpc002@cypress1 ~]$ pwd
     14/home/workshop/tuhpc002
     15[tuhpc002@cypress1 ~]$
     16}}}
     17
     18Next:
     19* Make a new subdirectory called "examples" using the '''mkdir''' command.
     20* Check that the directory was created by using the '''ls''' command.
     21{{{
     22[tuhpc002@cypress1 ~]$ mkdir examples
     23[tuhpc002@cypress1 ~]$ ls
     24examples
     25[tuhpc002@cypress1 ~]$
     26}}}
     27
     28* Move into the examples subdirectory using the '''cd command''' and the relative path directory examples
     29{{{
     30[tuhpc002@cypress1 ~]$ cd examples/
     31[tuhpc002@cypress1 examples]$
     32}}}
     33
     34* Now, check the contents of the directory "/lustre/project/workshop/textfiles" using the '''ls''' command and the absolute path directory (Hint, you can use the tab key to autocomplete partially typed commands)
     35
     36{{{
     37[tuhpc002@cypress1 textfiles]$ ls /lustre/project/workshop/textfiles/
     38alphabet.txt  numbers.txt
     39[tuhpc002@cypress1 textfiles]$
     40}}}
     41
     42* Copy the contents of the textfiles directory to your examples directory using the '''cp''' command
     43* Use the '''ls''' command to ensure that you've transferred the correct files to the correct directory 
     44{{{
     45[tuhpc002@cypress1 examples]$ cp /lustre/project/workshop/textfiles/alphabet.txt alphabet.txt
     46[tuhpc002@cypress1 examples]$ cp /lustre/project/workshop/textfiles/numbers.txt numbers.txt
     47[tuhpc002@cypress1 examples]$ ls
     48alphabet.txt  numbers.txt
     49[tuhpc002@cypress1 examples]$
     50}}}
     51
     52* Create a backup of the "numbers.txt" file named "numbers_backup.txt" using the '''cp''' command.
     53
     54{{{
     55[tuhpc002@cypress1 examples]$ cp numbers.txt numbers_backup.txt
     56[tuhpc002@cypress1 examples]$ ls
     57alphabet.txt  numbers_backup.txt  numbers.txt
     58[tuhpc002@cypress1 examples]$
     59}}}
     60
     61* Remove the original "numbers.txt" file using the '''rm''' command
     62{{{
     63[tuhpc002@cypress1 examples]$ ls
     64alphabet.txt  numbers_backup.txt  numbers.txt
     65[tuhpc002@cypress1 examples]$ rm numbers.txt
     66[tuhpc002@cypress1 examples]$ ls
     67alphabet.txt  numbers_backup.txt
     68[tuhpc002@cypress1 examples]$
     69}}}
     70
     71* rename the backup file "numbers.txt" using the '''mv''' command
     72{{{
     73[tuhpc002@cypress1 examples]$ ls
     74alphabet.txt  numbers_backup.txt
     75[tuhpc002@cypress1 examples]$ mv numbers_backup.txt numbers.txt
     76[tuhpc002@cypress1 examples]$ ls
     77alphabet.txt  numbers.txt
     78[tuhpc002@cypress1 examples]$
     79}}}
     80
     81== Challenge ==
     82
     83* Create two new subdirectories in your home directory called "letters" and "digits".
     84* Move the alphabet.txt file to the letters directory and the numbers.txt file to the digits directory.
     85* Lastly remove the examples directory from your home directory.
    586
    687[[cypress/BasicLinuxComands|return to basic linux commands page]]