Help with LINUX!! Exercise 1: Enter the following: $whereis ls Write down the an
ID: 3690946 • Letter: H
Question
Help with LINUX!!
Exercise 1:
Enter the following:
$whereis ls
Write down the answer
Exercise 2:
Check the PATH value by entering the following command:
$echo $PATH
Write down the output
Exercise 3:
Enter the following:
$cd ~ (Note: ~ symbol means your home directory)
$which whereis
Write down the output
Exercise 4:
Enter the set of commands below:
$PATH=~/bin:$PATH
$which whereis
Write down the output.
Exercise 5:
Explain the difference in the output from the three whereis commands (from exercises 2 to 4).
Exercise 6:
Check the PATH value again:
$echo $PATH
Is the output the same as in exercise 1? Explain why.
Exercise 7:
Create a file on your home directory called testingfind.txt Enter the following:
$find /space1 -name testingfind.txt –print
Write the output and explain
Exercise 8:
Enter the following:
$find /etc -name s* -print
Understand the output, and write down the output.
Exercise 9:
Write the find command to locate a file called protocols anywhere on your machine.
Exercise 10:
Enter the following command:
3 $grep www /etc/mail
Write down the output and explain the information provided.
Exercise 11:
Create a file called “data”, which contains some text content and numerical value content. Then write two grep commands to find and print all the lines in this “data” file that contain at least one non-alphabetic character: grep '[^A-Za-z]' data
What command would you use to find all the lines that do not contain even a single alphabetic character?
Explanation / Answer
Help with LINUX!!
Exercise 1:
Enter the following:
$whereis ls
Write down the answer (This is the location where the ls binary is located.)
/bin/ls
Exercise 2:
Check the PATH value by entering the following command:
$echo $PATH
Write down the output (This is where the environment variable $PATH is pointing to.
/Users/AnandaKumarThummapudi/.rvm/gems/ruby-2.1.1/bin:/Users/AnandaKumarThummapudi/.rvm/gems/ruby-2.1.1@global/bin:/Users/AnandaKumarThummapudi/.rvm/rubies/ruby-2.1.1/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/lib/postgresql83/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/MacGPG2/bin:/usr/texbin:
Exercise 3:
Enter the following:
$cd ~ (Note: ~ symbol means your home directory)
$which whereis
Write down the output (This is the location where the whereis binary is located, within the PATH.)
/usr/bin/whereis
Exercise 4:
Enter the set of commands below:
$PATH=~/bin:$PATH (This will add /bin to the $PATH variable.)
$which whereis (This is the location where the whereis binary is located, within the PATH.)
Write down the output.
/usr/bin/whereis
Exercise 5:
Explain the difference in the output from the three whereis commands (from exercises 2 to 4).
In Exercise 2, the $PATH value is being showed, whereas, in Exercise 3, we're locating the
whereis withn $PATH. And in Exercise 4, you're adding the ~/bin to the $PATH variable.
And now, tries to locate the whereis with the new $PATH.
Exercise 6:
Check the PATH value again:
$echo $PATH
Is the output the same as in exercise 1? Explain why.
No, the output is not the same as that in 1, this is because, we are appending something
to the existing value of $PATH in instruction 4.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.