PDF Version Available

This document is also available in PDF format: aliasesandothers.pdf

The PDF version includes bookmarks for easy navigation and is optimized for printing.

Accessibility Notice

This document is also available in HTML format at:

Link: https://aholdengouveia.name/IntroLinux/labs/aliasesandothers.html

The HTML version provides enhanced accessibility features including keyboard navigation, screen reader support, responsive design, dark mode support, and high contrast options.

Learning Outcomes

By the end of this lab, you will be able to:

Lab Instructions

Aliases

Reference: Link: https://linuxreviews.org/HOWTO_make_aliases_for_frequently_used_commands

  1. For this part we are going to create an alias that will untar a tarball easily.
    1. Look up alias by running help alias. Take a screenshot.
    2. Create an alias called untar that will run the command tar -xvf. Take a screenshot.
    3. Create a tarball of your folders (my video on how to use tar is linked under Resources). Take a screenshot.
    4. Run untar on that tarball. What happened? Take a screenshot.
    5. How would you make this a permanent addition to your bash profile? (Don't make it permanent, just tell me how you would do it)
  2. Pick one command that you use all the time, and create an alias for it. Tell me what the command is, why you chose it, and what you called your alias. Take a screenshot.

Environment variables

This part of the lab is about changing your command prompt. We will be using Environmental Variables to do this.

References:

Link: https://www.maketecheasier.com/8-useful-and-interesting-bash-prompts/

Link: https://wiki.archlinux.org/title/Bash/Prompt_customization

  1. Run the command echo $SHELL. What happened? Take a screenshot.
  2. To do this you need to change the variable PS1 and reset it to your desired prompt. Reset this to your full first name. Take a screenshot to pass in.
  3. What does your .bash_profile or .profile say? Take a screenshot.
  4. Go to the man file on Bash. You should be able to find options for your prompt. Try adding in the current time option, any of the 4 choices are fine.
  5. Run the command unset PS1. What happened? How did you fix it? Take a screenshot.
  6. Go to the Arch Wiki page on prompt customization (linked above), read through it and make a command prompt that you think will be most useful to you. What did you do? Take a screenshot.

Deliverables

One file should be submitted, with your name, date and lab title on it. It should have two clearly labeled sections:

Include screenshots of each of your successful commands and prompt changes. Make sure to clearly label any screenshots and answers so it's clear what you're solving. Since your prompt will change during this lab, every screenshot must include a note with your name and the term. This is an example of what it should look like:

Example screenshot: a web browser showing the Google home page, with a small text editor window in front of it that says YOUR NAME HERE and TERM YEAR
This is an image of what each of your screenshots should look like

Resources

References, a video, a PowerPoint and some notes are available at my website Link: https://www.aholdengouveia.name/IntroLinux/aliasesandothers.html

My FAQ Linux playlist on YouTube, with demos of many of the commands and scripts in this class Link: https://www.youtube.com/playlist?list=PLQOmuLC45eoQlIMH7oCNL6yFP7kWQubBo

My video on how to use tar Link: https://www.youtube.com/watch?v=x0EK6PmKRCU