Use a terminal session to:

  1. Make a directory called LabTask1 off your home directory (0.0%). Do the following questions in the directory.
    Answer
    cd
    mkdir LabTask1 
  2. Find out your Put the answers into a text file. (0.5%)
    Answer
    For csc322 ...
    502
    20
    staff everyone
    /bin/tcsh
    /Users/geoff
    .:/Users/geoff/bin:/sbin:/bin:/Users/geoff/MyApplications/Development/Anaconda/bin:/usr/local/sbin:/usr/local/bin:/usr/local/java/bin:/usr/X11R6/bin:/opt/local/bin:/opt/local/sbin:/usr/sbin:/usr/bin:/usr/ucb:/etc:/opt/gradle/gradle-6.6/bin
    
  3. Write a shell script that will provide the above information (the script must be a executable, and must work regardless of which directory it is in). (1.0%)
    Answer
    #!/bin/tcsh
    
    id -u
    id -g
    id -nG         or   groups     
    which tcsh
    cd; pwd        or   echo $HOME     or printenv HOME
                   or   echo $PATH     or printenv PATH
    and use chmod 755 or chmod +x to make it executable.

  4. Imagine you start a program from your command line prompt. (0.5%)
    Answer

  5. Read the man pages about the ls and wc commands. Devise a minimal pipeline command that will print the number of files and subdirectories in the current directory (including hidden ones, but not the current and parent directory entries). (0.5%)
    Answer
    ls -A | wc -l