zoukankan      html  css  js  c++  java
  • tcsh shell configuration --- .tcshrc / .tcshrc.user / .......

    contents of file "~/.tcshrc"

    # in the beginning
    set user_tcshrc="$HOME/.tcshrc.user"
    
    #in the end
    if (-r "${user_tcshrc}") then
          source "${user_tcshrc}"
    endif
    

    contents of the file "~/.tcshrc.user"

    set cn = "%{e[0m%}" # default color and form setting
    set cr = "%{e[31m%}"
    set cp = "%{e[4;35m%}"   # 4 for underline text
    set cg = "%{e[1;32m%}"   # 1 for brighter color
    
    set prompt = "$cg%B%U%h %b%u$cg%U[%~]%u$cn "
    
    # %B (%b): start (end) boldfacing mode      %B,%b can be used in pair, or it may influence next setting
    # %U (%u): start (end) underline mode       %U,%u can be used in pair, or it may influence next setting
    # %n: the user name
    # @: show @ itself
    # %m: hostname up to the first dot "."
    # %M: the full hostname
    # %~: the full working directory
    # %h: history number of command
    :<<!
    the color settings:
    
    1: brighter color
    4: underline text
    5: flashing text
    
    foreground      background      color
    30              40              black
    31              41              red 
    32              42              green 
    33              43              yellow 
    34              44              blue
    35              45              purple
    36              46              cyan
    37              47              white(grey)
    !
    
    alias g 'gvim'
    alias .. 'cd ..'
    alias - 'cd -'
    alias la 'ls -al'
    
    alias checkout 'source ../../xxx.csh'   # "" and '' are both correct
    alias cd 'cd !* ; ls'  # ls while cd to the very directory
    
    # setenv 设置全局变量,可以传递给子shell,类似于bash中的export;
    # set 设置局域变量,不能传递给子shell,而当同时使用set和setenv来设置同一个变量时,当前进程中,会优先使用set设置的值,所以要注意使用
    
    set prompt = "$cg%B%U%h %b%u$cg%U[%~]%u$cn "  # shown as follows
    

    NOTE: after being modified, don't forget to 'source' it

    --------------------------------------------- Study needs record, record needs review ---------------------------------------------
  • 相关阅读:
    利用Java API通过路径过滤上传多文件至HDFS
    docker-compose部署haproxy
    PM2 常用命令
    shell脚本循环访问url直到状态码返回200跳出循环
    CentOS 7.6安装配置Chrony同步系统时钟
    PostgreSQL9.5数据库锁表问题分析与解决
    linux系统netstat命令详解(netstat常用运维命令)
    linux目录备份脚本
    PostgreSQL 锁等待监控 珍藏级SQL
    docker部署pgadmin4并通过nginx反向代理
  • 原文地址:https://www.cnblogs.com/georgemxx/p/13616493.html
Copyright © 2011-2022 走看看