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

I have 2 files and I want to print the records which are common to both.

0 Answers  


Write down the syntax for all the loops in shell scripting.

0 Answers  


What is use of "cut" command?

3 Answers  


How do you find out What is your shell?

0 Answers  


What is bash used for?

0 Answers  






How will you list only the empty lines in a file (using grep)?

4 Answers   ANZ,


What is egrep?

2 Answers  


What is a command line shell?

0 Answers  


How to enable the shell to know what program should be run to interpret the script?

3 Answers  


What are the different types of variables used in shell script?

0 Answers  


What are different types of shell?

0 Answers  


What does $@ mean bash?

0 Answers  


Categories