What is the use of "test" command?

Answers were Sorted based on User's Feedback



What is the use of "test" command?..

Answer / satchi

"Test" command checks file and directory types and checks
value.

EX: create a empty file test (touch test)

if test -f test
then
echo "File is nonempty"
else
echo "file is empty"
fi


There are different options like -d -b -e.You can explore
all.

Is This Answer Correct ?    2 Yes 0 No

What is the use of "test" command?..

Answer / manhar chavan

Simply test command is compare two values. it check whether
it is right or wrong.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Shell Script Interview Questions

What is a program shell?

0 Answers  


What does path stand for?

0 Answers  


Dear All, Can anybody tell me how to predefind no. of selected rows from a text file.

1 Answers   MGL,


What is console line?

0 Answers  


how to print the matrix form of 2-d, 3-d arrays in unix c shell scripts ?

0 Answers  


In shell scripting if text is surrounded by single quotes what does it denotes?

3 Answers  


What is the syntax of while loop in shell scripting?

0 Answers  


How would you compare the strings in a shell script?

0 Answers  


There are three departments A,B and C.Write a query to display the names of all the persons( in departments other than A) who are paid higher than the person receiving the lowest salary in DEPT A

1 Answers   Wipro,


What is bash command used for?

0 Answers  


Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.

0 Answers  


What is the default ubuntu terminal?

0 Answers  


Categories