Dr. Mark Humphrys

School of Computing. Dublin City University.

Online coding site: Ancient Brain

 

Search:


Linux Quiz 2



  

PATH and programs

  1. What is the environment variable $PATH?
  2. How do you output the value of $PATH
  3. How do you output the value of $PATH and translate the ":" characters to newline characters. (Challenge question)
  4. Find what directory "rm" is in.
  5. Show the file size of the "rm" program.

GUI programs

  1. Issuing the command gedit will do what?
  2. Issuing the command gedit & will do what?
  3. Issuing the command ls will do what?
  4. Issuing the command ls & will do what?

redirection

  1. What is the effect of the following Linux command? ls -al > myfile
  2. What will this do?
    cd 
    ls -alR 
    
  3. What will this do?
    cd /
    ls -alR 
    
  4. What will this do?
    cd 
    ls -al > outputfile.log
    
  5. What will this do?
    cd /
    ls -al > outputfile.log
    
  6. What will this do?
    cd /
    ls -al > $HOME/outputfile.log
    
  7. Typing the command man ls > ls.txt does what?
  8. Typing the command man man > man does what?

Hard to test, but have a think anyway

  1. If there are "ls" programs in multiple directories in the PATH, which one runs when you type "ls"?
  2. If you make your own "ls" program and put it in your own directory, and change the PATH to include that directory, then when you type "ls" will your "ls" program run or the Linux "ls" program?
  3. In the previous, if you find the system program is running when you type "ls", how can you make sure your "ls" program runs instead?
  


If you submit by mistake or make an error, just press "Back" and submit again.