Dr. Mark Humphrys

School of Computing. Dublin City University.

Online coding site: Ancient Brain

coders   JavaScript worlds

Search:

Free AI exercises


Linux Quiz 2



  

PATH and programs

  1. What is the environment variable $PATH?
  2. Show me the value of $PATH
  3. Find what directory "ls" is in.
  4. Show the file size of the "ls" program.

Hard to test, but have a think anyway

  1. Two programs, in different directories, have the same name. One is a system program. The other is a script that you wrote. What happens when you type that name?
  2. In the previous, if you find the system program is running when you type that name, how can you make sure that your program runs instead?

Challenge question

  1. Get the value of $PATH and translate all the ":" characters to newline characters.

GUI programs

  1. Issuing the command gedit will do what?
  2. Issuing the command gedit & 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 > $HOME/outputfile.log
    
  6. Typing the command man man > man does what?
  


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