















































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A practical exam covering Linux basics, Git fundamentals, and open-source contribution workflows. Includes tasks like forking repositories, submitting pull requests, resolving merge conflicts, rebasing, using advanced Git commands, interacting with Linux environments, compiling software from source, and collaborating using open-source conventions such as maintainers’ guides and developer mailing lists.
Typology: Exams
1 / 87
This page cannot be seen from the preview
Don't miss anything!
















































































Question 1. Which of the following best defines “open source software”? A) Software whose source code is freely available and may be modified and redistributed under an open license. B) Software that is free of cost but its source code is proprietary. C) Software that is only available to government agencies. D) Software that cannot be altered under any circumstances. Answer: A Explanation: Open source software is characterized by publicly available source code and a license that permits modification and redistribution. Question 2. The first version of the Open Source Definition was created by which organization? A) Linux Foundation B) Apache Software Foundation C) Open Source Initiative (OSI) D) Free Software Foundation (FSF) Answer: C Explanation: The OSI published the Open Source Definition in 1998 to formalize criteria for open source licenses. Question 3. Which of the following is NOT a typical advantage of using open source software? A) Faster security patches due to community scrutiny. B) Vendor lock‑in for proprietary extensions. C) Ability to customize code to fit specific needs. D) Lower total cost of ownership.
Answer: B Explanation: Vendor lock‑in is a disadvantage of proprietary software, not open source. Question 4. Which project is an example of a successful open source operating system? A) Microsoft Windows B) macOS C) Linux kernel D) iOS Answer: C Explanation: The Linux kernel is a widely used open source OS kernel. Question 5. Which platform is primarily used for hosting Git repositories and facilitating collaborative development? A) Bitbucket Server (self‑hosted only) B) GitHub C) SourceForge (only for CVS) D) Google Docs Answer: B Explanation: GitHub provides Git hosting, pull requests, issue tracking, and CI integration. Question 6. In an open source community, which practice helps maintain a welcoming environment for newcomers? A) Enforcing strict code style without explanation. B) Providing a clear CONTRIBUTING.md file and mentorship. C) Ignoring all pull requests.
Answer: B Explanation: A code of conduct defines behavioral expectations and fosters a respectful community. Question 10. Continuous Integration (CI) primarily aims to: A) Deploy code directly to production without testing. B) Automatically build and test code changes on each commit. C) Replace version control systems. D) Generate documentation only. Answer: B Explanation: CI automates building and testing to detect integration issues early. Question 11. Which governance model gives all contributors equal decision‑making power? A) Benevolent Dictator for Life (BDFL) B) Meritocratic governance (e.g., Apache “The Apache Way”) C) Corporate sponsorship only D) Closed‑source governance Answer: B Explanation: Meritocratic models base decisions on contributors’ merit and consensus. Question 12. A common reason why open source projects fail is: A) Too many contributors. B) Lack of clear maintainership and direction. C) Excessive documentation.
D. Use of permissive licenses. Answer: B Explanation: Without active maintainers, projects stagnate and may become abandoned. Question 13. Which component is NOT part of the Linux operating system architecture? A) Kernel B) Shell C) BIOS D) System libraries Answer: C Explanation: BIOS is firmware that boots the system, not part of the Linux OS itself. Question 14. The default graphical desktop environment for many Ubuntu releases is: A) KDE Plasma B) GNOME C) Xfce D) LXDE Answer: B Explanation: Ubuntu switched to GNOME as its default desktop environment in 2017. Question 15. Which command displays the manual page for the grep utility? A) info grep B) man grep C) help grep D) grep --manual
Explanation: Bash (Bourne Again SHell) is the default interactive shell. Question 19. The grep - i "error" logfile command: A) Searches case‑sensitively for “error”. B) Searches case‑insensitively for “error”. C) Replaces “error” with an empty string. D) Counts the number of lines containing “error”. Answer: B Explanation: -i makes the pattern match case‑insensitively. Question 20. Which option with ls displays hidden files? A) - l B) - a C) - h D) - R Answer: B Explanation: -a shows all files, including those beginning with a dot. Question 21. In Bash, what does the construct $(command) do? A) Executes command in the background. B) Substitutes the output of command into the surrounding command line. C) Declares a variable named command. D) Runs command with elevated privileges. Answer: B Explanation: Command substitution replaces the construct with the command’s stdout.
Question 22. Which of the following is a valid shebang line for a Bash script? A) #!/usr/bin/env bash B) #!/bin/sh – bash C) #!/usr/local/bin/python D) #!/bin/awk Answer: A Explanation: #!/usr/bin/env bash finds Bash via the environment and is portable. Question 23. What does the find /var - name "*.log" command do? A) Lists all files ending with .log in the current directory. B) Searches recursively under /var for files whose name ends with .log. C) Deletes all .log files under /var. D) Moves all .log files to the home directory. Answer: B Explanation: find searches the directory tree for matching file names. Question 24. Which file defines system‑wide environment variables for all users on a Debian‑based system? A) ~/.bashrc B) /etc/profile C) /etc/environment D) /etc/bash.bashrc Answer: C Explanation: /etc/environment is used for setting global environment variables.
Explanation: chown changes ownership; the syntax owner:group sets both. Question 28. Which of the following files stores the password hashes for local user accounts? A) /etc/passwd B) /etc/shadow C) /etc/group D) /etc/login.defs Answer: B Explanation: /etc/shadow holds encrypted password hashes, while /etc/passwd stores user info. Question 29. The systemctl start httpd command does what on a system using systemd? A) Enables the httpd service at boot. B) Starts the httpd service immediately. C) Restarts the httpd service. D) Stops the httpd service. Answer: B Explanation: systemctl start launches the specified unit right now. Question 30. Which command shows active network interfaces and their IP addresses? A) ipconfig B) ifconfig - a C) ip address show D) netstat - i
Answer: C Explanation: ip address show (or ip a) displays interfaces and IP configurations on modern Linux. Question 31. The free - h command reports: A) Disk usage in human‑readable format. B) Memory usage (RAM and swap) in human‑readable format. C) CPU load averages. D) Number of open file descriptors. Answer: B Explanation: free displays memory statistics; -h makes it human‑readable. Question 32. Which tool is commonly used to compile C programs from source code? A) make B) gcc C) ld D) gdb Answer: B Explanation: gcc (GNU Compiler Collection) compiles C source files into object code. Question 33. In a typical Makefile, what does the target all: usually represent? A) Clean up compiled objects. B) Build all default executables. C) Install the software. D) Run unit tests.
Answer: B Explanation: Git stores complete history locally and enables distributed collaboration. Question 37. After installing Git, which command sets your global email address? A) git config --global user.email "[email protected]" B) git set email "[email protected]" C) git init --email "[email protected]" D) git user.email "[email protected]" Answer: A Explanation: git config --global user.email defines the email for commits. Question 38. Which command creates a new empty Git repository in the current directory? A) git init B) git clone. C) git new repo D) git create. Answer: A Explanation: git init initializes a new repository. Question 39. In Git terminology, what is the “staging area”? A) The remote server where code is stored. B) The area where changes are prepared before committing. C) The working directory where files are edited. D) The log of previous commits. Answer: B
Explanation: The staging area (index) holds snapshots of changes to be committed. Question 40. Which command records the changes in the staging area as a new commit? A) git add. B) git commit - m "msg" C) git push origin master D) git merge feature Answer: B Explanation: git commit creates a new commit from the staged changes. Question 41. How can you view the commit history of the current branch in a compact, one‑line format? A) git log --oneline B) git diff --summary C) git status - s D) git reflog --short Answer: A Explanation: git log --oneline prints each commit on one line. Question 42. Which command shows the differences between the working directory and the index? A) git diff --staged B) git diff C) git log - p D) git status --short
D) git pull origin feature Answer: B Explanation: By default git merge performs a fast‑forward when the history permits. Question 46. Which Git command uploads local commits to a remote repository named origin on the main branch? A) git push origin main B) git pull origin main C) git fetch origin main D) git clone origin main Answer: A Explanation: git push sends local commits to the specified remote and branch. Question 47. To obtain a copy of a remote repository located at https://github.com/user/repo.git, you would run: A) git fork https://github.com/user/repo.git B) git clone https://github.com/user/repo.git C) git pull https://github.com/user/repo.git D) git init https://github.com/user/repo.git Answer: B Explanation: git clone creates a local clone of the remote repository. Question 48. Which command applies a patch file named fix.patch to the current working tree? A) git apply fix.patch B) git patch fix.patch
C) git commit - p fix.patch D) git merge fix.patch Answer: A Explanation: git apply reads a patch and applies its changes. Question 49. In a Gerrit code‑review workflow, after pushing a change for review, which command is typically used to fetch the latest approved revision? A) git fetch origin refs/heads/master B) git pull --rebase origin refs/heads/master C) git fetch origin refs/changes/* && git checkout FETCH_HEAD D) git merge origin/refs/heads/master Answer: C Explanation: Gerrit stores changes under refs/changes/; fetching that ref retrieves the review. Question 50. Which of the following is a valid reason to choose a permissive license over a copyleft license for a library? A) To ensure all downstream projects also open source their code. B) To allow commercial entities to use the library without releasing source. C) To prevent any modifications of the library. D) To require attribution only for binary distribution. Answer: B Explanation: Permissive licenses impose few restrictions, permitting proprietary use. Question 51. Which command lists all remote repositories configured for the local Git repository? A) git remote - v
A) head - n 10 /var/log/syslog B) tail - n 10 /var/log/syslog C) less /var/log/syslog | 10 D) cat /var/log/syslog | head Answer: A Explanation: head - n 10 prints the first ten lines. Question 55. To recursively change permissions of all files in /opt/app to 644 while leaving directories at 755, which command sequence is appropriate? A) chmod - R 644 /opt/app B) find /opt/app - type f - exec chmod 644 {} + && find /opt/app - type d - exec chmod 755 {} + C) chmod 644 /opt/app/* && chmod 755 /opt/app/*/ D) setfacl - R u::rw,g::r,o::r /opt/app Answer: B Explanation: Using find with -type f and -type d applies distinct permissions. Question 56. Which command shows the current runlevel on a SysV init system? A) runlevel B) systemctl get-default C) whoami D) uname - r Answer: A Explanation: runlevel prints the previous and current runlevels.
Question 57. Which of the following files stores the list of services that start automatically in a system using systemd? A) /etc/rc.local B) /etc/init.d/ C) /etc/systemd/system/*.target.wants/ D) /etc/inittab Answer: C Explanation: .target.wants directories contain symlinks to unit files enabled at boot. Question 58. To display the amount of free disk space on all mounted filesystems in a human‑readable format, you would use: A) df - h B) du - h / C) lsblk - f D) mount - v Answer: A Explanation: df - h reports filesystem disk space usage. Question 59. Which command is used to add a new user called devuser and create a home directory for them? A) useradd devuser B) adduser devuser --create-home C) useradd - m devuser D) mkuser - d devuser Answer: C Explanation: -m (or --create-home) instructs useradd to make a home directory.