02-11-2016
1,
0
Join Date: Feb 2016
Last Activity: 8 March 2016, 7:17 AM EST
Location: Sweden
Posts: 1
Thanks Given: 0
Thanked 0 Times in 0 Posts
Quiz help!
Hello, I'm new to Unix and need help answering these questions if possible, thanks.
---------------------------------------------------------------------------------------
In a shell script, which command could be place at the end of a command line to combine stderr and stdout into the stdout stream for further manipulation?
2>>1&
2>&1
&1>2
None of the above
-------------------------------------------------------------------------------------
What is the correct syntax to copy the file /home/newton/scripts/logger.ksh to the directory /testing/scripts/
assuming you are currently in neither of these directories?
cp /home/newton/scripts/logger.ksh /testing/scripts
cp /home/scripts/logger.ksh /testing/scripts/logger.ksh
mv /home/newton/scripts/logger.ksh /testing/scripts
mv home/newton/scripts/logger.ksh /testing/scripts
--------------------------------------------------------------------------------------
Run the following UNIX command:
echo "x">a; echo "y">>a; tail -1 a
Choose the correct output from the answers below
1. x
2. y
3. x
y
4. xy
---------------------------------------------------------------------------------------
Run the following UNIX command:
echo "x">a; echo "y">>a; sort -r a
Choose the correct output from the answers below
1. x
2. y
3. x
y
4. xy
---------------------------------------------------------------------------------------
Which unix shell command displays the contents of the abc.txt file to standard output interactively (stopping after each page of output)?
abc.txt
cat abc.txt
edit abc.txt
more abc.txt
---------------------------------------------------------------------------------------
Which shell command sequence can be used to transfer files to a remote server from the local directory?
1) ftp
2) mv
3) put
4) wget
---------------------------------------------------------------------------------------
a1
b1
c1
Which of the following UNIX shell command sequences produces the output "c1" (list all the apply):
a) grep "1" abc.txt
b) grep "c" abc.txt
c) grep "c1" abc.txt
d) cat abc.txt | grep "c2"
e) cat abc.txt > grep "c"
1. b) grep "c" abc.txt
c) grep "c1" abc.txt
d) cat abc.txt | grep "c2"
2. a) grep "1" abc.txt
c) grep "c1" abc.txt
d) cat abc.txt | grep "c2"
3. b) grep "c" abc.txt
c) grep "c1" abc.txt
e) cat abc.txt > grep "c"
4. c) grep "c1" abc.txt
d) cat abc.txt | grep "c2"
---------------------------------------------------------------------------------------
Which UNIX shell command displays the lines of the abc.txt file that match the string XYZ?
1) find XYZ abc.txt
2) find -XYZ abc.txt
3) grep -XYZ abc.txt
4) grep XYZ abc.txt
---------------------------------------------------------------------------------------
a1
b1
c1
Which of the following UNIX shell command sequences produces the output "c1" (list all the apply):
a) grep "1" abc.txt
b) grep "c" abc.txt
c) grep "c1" abc.txt
d) cat abc.txt | grep "c"
e) cat abc.txt > grep "c"
1. b) grep "c" abc.txt
c) grep "c1" abc.txt
d) cat abc.txt | grep "c"
2. a) grep "1" abc.txt
c) grep "c1" abc.txt
d) cat abc.txt | grep "c"
3. b) grep "c" abc.txt
c) grep "c1" abc.txt
e) cat abc.txt > grep "c"
4. c) grep "c1" abc.txt
d) cat abc.txt | grep "c"
---------------------------------------------------------------------------------------