Dr. Mark Humphrys

School of Computing. Dublin City University.

Online coding site: Ancient Brain

 

Search:


Intro to DCU Linux (command-line)

There may be a choice of command-lines. Search for "terminal" or similar.



Terminal

  1. Terminal
    • Default shell is bash. Other shells are installed.
    • Increase font is Ctrl + which on your keyboard may translate to Ctrl Shift +
    • Decrease font is Ctrl -
    • In GNOME Terminal, if a URL appears in the text on the command-line, you can right-click on it to open it in browser.

  2. Command-line keys:

  3. ls
    • ls
    • ls -l
    • echo * (all normal, non-hidden files and dirs)
    • ls -l * (if dir, will display contents)
    • ls -ld * (if dir, display name not contents)

  4. hidden files
    • ls -a
    • ls -al
    • echo .* (all hidden files)
    • echo .* * (all files)
    • ls -l .* (don't need -a if going to actually name the hidden files)
    • ls -ld .*

  5. environment variables
    • set
    • set > file.txt
    • env
    • env | sort
    • echo HOME - the string "HOME"
    • echo $HOME - the global (environment) variable HOME
    • PATH = list of dirs searched for command when you type a command, separated by colons (:)
    • SHELL = shell we are using (default here is bash)

  6. Shared, multi-user, file system:
    • HOME = something like:
        /users/yourgroup/yourusername 
      

    • My test account is here:
      /users/tutors/mhumphrysdculab

  7. current and parent dirs
    • . (current dir)
    • .. (parent dir)
    • Example: Run a program that is in the current dir but not in the PATH:
       ./prog 

  8. cd
    • go home: cd
    • go up to parent dir: cd ..
    • go back to last dir: cd -




Command-line text editors




history

  

Disk quota

To see your disk quota, type:
 
 quota -s  

If you get "Disk quota exceeded"



Misc

  

Works of Shakespeare

For testing manipulation of data with Linux commands, it helps if we have some data to manipulate. So I have installed the works of Shakespeare to use for testing.

  

Core information you need

  

More on the Shakespeare files




These Shakespeare files use relative HTML links, not absolute HTML links, so can download to any location and the links still work ok.



ancientbrain.com      w2mind.org      humphrysfamilytree.com

On the Internet since 1987.      New 250 G VPS server.

Note: Links on this site to user-generated content like Wikipedia are highlighted in red as possibly unreliable. My view is that such links are highly useful but flawed.