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 scripting used for?

0 Answers  


How do I run a shell script in powershell?

0 Answers  


Write a shell script to check whether a number is Armstrong number or not?

1 Answers   Flipkart,


What is bash command used for?

0 Answers  


how to read systems current date and time

4 Answers  






I want to connect to a remote server and execute some commands, how can I achieve this?

0 Answers  


what is this line in the shell script do ?#!/bin/ksh

5 Answers  


What is awk in shell scripting?

0 Answers  


How will you print the login names of all users on a system?

0 Answers  


What is a command line shell?

0 Answers  


What are the disadvantages of shell scripting?

0 Answers  


There is a record with fields namely name,roll no.,salary,grade etc.Now,write a script to create a file with multiple records have same combination of fields but with unique roll numbers.The script should work for different names in the input file.

1 Answers   Wipro,


Categories