Which Linux command is used to permanently set an environment variable? MCQ with Answer and Explanation

Which Linux command is used to permanently set an environment variable?
A. export in .bashrc
B. All of the above
C. export in /etc/profile
D. setenv
Answer: Option B
Solution (By JKSSB Mock Tests)
Environment variables can be set in shell startup files (.bashrc, .profile, /etc/profile) using export.

Discuss this Question (0)

No comments yet. Be the first to start the discussion!

Practice More Operating Systems Questions

Question #1
In Windows Operating Systems, which system tool is explicitly used to optimize disk space by rearranging fragmented files into contiguous sectors?
A. Chkdsk
B. Disk Cleanup
C. Disk Defragmenter and Optimize Drives
D. Task Manager

Correct Answer: Option C


Explanation:
Disk Defragmenter consolidates fragmented files on a hard drive to improve read/write access speeds and overall system performance.

This question belongs to: Computer Operating Systems
Question #2
In Windows, what does the 'gpupdate' command do?
A. Updates Windows Update
B. Updates user profiles
C. Updates device drivers
D. Updates Group Policy settings

Correct Answer: Option D


Explanation:
gpupdate forces a refresh of local and domain Group Policy settings without rebooting.

This question belongs to: Computer Operating Systems
Question #3
In Windows, the 'Disk Defragmenter' is optimized for:
A. Both HDDs and SSDs
B. USB flash drives
C. Solid-state drives (SSDs)
D. Mechanical hard disk drives (HDDs)

Correct Answer: Option D


Explanation:
Defragmentation is beneficial for HDDs; SSDs use wear leveling and do not require defragmentation; Windows may recognize SSDs and trim instead.

This question belongs to: Computer Operating Systems