Class Test 1 Unix Software Tools

Class Test 1 Unix Software Tools

<p>Class Test 1 Unix Software Tools</p><p>NAME:______STUDENT NUMBER:______</p><p>Write clearly. If you mean $ and write S, that is incorrect. If you mean dot (clearly put a dot). Assume you are on the university machines. </p><p>1. cd ../; cd .; cd /; cd ~; What directory are you currently in? ______</p><p>2. List all the files in the current directory with .txt extension? ______</p><p>3. What ‘files’ are always present in any directory? What are their names and what do they represent? How would you list all the files in a directory except these default files?______</p><p>4. In your home directory you usually have a number of hidden files associated with your shell (e.g. bash). For example the files </p><p>.bash_history .bash_logout .bashrc .bash_profile.</p><p>What command could you use to list only these files (i.e. files starting with a “dot bash”)?______</p><p>5. The above 4 files are “hidden”, indicated by the dot (these are also called “dot files”). Can we have hidden directories? ______</p><p>6. What command would you use to see what read/write/execute permissions a file has e.g. file.txt? ______</p><p>7. List as many ways as you can think of to get help on Unix/Linux?</p><p>______</p><p>8. Given a regular ascii file test.data, what does the command </p><p> cut –f1- test.data do? ______</p><p>9. What does the following achieve (i.e. what files will be created, what is their contents and which directory will you be in?). cd /; echo echo > echo.txt; cd;</p><p>10.You type alias alias=’’ and alias unalias=’’.(in both cases it is single quote and single quote, not a double quote) Will this cause a problem? Can you recover from this? ______</p><p>11.Explain the following. The command cat says that hello.txt does not exist, but when ls is executed, it says there is a file. Why is this?</p><p>$cat hello.txt</p><p> cat: hello.txt: No such file or directory $ls -l hello.txt</p><p>-rw-r--r-- 1 zlizjw1 Domain U 38 Feb 19 11:33 hello.txt</p><p>12. Issue chmod 742 file1.txt. What are the permissions after? </p><p>______</p><p>13. Issue chmod u+x file2.txt. What are the permissions after? </p><p>______</p><p>14. You have a java program (big.java) you want to run but it is “big” and will take a lot of processor time. If you run it with the command java big you may slow down the work of other people. How would you run the program to be kind or fair or polite to other people? ______</p><p>15. A process is running out of control. List all the command you could try to stop the program. List them in the order you would try them (i.e. the safest first, and the harshest last). </p><p>______</p><p>16. If we issue the command mkdir myDir then echo $? and get the value 0, what can we say happened? ______</p><p>17. echo hello > hello.txt ; echo bye.txt > hello.txt; echo bye >> hello.txt What files are created, and what it the final contents?</p><p>______</p><p>18. Which of the following are equal? ls –la; ls –l –a; ls –al; ls –a –l;</p><p>______</p><p>19. ls | uniq | wc and ls | wc should give the same output – why?</p><p>______</p><p>20.What command would you use to remove a file –file.txt (note “-“).</p><p>______</p><p>21.What permissions does a file normally receive? ______</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    2 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us