Question

Part 3. Self Test 3 from the textbook 1) When you enter following command, what happens and why? S catdog 2) What results fro
0 0
Add a comment Improve this question Transcribed image text
Answer #1
1) cat > dog
When you enter this command it will create a file with name dog in current working directory. Also it allow us to write to the file.

2)
A)who | grep $USER
===================
who => displays who is logged in
grep => is pattern searcher
The computer outputs who you are, when you logged on and where you logged on from.

B)grep \$HOME file1
===================
 If there is no "file1" on your computer it tells you that grep: file1: no such file or directory.


C) echo u*>>file1
=================
This will create a file named file1 in current directory and write uan to it. If file exists then it will append uan to it.

D) echo 'u*'>>file1
==================
This will create a file named file1 in current directory and write u* to it. If file exists then it will append u* to it.

E) ps
=====
it will display current running process status in our system

F) . fileA
==========
Computer will try to execute the .fileA

G) set noclobber
===============
If you are in the csh or tcsh shells it tells the computer to not allow files to be overwritten, but if you are in ksh or bash shells it does nothing. The correct command for ksh or bash shells would be set -o noclobber.

H) Set -o
-=========
This tells you which functions are on or off.

I)chmod +x file2
================
It will make file2 as executable.


3.) How can we change the prompt to be Next? in both families of shells(C shells and Korn shells)?
In C shells(csh and tcsh) type in set prompt='Next?'. In Korn shells(sh, bash, and ksh) type PS1='Next?'.

4) What data is passed in each filed in passwd file?
Username:password:UserID:Group ID (GID):User ID Info:Home directory:Command/shell

5)What command instructs the shell not to accept CTRL-D as a signal to log off?
In the csh or tcsh shells use set ignoreeof, and in the ksh or bash shells use set-o ignoree of.
Add a comment
Know the answer?
Add Answer to:
Part 3. Self Test 3 from the textbook 1) When you enter following command, what happens...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Login to Suse Linux as root. Complete the task working as the root user. 1. What...

    Login to Suse Linux as root. Complete the task working as the root user. 1. What is your current directory. What did you enter at the command prompt to determine your current working directory? 2. Change directories if needed to find your foods (or food) file. Use vi to make the file contain 10 food items. Save your file and quit. Use the cat command, and option, and the argument food to display the food file with numbered lines. Use...

  • What are the exact commands I should use to complete the task? 1. Run command (date;...

    What are the exact commands I should use to complete the task? 1. Run command (date; sleep 45; echo “Done.”; date) > date.out in the foreground (i.e. without &) 2. Suspend it with Ctrl-Z. Pay attention to the number in the [], it will become handy later. This number is the job number of the command that has been suspended. 3. Run command top to display only processes started by you (i.e. associated with your userid). Write down the process...

  • I have the following code....from the previous lab....the above needs to be added to what is...

    I have the following code....from the previous lab....the above needs to be added to what is already existing. ALSO MODIFY SEMAPHORES TO USE pthreads instead of the pipe constructs P() & V() #include <stdio.h> #include <string.h> #include <sys/types.h> #include <unistd.h> #include <sys/wait.h> #include <stdlib.h> #include <sys/stat.h> void printStat(char *filename); //Main int main(int argc, char *argv[]) { //Process Id (storing)    pid_t pid;    int j;    //printf("Welcome to Project Three\n”);    // For loop*/    for (j = 1; j...

  • Need three seperate files. ShoppingCartManager.java ShoppingCart.java ItemsToPurchase.java These are from part 1 what do you mean...

    Need three seperate files. ShoppingCartManager.java ShoppingCart.java ItemsToPurchase.java These are from part 1 what do you mean by deep study 7.25 LAB*: Program: Online shopping cart (Part 2) Note: Creating multiple Scanner objects for the same input stream yields unexpected behavior. Thus, good practice is to use a single Scanner object for reading input from System.in. That Scanner object can be passed as an argument to any methods that read input This program extends the earlier Online shopping cart program (Consider...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT