Professional Documents
Culture Documents
-i(interactive): i stands for Interactive copying. With this option system first
warns the user before overwriting the destination file.
3. If [ -d $filename ] is to test the directories what is used to test the executable file
Ans : -x
4. What is the use of -n option in echo
Ans : New Line Mate
5. Which command is used to record the whole session
Ans : script
Ans : Who
9. Which command (with option) is used to count the number of characters in a given
file
Ans : wc -c filename
11. Can the command cut –d used without -f option and why they are used
Ans : no
-d for delimeter and –f field (je field dis karvi hoy)
Cat filename | cut –d “:” –f2 (second line mate)
The first argument is read by the shell into the parameter ___
Ans: $1
36. The complete set of positional parameters is stored in ______ as a single string.
Ans: $*
37. Use of Who command
Ans: to get information of
1. Time of last system boot
2. Current run level of the system
3. List of logged in users and more.
38. How to Show the present working directory.
Ans: pwd
39. How to display Day of month
Ans: date +%d
40. How to View Contents of Multiple Files in terminal
Ans: # cat test test1
41. How to use man command
Ans: The basic usage of man is very simple - just run the command with the name
of the tool whose reference manual you want to access. Ex: man ls
42. How to Sort file abc.txt and save this sorted file in xyz.txt
Ans: sort abc.txt > xyz.txt
43. How to display the login names that begin with ‘H’
Ans: who | grep ^H
44. Which command is used to display message in shell script? Ans: echo
45. How display the contents of the file text on the screen.
Ans: cat $FILE
46. Explain calendar command
Ans: cal command is a calendar command in Linux which is used to see the calendar of
a specific month or a whole year.
47. How to get value from user?
Ans: By using read command Ex: read <var_name> 48.
What is chmod in shell script?
Ans: It can change file system modes of files and directories
49. Use of ls Command
Ans: that lists directory contents of files and directories
50. Use of $date -u
Ans: It displays the time in GMT(Greenwich Mean Time) / UTC (Coordinated
Universal Time ) time zone.
51. Is there a way to erase all files in : rm -r
Ans :permission-rwx(read,write,execute)
Ans : globaly search for regular expression characters ni pettern search karva.
Cat stud.txt | grep –n “hetuki”(hetuki name kya number ni line par ch a batavse)
62. who | grep ^c will display the usernames starting with c or does not start with c