0% found this document useful (0 votes)
23 views2 pages

Linux Environment Variables - Assignment 2

The document provides commands for viewing and updating Linux environment variables, specifically the PATH variable. It explains how to make environment changes applicable to all users by modifying the /etc/skel files. Additionally, it outlines steps to resolve the 'Command myapp not found' error after application installation.

Uploaded by

Aketi Tanuja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

Linux Environment Variables - Assignment 2

The document provides commands for viewing and updating Linux environment variables, specifically the PATH variable. It explains how to make environment changes applicable to all users by modifying the /etc/skel files. Additionally, it outlines steps to resolve the 'Command myapp not found' error after application installation.

Uploaded by

Aketi Tanuja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment 2 - Linux Environment Variable

Name: Aketi Thanuja Batch: Sept 8

1.State the command for the following.


a.view current environment variables
Ans: Syntax: 1. $ printenv
2. $ env
b.display the PATH evirnment variable value
Ans: Syntax: $ printenv PATH
c.update PATH to include the path to your home directory
Ans: Syntax: $ export PATH=”$HOME/bin:$PATH”
$ nano ~/ .bashrc – we will set the PATH variable in this
file.
We can save this file and load the new PATH into the current shell session
using source command i.e.,
$ source ~/ .bashrc
Now we can check whether the directory is successfully added by using
$ echo $PATH

2.How will you make the environment changes applicable to all users?
Which script is to be modified?
Ans: To make permanent changes to the environment variables for all new
accounts, go to your /etc/skel files, such as . bashrc , and change the ones
that are already there or enter the new ones. When you create new users,
these /etc/skel files will be copied to the new user’s home directory.
3.I have installed an application named “myapp”. After installation, if I
invoke the application, it fails with error as “Command myapp not
found”. How will you fix this?
Ans: 1. Install the package related to it.
2. Add a new path
3. Copy the file to an existing path location
4. Include the path

You might also like