Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Linux System Getting Started Learning: modify environment variables in Linux PATH     - Use netcat [nc] command on Linux and Unix port scan (Server)

- Use Linux built-in firewall to improve network access control (Linux)

- Java data structures - the linear form of the single-chain applications (Programming)

- Linux character device - user mode and kernel mode data transfer data (Linux)

- Comparison of one-time transaction and CTE insert data (Database)

- The most concise Systemd tutorial, just ten minutes (Linux)

- Linux itself disguised illusion strengthen security (Linux)

- How to fix Ubuntu / Mint can not add PPA source of error (Linux)

- shell script: a key optimization CentOS system (Linux)

- Linux excellent text editor (Markdown, LaTeX, MathJax) (Linux)

- How linux network security configuration (Linux)

- How to install Bugzilla 4.4 on Ubuntu / CentOS 6.x (Linux)

- Java String type time compare the size (Programming)

- Composition and dynamic memory allocation C program (Programming)

- Use cmake to compile and install MySQL 5.5 (Database)

- MySQL how to export files with the date format (Database)

- Ubuntu 14.04 How to install Cinnamon 2.4.5 (Linux)

- CentOS iptables firewall configuration (Linux)

- Generators and iterators in Python (Programming)

- PostgreSQL Source Customization: Online global read only (Database)

  Linux System Getting Started Learning: modify environment variables in Linux PATH
  Add Date : 2018-11-21      
  Question: When I try to run a program, it prompts "command not found". But this program in / usr / local / bin. How do I add / usr / local / bin to my PATH variable, so I can not specify a path to run this command.

In Linux, PATH environment variable holds the time series of directories for user input in the search command. The value of the PATH variable by a series of absolute paths separated by semicolons composition. Each user has a specific PATH environment variable (initialized by the system-level PATH variable).

To check the user's environment variables, run the following command in user mode:

$ Echo $ PATH
Or run:

$ Env | grep PATH
PATH = / usr / lib64 / qt-3.3 / bin: / bin: / usr / bin: / usr / sbin: / sbin: / home / xmodulo / bin
If your command does not exist in any of the above within a directory, shell throws an error message: "command not found".

If you want to add an additional directory (eg: / usr / local / bin) to your PATH variable, you can use the following commands.

Modify the PATH environment variable for a specific user

If you want to add a new directory in the current logon session temporarily (eg: / usr / local / bin) to the user's default search path, you only need to enter the following command.

$ PATH = $ PATH: / usr / local / bin
Check if the PATH has been updated:

$ Echo $ PATH
PATH will remain valid in the current session after the update. However, the change will fail in the new session.

If you want to permanently change the PATH variable, open ~ / .bashrc (or ~ / .bash_profile) with the editor, and then add the following line at the end.

export PATH = $ PATH: / usr / local / bin
Then run the following line of permanent activation changes:

$ Source ~ / .bashrc (or source ~ / .bash_profile)

Change the system-level environment variables

If you want to permanently add the / usr / local / bin to the system PATH variable level, like this edit / etc / profile.

$ Sudo vi / etc / profile
export PATH = $ PATH: / usr / local / bin
After you log back in to update the environment variables will come into force.
- Swift acquaintance of values and references, the circular reference, Agent Precautions (Programming)
- httpd-2.4 feature (Server)
- 29 practical examples Linux system / network administrator of nmap (Linux)
- How to experience Unity 8 Mir on Ubuntu 16.04 (Linux)
- CentOS iptables firewall configuration (Linux)
- Linux Network Analysis Tcpdump Command Guide (Linux)
- CentOS 7 Configure logging (VirtualBox) (Linux)
- How to allow users to access only a specific database (MSSQL) (Database)
- Recovery from MySQL master data consistency summary (Database)
- DNF Command Tutorial (Linux)
- How to import JNI resulting .so libraries in Android Studio (Programming)
- Install KVM on Ubuntu and build a virtual environment (Linux)
- Red Hat Linux mount U disk (Linux)
- Linux Programming memory mapping (Programming)
- Python class of operator overloading (Programming)
- Object Oriented Programming Java reflection (Programming)
- MySQL high availability cluster fragmentation of deployment uses Fabric (Database)
- Hands to teach you to solve Ubuntu error message (Linux)
- Linux Workstation Security Checklist - from the Linux Foundation Internal (Linux)
- Linux System Getting Started Tutorial: How to Force Change your password at next logon Linux (Linux)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.