|
INTERVIEW QUESTIONS
OPERATING SYSTEMS
SHELL SCRIPTING
DETAILS
Question: How do you test for file properties in shell scripts?
Answer: - -s filename tells you if the file is not empty, -f filename tells you whether the argument is a file, and not a directory, -d filename tests if the argument is a directory, and not a file, -w filename tests for writeability, -r filename tests for readability, -x filename tests for executability
|
|
|
Category |
Shell Scripting Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 6525 users |
Added on |
8/27/2014 |
Views |
69163 |
Rate it! |
|
|
Question:
How do you test for file properties in shell scripts?
Answer:
- -s filename tells you if the file is not empty, -f filename tells you whether the argument is a file, and not a directory, -d filename tests if the argument is a directory, and not a file, -w filename tests for writeability, -r filename tests for readability, -x filename tests for executability Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
How do you do number comparison in shell scripts?
|
View Answer
|
|
What’s the conditional statement in shell scripting? -
|
View Answer
|
|
How do you refer to the arguments passed to a shell script?
|
View Answer
|
|
How do you fire a process in the background? -
|
View Answer
|
|
How do you stop all the processes, except the shell window?
|
View Answer
|
|
How do you find out about all running processes?
|
View Answer
|
|
How do you stop a process?
|
View Answer
|
|
How do you list currently running process?
|
View Answer
|
|
What are PIDs?
|
View Answer
|
|
How do you search for a string in a directory with the subdirectories recursed?
|
View Answer
|
|
How do you search for a string inside a directory? -
|
View Answer
|
|
How do you search for a string inside a given file?
|
View Answer
|
|
How do you count words, lines and characters in a file?
|
View Answer
|
|
How do you send a mail message to somebody? -
|
View Answer
|
|
How do you send a mail message to somebody?
|
View Answer
|
|
How do you find out your own username?
|
View Answer
|
|
How do you remove a file?
|
View Answer
|
|
How do you remove a file?
|
View Answer
|
|
How do you find out the current directory you’re in?
|
View Answer
|
|
What’s the command to find out users on the system?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All Shell Scripting Interview Questions & Answers - Exam Mode /
Learning Mode
|