Networking commands in shell scripting are essential for system administrators and developers. This set of 30 MCQs covers using tools like curl, wget, automating SSH commands, and network diagnostics.
curl command in shell scripting?curl to download a file?curl -o filename.txtcurl --output filename.txtcurl -d filename.txtwget command?curl to send a GET request to a server?curl -X GET http://example.comcurl --get http://example.comcurl http://example.comcurl -g http://example.comwget?wget http://example.com/filewget -d http://example.com/filewget download http://example.com/filewget --get http://example.com/filecurl is used to follow redirects automatically?-L-R-F-Dwget?wget -o newfile.txt http://example.com/filewget -O newfile.txt http://example.com/filewget -rename newfile.txt http://example.com/filewget --save newfile.txt http://example.com/filecurl use to interact with a web server over HTTPS?curl -X HTTPScurl -u https://curl --ssl https://curl --insecure https://wget -r command do?curl command for testing a URL?curl -I http://example.comcurl -v http://example.comcurl http://example.comssh command in shell scripting?password: false in the SSH configscpftpsshrsyncssh to run a command on a remote server?ssh user@host "command"ssh -run user@hostssh user@host commandssh -exec command user@hostscp command stand for?scp command for copying a file to a remote server?scp file.txt user@host:/pathscp file.txt /path user@hostscp file.txt -user@hostscp -r file.txt user@host:/pathscp?scp -r directory user@host:/pathscp directory user@host:/pathscp -d directory user@host:/pathscp -x directory user@host:/pathssh-keygenssh-authssh-keysssh-create-keyPasswordAuthentication no in sshd_configDisablePassword yes in ssh_configdisable-ssh-passwords-no-password option with sshssh?ssh user@host "bash script.sh"ssh user@host script.shssh user@host -script script.shssh user@host -f script.shpingtracenetstatcurlping command do in shell scripting?ping to specify the number of packets to send?-n-c-p-tnetstat command display?netstat option displays the network routing table?-r-t-n-atraceroutepingtracepathroutetraceroute command do?traceroute will display when used without options?netstat?netstat -inetstat -pnetstat -tnetstat -rping options prevents the command from resolving hostnames?-n-t-r-c| Qno | Answer |
|---|---|
| 1 | b) Sending HTTP requests to a server |
| 2 | d) Both a and b |
| 3 | b) To transfer files from a remote server |
| 4 | c) curl http://example.com |
| 5 | a) wget http://example.com/file |
| 6 | a) -L |
| 7 | b) wget -O newfile.txt http://example.com/file |
| 8 | c) curl –ssl https:// |
| 9 | a) Downloads files recursively from a server |
| 10 | d) All of the above |
| 11 | c) To connect to a remote server over a secure connection |
| 12 | b) Set up SSH key-based authentication |
| 13 | a) scp |
| 14 | a) ssh user@host “command” |
| 15 | b) Secure Copy Protocol |
| 16 | a) scp file.txt user@host:/path |
| 17 | a) scp -r directory user@host:/path |
| 18 | a) ssh-keygen |
| 19 | a) Set PasswordAuthentication no in sshd_config |
| 20 | a) ssh user@host “bash script.sh” |
| 21 | a) ping |
| 22 | c) Sends ICMP Echo requests to a host |
| 23 | b) -c |
| 24 | b) Active network connections |
| 25 | a) -r |
| 26 | a) traceroute |
| 27 | c) Shows the route packets take to a destination |
| 28 | b) 30 |
| 29 | a) netstat -i |
| 30 | a) -n |