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:
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.
Objectives:
- Objective: Learn how to create and use an Alias. Learn how to modify your command prompt to display helpful information.
Complete the following problems
Adrianna's video on how to use tar https://youtu.be/x0EK6PmKRCU
References, a video, a PowerPoint and some notes are available at my website https://www.aholdengouveia.name/IntroLinux/aliasesandothers.html
Aliases
Reference: http://linuxreviews.org/quicktips/alias/
- For this part we are going to create and alias that will untar a tarball easily. enumerate
- Look up the man file on Aliases, take a screenshot.
- Create an alias called untar that will run the command tar -xvf take a screenshot.
- Create a tarball of your folders. take a screenshot.
- Run untar on that tarball. What happened? take a screenshot.
- 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)
- Pick one command that you use all the time, create and alias for it. Tell me what the command is, why you chose is and what you called your alias. take a screenshot.
- The answers to all the questions should be put in a file called Aliases
Environment variables
This part of the lab is about changing your command prompt. We will be using Environmental Variables to do this.
Reference: Bash prompt customization guide and Bash prompt tutorial
https://www.maketecheasier.com/more-useful-and-interesting-bash-prompts/
- Run the command echo \$SHELL What happened? take a screenshot.
- 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
- What does your .bash\_profile or .profile say? take a screenshot.
- 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.
- Run the command unset PS1 What happened? How did you fix it? take a screenshot.
- Go to the second reference link, read through it and make a command prompt that you think will be most useful to you. What did you do? Take a screenshot.
- The answers to all the questions should be put in a file called EnvironmentVariables
Deliverables
Two files should be submitted, both should have your name, date and lab title on them. 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.