美文网首页
Unix 环境变量设置

Unix 环境变量设置

作者: jeanroy | 来源:发表于2018-05-21 13:13 被阅读0次

1. Environment Variables

  • operating system: type echo $OSTYPE
    show detail:

    USER: your login name
    HOME: the path name of your home directory
    HOST: the name of the computer you are using
    ARCH: the architecture of the computer processor
    DISPLAY: the name of the computer screen to display X windows
    PRINTER:  the default printer to send print jobs
    PATH:  the directory the shell should search to find a command
    
  • environment set:
    type: setenv

  • environment show:
    type: printenv or env

  • environment unset:
    type: unsetenv

2. Shell Variables

  • echo history: the vaule of how many shell commands to save
  • cwd: current working directory
  • home: the path name of your home directory
  • path: the directories the shell should search to find a command
  • prompt: the text string used to prompt for interactive commands shell

set or display shell variables:
type: set xxx
unset shell variables:
type: unset xxx
show all shell variables:
type: set | less

3. Using and setting variables

default file: ~/.login (C shell) or ~/.cshrc(TC shell)
~/.login: set conditions which will apply to the whole session and to perform actions that are relevant only at login.

~/.cshrc: set conditions and perform actions specific to the shell and to each invacation of it

recommand: set ENVIRONMENT variables in the .login file , and SHELL variables in the .cshrc file
warning: NEVER put commands that run graphical displays (e.g. a web browser) in your .cshrc or .login file

4. Setting shell variables in the .cshrc file

  1. edit ~/.cshrc file: set history = 200
  2. % source .cshrc
  3. % echo $history

5. Setting the path

  • % set path = ($path ~/xxx/xx/bin)
  • add this line to .cshrc file: set path = ($path ~/xxx/xx/bin)

相关文章

  • macOS开发环境学习笔记

    1、unix终端环境变量,怎么设置 /etc/profile, ~/.bashrc, ~/.bash_login,...

  • Unix 环境变量设置

    1. Environment Variables operating system: type echo $OST...

  • UNIX 设置 JAVA 环境变量

    一、进入 etc/ 目录,编辑 profile 文件。在该文件末尾加上以下几行: 二、输入以下命令,让刚设置的环境...

  • 用命令完成吧 - 添加环境变量

    Unix/Linux 设置环境变量的关键字取决于你的shell类型,下面是常见shell的设置方法: 查看目录 在...

  • 深度Unix环境变量学习

    我们在文章中讲解Unix环境变量。环境变量相当于给系统或用户应用程序设置的一些参数, 具体起什么作用这当然和具体的...

  • docker容器环境变量的设置与查看

    设置环境变量 查看环境变量 通过环境变量文件设置环境变量 查看所有环境变量

  • window设置和查看环境变量

    全局设置(设置环境变量): 当前会话设置: 查看环境变量: 删除变量:

  • java语言基础1.2

    JDK环境变量的设置 1.计算机右键属性,高级系统设置,然后环境变量设置、 环境变量设置;直接设置Path变量将J...

  • linux学习第一条

    查找 whereis ls 查看环境变量 echo $PATH 环境变量 设置环境变量 1、临时环境变量设置 ex...

  • R语言-环境变量设置

    R语言环境变量的设置 设置环境变量的函数为options(),用options()命令可以设置一些环境变量,使用h...

网友评论

      本文标题:Unix 环境变量设置

      本文链接:https://www.haomeiwen.com/subject/oulfjftx.html