Question
log onto the host sp-cfsics.metrostate.edu , then try the content discussed below. Please create a directory lab3 (see lab2 page 3 for how to) and
log onto the host sp-cfsics.metrostate.edu, then try the content discussed below. Please create a directory lab3 (see lab2 page 3 for how to) and do the following exercises.
- The “pico” screen editor was originally designed for the users to edit messages within an email program called “pine”. With the respect to “pine”, “pico” stands for “pine composer”.
- “pico” also means “small”. For instance, one trillion picoseconds make one second.
- “pico” has a limited number of commands and rules.
- “pico” can be used separately from “pine”. In other words, “pico” can be used by itself.
- “pico” was adapted from a version of “emacs” called “micro emacs”.
- “emacs” is a screen editor itself but it is more complicated and bigger than “pico”.
- Examples:
Format 1: invoke pico with a file name
$ cd
$ mkdir lab3
$ cd lab3
$ pico test2
this is a test.
^x
y
$
Note: ^x means CTRL-x, and y and are responses to the screen prompts, not part of the file.
$ cat test2
this is a test.
$
Format 2: invoke pico without a file name
$ pico
this is a second test.
^x
test3
$
Note: ^x means CTRL-x, and test3 and s are responses to the screen prompts, not part of the file.
$ cat test3
this is a second test.
$
- The basic commands of pico are provided in the following table.
Command | Function |
Delete a single character backward | |
The same as key | |
^K | Delete the current line or marked text |
^R | Read in a file |
^T | Spell checker |
^U | Undelete last text deleted by ^K |
^X | Save a file to the disk |
- Using pico to edit your homepage file "index.html". Your homepage folder is ~/public_html
$ cd ~/public_html
$ pico index.html
Since the file “index.html” exists, you are going to see the following information on your screen:
Welcome to Metropolitan State University
Please update the file according to the following information (html documents are not case-sensitive):
CFS 264 Computer and Operating Systems Fundamentals II
This web site is still under the construction. Please send your comments to
.
Here are my five favorite links for learning Operating Systems:
Operating Systems: Three Easy Pieces by Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau
To check on your homepage, follow the instructions below:
- Invoke either MS Internet Explorer or any other web browser
- Check on the following URL:
http://sp-cfsics.metrostate.edu/~cfs264su20xx
- If the web page does not work properly, please modify it accordingly. Otherwise, please print out the page and hand it in before you leave.
- Learn how to run a Java, C or C++ program on Linux
- At the prompt “$”, please do the following:
$ cd ~/lab3
Java:
- Please create the following file using pico with a file name as "Greeting.java".
public class Greeting
{
public static void main(String[] args)
{
System.out.println("Hello, CFS 264 Class!");
}
}
- After you create the file above, at the prompt “$”, please follow the steps below:
$ javac Greeting.java
$ java Greeting
Hello, CFS 264 Class!
$
Notes:
- If you see some syntax errors, you should use “pico” to correct them accordingly and then rerun the programs as shown above
- A concise pico tutorial can be found at: https://www.ssc.wisc.edu/sscc/pubs/7-15.pdf
C
- Please create the following file with a file name as "myfirst.c".
#include
int main ()
{
printf("Hello, Metropolitan State University!");
}
- After you create the file above, at the prompt “$”, please do the following:
$ gcc myfirst.c
$ ./a.out
Hello, Metropolitan State University!
$
$ gcc -o myfirst myfirst.c
$ ./myfirst
Hello, Metropolitan State University!
$
C++
- Please create the following file with a file name as "firstcpp.cc".
#include
int main()
{
std::cout << "Hello, Metro State Students!" << std::endl;
return 0;
}
- After you create the file above, at the prompt “$”, please do the following:
$ g++ firstcpp.cc
- If there is warning message regarding deprecated header, just ignore it and continue to the next step:
$ ./a.out
Hello, Metro State Students!
$
$ g++ -o firstcpp firstcpp.cc
- If there is warning message regarding deprecated header, just ignore it and continue to the next step:
$ ./firstcpp
Hello, Metro State Students!
Note: Please complete Lab 3 before answering the following questions:
- Please provide a single “find” command that displays all the files, excluding directories, that have been changed in the last 7 days under your home directory:
- Please provide a single “grep” command that counts how many lines in file /etc/hosts that contains “199”:
- Please provide a single “uniq” command that compares the first 3 characters of lines in file /etc/hosts and then displays the number of occurrences of lines in the file:
- Please provide a single “grep” command that displays all the lines in all the files, under your home directory, that contain a word “Metropolitan”:
- Please provide a single “find” command that searches your home directory and all its subdirectories for the files with an extension “.class” and delete them with confirmations:
After you complete, please copy and paste everything (you commands, the outputs, the content of files, and etc.) into one file. If a screen shot is necessary, please include it in this file too.
Step by Step Solution
3.41 Rating (157 Votes )
There are 3 Steps involved in it
Step: 1
Answer Following the steps introduced in Lab1 to log onto the host spcfsicsmetrostateedu then try the content discussed below Please create a directory lab3 see lab2 page 3 for how to and do the follo...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started