1) What do the following variables mean? a. $HOME b. $PATH c. $TERM d. $SHELL 2)
ID: 3769866 • Letter: 1
Question
1) What do the following variables mean?
a. $HOME
b. $PATH
c. $TERM
d. $SHELL
2) What command will search the file /tmp/MCSE for the pattern “MCSE”? (the file exists so you can test your command)
3) Write a single command line that will change the permissions on your home directory so that you and members of your group can change into it, but others cannot.
4) What command will show the amount of free disk space on the file systems attached to the server?
5) Read the man page for tcpdump and provide the command and accompanying options required to read the file named /tmp/tcpdump.dmp, suppress name resolution(avoid DNS lookups), and print each packet in both hex and ASCII.
6) Write a single command line that defines the variables N=444, M=555, O as the product (multiple) of N and M, and then echoes the value of O.
7) Write a single command line that uses netstat and grep to count all connections in a state of “ESTABLISHED” and outputs a single number representing how many connections are currently open to the server.
8) Write a short, interactive shell script that
a. Asks the user for a numeric variable A
b. Asks the user for a numeric variable B
c. Echoes the text “A minus B equals:”
d. Prints the value of a variable C which is A minus B
9) Write a short, interactive shell script that:
a. Asks the user to enter an IP address
b. Performs a host lookup on the IP address and returns a name if available.
Note: I will test this using 72.14.204.104
10) Write a short, interactive shell script that
a. Asks the user to enter a host name (like www.google.com)
b. Performs a traceroute on the host and then outputs a single line stating “The host %HOSTNAME is ____ Hops Away” where the ____ is the number of hops. (I will test this using www.google.com)
Explanation / Answer
1)
a. HOME
The system shall initialize this variable at the time of login to be a pathname of the user's home directory of the respective user which is defined in/etc/password.
b. $PATH
$PATH variable is specified as a list of one or more directory names separated by colon (:) characters.
PATH is an environment variable that contains an ordered list of directories that will be searched when a non-builtin command is requested
The /bin, /usr/bin, and /usr/local/bin directories are typically included in most users' $PATH setting
c. TERM:
A Term specifies the type of computer terminal or terminal emulator being used .
d. A shell variable is a special variable that is set by the shell and is required by the shell in order to function correctly. Some of these variables are environment variables whereas others are local variables.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.