Question 2
0/1 point (graded)
What happens when you remove a directory using the command rm -r?
You cannot remove a directory using the rm command.
You permanently remove the entire directory, including all files and subdirectories.
You move the entire directory to a trash folder, but it can be restored later.
You get a warning message asking if you want to proceed, then you delete the directory. incorrect
Answer
Incorrect:
Try again. Unix does not warn you before permanently deleting files.
Question 3
0/1 point (graded)
By default, the head command in Unix displays the first 10 lines of a specified file. You can change the number of lines using an argument that indicates the numeric value of the desired number of lines.
Which of the following commands displays only the first 6 lines of a manual for the ls command?
man ls -6 | head
head | man ls -6 incorrect
head -6 | man ls
man ls | head -6
Answer
Incorrect:
Try again. Your pipe is reversed. You need to call the manual for ls, then look at the first 6 lines of it using the head function.
You have used 1 of 2 attempts
Question 7
0/1 point (graded)
What does the command echo $HOME do?
Moves into to the home directory.
Makes the current directory the home directory.
Prints the path to the home directory.
Prints “$HOME” to the screen. incorrect
Answer
Incorrect:
Try again. Echo prints something to the screen, but it interprets $HOME as a shortcut for something longer.
Question 8
0/1 point (graded)
Many systems operate using the Unix shell and command language, bash. Each time you start using bash, it executes the commands contained in a “dot” file. Your “dot” file may be called something like “.bash_profile” or “.bash_rc”.
Which command will let you see your “dot” files?
ls -a
ls bash* incorrect
head *bash*
ls -l
Answer
Incorrect:
Try again. This use of ls command will not let you see your dot files. Remember, files that begin in “.” are hidden in Unix.
Question 9
0/1 point (graded)
Your colleague was editing his “dot” files when something went wrong. He first noticed there was an issue when he tried to execute the following line of code:
ls
He received the following error:
-bash: ls: command not found
What could have happened to cause this error?
He is trying to execute ls which is a bash command, but his system isn’t running bash as a shell.
The command ls doesn’t exist. He should be using the command ll.
He forgot to specify a file name to be listed. The command ls * should work. incorrect
He changed the information contained in $PATH. Now the system cannot find the executable file for ls.
Answer
Incorrect:
Try again. The ls command does not require that a file name be provided. Provided the system knows where to find the file to execute the ls command, it will list every visible file in the current directory.
Question 10
0/1 point (graded)
The bash profile in your home directory contains information that the bash shell runs each time you use it. You can customize the information in your bash profile to tell your system to do different things. For example, you can make an “alias”, which acts like a keyboard shortcut.
Which line of code, when added to your bash profile, will let you print “seetop” to view the name, size, and file type of the 10 most recently added visible files?
alias seetop=’ls -lt’
alias seetop=’ls -lt | head’
alias seetop=’ls -t | head’ incorrect
alias seetop=’head | ls -l’
Answer
Incorrect:
Try again. You want to see the size and file type too. This command will only show the name.
Question 1
0/1 point (graded)
Why might you want to create a report using R Markdown?
R Markdown has better spell-checking tools than other word processors.
R Markdown allows you to automatically add figures to the final document.
R Markdown final reports have smaller file sizes than Word documents.
R Markdown documents look identical to the final report. incorrect
Answer
Incorrect:
Try again. The final report looks different than the working R Markdown document. For example, plots called in the R Markdown document do not show up until the final report is compiled.
You have used 1 of 2 attempts Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.
Incorrect (0/1 point)
Question 2
0/1 point (graded)
You have a vector of student heights called heights. You want to generate a histogram of these heights in a final report, but you don’t want the code to show up in the final report. You want to name the R chunk “histogram” so that you can easily find the chunk later.
Which of the following R chunks does everything you want it to do?
```{r, histogram, message=FALSE}
hist(heights)
```
incorrect
```{r histogram, warning=FALSE}
hist(heights)
```
```{r, echo=FALSE}
hist(heights)
```
```{r histogram, echo=FALSE}
hist(heights)
```
Answer
Incorrect:
Try again. message=FALSE and the similar warning=FALSE stop R from printing non-code text, but the code will still be echoed.
You have used 1 of 2 attempts Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.
Incorrect (0/1 point)
Question 5
0/1 point (graded)
```{r, echo=F}
n <- nrow(mtcars)
```
Here `r n` cars are compared
What will be the output for the above Rmarkdown file?
The only output is the text: Here 32 cars are compared.
Since we have echo=F, the code chunk is not evaluated, therefore we will have both the code and the text: Here `r n` cars are compared. incorrect
The code will be displayed as well as Here 32 cars are compared.
R cannot comprehend the value of n, we will get an error.
You have used 1 of 2 attempts Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.
Answer 2
*********
You permanently remove the entire directory, including all files
and subdirectories.
Answer 3
*********
man ls -6 | head
Answer 7
**********
Prints the path to the home directory.
Answer 8
*********
ls -a
Answer 9
*********
He changed the information contained in $PATH. Now the system
cannot find the executable file for ls.
We are allowed to do only 4 exercise out of any given.
if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , before giving thumbs down please discuss the question it may possible that we may understand the question different way and we can edit and change the answers if you argue, thanks :)
Question 2 0/1 point (graded) What happens when you remove a directory using the command rm...
Question 4 0/1 point (graded) Which of the following statements does NOT correctly describe the utility of a command in Unix? The q key exits the viewer when you use less to view a file. The command ls lists files in the current directory. The command mkdir makes a new directory and moves into it. The mv command can move a file and change the name of a file. incorrect Answer Incorrect: Try again. The mv command can move a...
QUESTION 1 What will be the output of following Unix command: find / -name ‘*’ A. List all files and directories recursively starting from / B. List a file names * in / C. List all files in / directory D. List all files and directories in / directory QUESTION 2 Which command is used to extract a column/field from a text file / input. A. paste B. get C. cut D. tar QUESTION 3 Which command creates an empty...
Question 11 1 point possible (graded) The commands in the pipeline $ cat result.txt | grep "Harvard edX" | tee file2.txt | wc -l perform which of the following actions? From result.txt, select lines containing “Harvard edX”, store them into file2.txt, and print all unique lines from result.txt. From result.txt, select lines containing “Harvard edX”, and store them into file2.txt. From result.txt, select lines containing “Harvard edX”, store them into file2.txt, and print the total number of lines which were...
Question 9 (1 point) Questions 6-10 is one hypothesis testing problem using an Excel data called vacation. We want to know if there is a difference between the average individual vacation budget of this year and that of last year. We collected two independent samples of 15 individuals' vacation from each year. We assume population variances are unequal. You already downloaded the data file in Question 6, so you do not have to open it again. Just run a correct...
Question 2 - Programming Exercise 1. Make a directory for this lab and change into it. 2. Copy files using the following command: cp/net/data/ftp/pub/class/115/ftp/cpp/Inheritance/Exercise.cpp Exercise.cpp Finish the program so that it compiles and runs. The instructions are contained in the C++ file. Your completed program should generate output similar to the following: TwoD default constructor This program asks for the coordinates of two points in 3D space and calculates their distance. Please enter the xyz coordinates for the first point:...
could you please help me with this problem, also I
need a little text so I can understand how you solved the
problem?
import java.io.File; import java.util.Scanner; /** *
This program lists the files in a directory specified by * the
user. The user is asked to type in a directory name. * If the name
entered by the user is not a directory, a * message is printed and
the program ends. */ public class DirectoryList { public static...
Assignment Overview In Part 1 of this assignment, you will write a main program and several classes to create and print a small database of baseball player data. The assignment has been split into two parts to encourage you to code your program in an incremental fashion, a technique that will be increasingly important as the semester goes on. Purpose This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of...