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

how to print the 2-d, 3-d arrays in unix shell script programs please answer thi questio to my mail venusaikumar@gmail.com

0 Answers  


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

3 Answers  


what is tickets $ what low,medium,high priorite pls define time also

0 Answers  


How to print some text on to the screen?

2 Answers  


What are script files?

0 Answers  






What are the default permissions of a file when it is created?

0 Answers  


I want to read all input to the command from file1 direct all output to file2 and error to file 3, how can I achieve this?

1 Answers  


What is scripting used for?

0 Answers  


I want to create a directory such that anyone in the group can create a file and access any person's file in it but none should be able to delete a file other than the one created by himself.

0 Answers  


how to read systems current date and time

4 Answers  


What is the syntax of "expr" command?

2 Answers  


What is a batch file used for?

0 Answers  


Categories