Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In Linux please 1. Name the command that can be used to do each of the following

ID: 3669204 • Letter: I

Question

In Linux please

1. Name the command that can be used to do each of the following:

a. Create an alias called mm that displays only those filesystems that are mounted and contain an ext4 filesystem.

b. Create and export a variable called NEWHOME that is equivalent to the value contained in the HOME variable.

c. Find all files that start with the word “host” starting from the /etc directory and save the Standard Output to a file called file1 and the Standard Error to the same file.

d. Display only the lines from the output of the set command that have the word “bash” in them. This output on the terminal screen should be sorted alphabetically.

e.Display only the user name (first field) in the colon-delimited /etc/passwd file and save the output to a file called users in the current directory.

Explanation / Answer

a) alias home='cd /home/dave/public_html'
ext4 can be mounted with e2label /dev/device
e2label /dev/device new-label-name-here

b) export NEWHOME=$NEWHOME:/usr/local/bin
echo "$NEWHOME"

c) $ telnet [TAB][TAB]
localhost dev-db fileserver
host ip-address-here
host host-name-here
host host-name-here [DNS-Server-Name-Here]
host [options] IPAddress | Hostname [DNS-Server-Name-Here]

d) if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi

e) u="$USER"
echo "User name $u"

cut -d: -f1 /etc/passwd
sed 's/:.*//' /etc/passwd
awk -F: '{print $1}' /etc/passwd

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote