Question: Lab Assignment 3 - 1 Bash Shell Linux + and LPIC - 1 1 . Create an alias called MM that displays only those filesystems

Lab Assignment 3-1 Bash Shell Linux+ and LPIC-1
1. Create an alias called MM that displays only those filesystems that are mounted and are type ext4 filesystems.
alias mm='mount | grep ext4'
echo "alias mm='mount | grep ext4'">> ~/.bashrc
source ~/.bashrc
2. Create and export a variable called NEWHOME that is equivalent to the value contained in the HOME variable.
export NEWHOME=$HOME
echo "export NEWHOME=\$HOME" >> ~/.bashrc
source ~/.bashrc
3. Find all files that start with the word host starting from the /etc directory and save the Standard Output to a file called fileout and Standard Error to a file called fileerr.
find /etc -name "host*"> fileout 2> fileerr
cat fileout
cat fileerr
4. Display only the lines from the output of the set command that the word bash in them. This output should be sorted alphabetically.
set | grep "bash" | sort
set | grep "bash" | sort > bash_variables.txt
less bash_variables.txt
5. Display only the user name (first field) in the colon-delimited /etc/password file and save the output to a file called users.
cut -d: -f1/etc/passwd > users
cat users
sudo cut -d: -f1/etc/passwd > users
sudo cat users
6. Redirect the output of the ls l ~ command to a file named mydirectory.
ls -l ~ > mydirectory
cat mydirectory
sudo ls -l ~ > mydirectory
sudo cat mydirectory
7. Pipe the output of the ls al / to the more utility
ls -al /| more
sudo ls -al /| more
8. Assume you have two files: text1 and text2, concatenate the output of text2 to text1.
cat text2>> text1
cat text2> text1
cat text1
sudo cat text2>> text1
sudo cat text1
9. Change the prompt on your computer to: This is a new prompt: $
export PS1="This is a new prompt: \$ "
echo 'export PS1="This is a new prompt: \\$ "'>> ~/.bashrc
source ~/.bashrc
10. Display a list of the last 10 commands executed on your system.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!