What do you know about Unix programming and shell scripting? Try this shell script quiz that includes questions with answers on this topic. Shell scripting is an open-source computer program created to be run by the Unix/ Linux shell. The program devises a series of plans for the shell to execute. The typical operations performed by Shell Scripting include file manipulation, program execution, and printing text. If you choose to learn more about Unix programming and shell scripting, try this quiz.
Command > file
Command >> file
Command <> file
Command < file
Whereami
Place
Map
Pwd
Rm filename
Dl filename
Touch filename
Less filename
Ls ?3[rgi]*
Ls *[rgi]*
Ls [..i*]
Ls ??[rgi]*
Cd -
Cd /up
Cd ~
Cd ..
Pwd
I
Whoami
Me
Kill
Delete
Stop
Shutdown
Shows a calendar
Display of files and folders, present in the folder where you are
Opening a file
Display of the contents of a file
2> /dev/null
&> filename
1> filename
2> filename
Ls -a
Find -a
Find all
All
Grep “$^” filename.txt
Grep “$” filename.txt
Grep “^$” filename.txt
Grep $^ filename.txt
$0 would be the first line argument, $1 would be the Second command line argument, $2 the Third, and so on
$1 would be the first command line argument, $2 the second, and so on $0 is the name of the script or function
Both a and b are correct
Both a and b are incorrect
Csh : C shell
Ksh : Korn Shell
Bash : bourne again shell
Ssh : sea shell
$? will return exit status of command .0 if command gets successfully executed ,non-zero if command failed.
$? will return exit status of command .Non-0 if command gets successfully executed ,zero if command failed.
System error
Invalid command
Will return no of error
# will return the number of parameters that are passed as the command-line arguments.
Error
All the above are incorrect
Its mainly used for showing up all params. This show few parameter values passed in shell script.
Its mainly used for showing up all params. This show all values returned.
Its mainly used for showing up all params. This show all parameter values passed in shell script.
None of the above is correct.
Getenv() and putenv()
Getenv() and setenv()
Readenv and putenv()
Readenv() and setenv()
Chmod(myfile,0742).
Chmod(myfile,0474).
Chmod(myfile,0747).
Chmod(myfile,0744)
File access count
File owner identifier
File type
File access permissions
Ls command
Cat command
More command
Disp command
Whomami
Pwd
Echo $SHELL
$sh
True
False
Wait!
Here's an interesting quiz for you.