Utah Tech Logo

IT3300

DevOps virtualization

Lab alias and personalizing your account.

This lab is done on your CLI.

Part I

Using alias

  1. Create an alias named whoosh that ssh’s into scratch.cs.dixie.edu

  2. Create an alias named mygrep that prints the line containing root in /etc/passwd

  3. Create an alias named psort that prints /etc/passwd sorted.

  4. Create your own alias

Part II

Prompt

  1. Create an alias called prompt1 which sets the variable $PS1 to the default prompt.

  2. Create an alias called prompt2 which changes the prompt to [username@cli:working_directory$] . (example: [carol@carol-cli:~$] )

  3. Create an alias called prompt3 which is prompt2 but yellow. You might find the following website helpful [prompt_colors] (http://cit.dixie.edu/it/1100/files/linux_text.pdf#page=190&zoom=100,144,230)

  4. Create your own prompt4.

Part III

Personalizing your account.

  1. Put your alias’s in the .bashrc (including the prompts)

    • To test if it works, do the following.
      1. Use the following command unalias -a which will remove all aliases.
      2. Test and make sure that your commands don’t work.
      3. Do the command source .bashrc
      4. Test your commands and make sure that they work.
  2. Make a welcome message and put it in the .bashrc.

    • Use this website: [ascii_text] (http://patorjk.com/software/taag/#p=display&f=Graffiti&t=Type%20Something%20)
    • Copy the text and put encase it in triple quotes.
    • Example: echo “"”Big text here”””

    • Put your command as the last line in the .bashrc

    • Linux does not like the \ or the single quote so replace them with the pipe and back tick.

PART IV

Personalizing the exit

  1. Print a message to the user when they logout. Use the echo command like you did for the .bashrc.

  2. Put a command in the .bash_logout file. Everytime you log out, put a message in $HOME/log.txt that also says the date and time.

The grading script will look that you have at least 2 echo statements in your bash_logout. If you do not, it will fail.

To pass off

The grading script will be run as you are logged into scratch. The command you will execute will be similar for all of your assignments that have an autograder. Here is a sample of the command you will run: run_grader.py --n 2 --ip 1.2.3.4. The 2 is representative of lab2. (Lab 3 would replace the 2 with a 3). NOTE you will pass in the ip address of your virtual machine that you have created. You will see some feedback. You should make sure that all your tests pass and that your score is correctly recorded. Please see your instructor for any help or questi ons on the output.