1、命令行格式

用户名@主机名:当前路径$

设置

echo "PS1='${debian_chroot:+($debian_chroot)}\[\033[01;04;32m\]\u\[\033[01;37m\]@\h\[\033[00m\]:\[\033[01;37m\]\W\[\033[31m\]\$ \[\033[00m\]'" >> /root/.bashrc

说明

\h 主机名的第一部分(如 "mybox")

\H 主机的全称(如 "mybox.mydomain.com")

\l 此 shell的终端设备名(如 "ttyp4")

\s shell的名称(如 "bash")

\u 用户名

\w 当前工作目录(如 "/home/drobbins")

\W 当前工作目录的“基名 (basename)”(如 "drobbins")

$ 如果您不是超级用户 (root),则插入一个 "$";如果您是超级用户,则显示一个 "#"

2、终端颜色设置

cd ~ && dircolors .dir_colors

.dir_colors内容如下

# Exact Solarized color theme for the color GNU ls utility.

# Designed for dircolors (GNU coreutils) 5.97

#

# This simple theme was simultaneously designed for these terminal color schemes:

# - Solarized dark (best)

# - Solarized light (best)

# - default dark

# - default light

#

# How the colors were selected:

# - Terminal emulators often have an option typically enabled by default that makes

# bold a different color. It is important to leave this option enabled so that

# you can access the entire 16-color Solarized palette, and not just 8 colors.

# - We favor universality over a greater number of colors. So we limit the number

# of colors so that this theme will work out of the box in all terminals,

# Solarized or not, dark or light.

# - We choose to have the following category of files:

# NORMAL & FILE, DIR, LINK, EXEC and

# editable text including source, unimportant text, binary docs & multimedia source

# files, viewable multimedia, archived/compressed, and unimportant non-text

# - For uniqueness, we stay away from the Solarized foreground colors are -- either

# base00 (brightyellow) or base0 (brightblue). However, they can be used if

# you know what the bg/fg colors of your terminal are, in order to optimize the display.

# - 3 different options are provided: universal, solarized dark, and solarized light.

# The only difference between the universal scheme and one that's optimized for

# dark/light is the color of "unimportant" files, which should blend more with the

# background

# - We note that blue is the hardest color to see on dark bg and yellow is the hardest

# color to see on light bg (with blue being particularly bad). So we choose yellow

# for multimedia files which are usually accessed in a GUI folder browser anyway.

# And blue is kept for custom use of this scheme's user.

# - See table below to see the assignments.

# Installation instructions:

# This file goes in the /etc directory, and must be world readable.

# You can copy this file to .dir_colors in your $HOME directory to override

# the system defaults.

# COLOR needs one of these arguments: 'tty' colorizes output to ttys, but not

# pipes. 'all' adds color characters to all output. 'none' shuts colorization

# off.

COLOR tty

# Below, there should be one TERM entry for each termtype that is colorizable

TERM ansi

TERM color_xterm

TERM color-xterm

TERM con132x25

TERM con132x30

TERM con132x43

TERM con132x60

TERM con80x25

TERM con80x28

TERM con80x30

TERM con80x43

TERM con80x50

TERM con80x60

TERM cons25

TERM console

TERM cygwin

TERM dtterm

TERM dvtm

TERM dvtm-256color

TERM Eterm

TERM eterm-color

TERM fbterm

TERM gnome

TERM gnome-256color

TERM jfbterm

TERM konsole

TERM konsole-256color

TERM kterm

TERM linux

TERM linux-c

TERM mach-color

TERM mlterm

TERM nxterm

TERM putty

TERM putty-256color

TERM rxvt

TERM rxvt-256color

TERM rxvt-cygwin

TERM rxvt-cygwin-native

TERM rxvt-unicode

TERM rxvt-unicode256

TERM rxvt-unicode-256color

TERM screen

TERM screen-16color

TERM screen-16color-bce

TERM screen-16color-s

TERM screen-16color-bce-s

TERM screen-256color

TERM screen-256color-bce

TERM screen-256color-s

TERM screen-256color-bce-s

TERM screen-256color-italic

TERM screen-bce

TERM screen-w

TERM screen.xterm-256color

TERM screen.linux

TERM screen.xterm-new

TERM st

TERM st-meta

TERM st-256color

TERM st-meta-256color

TERM tmux

TERM tmux-256color

TERM vt100

TERM xterm

TERM xterm-new

TERM xterm-16color

TERM xterm-256color

TERM xterm-256color-italic

TERM xterm-88color

TERM xterm-color

TERM xterm-debian

TERM xterm-termite

# EIGHTBIT, followed by '1' for on, '0' for off. (8-bit output)

EIGHTBIT 1

#############################################################################

# Below are the color init strings for the basic file types. A color init

# string consists of one or more of the following numeric codes:

#

# Attribute codes:

# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed

# Text color codes:

# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white

# Background color codes:

# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white

#

# NOTES:

# - See http://www.oreilly.com/catalog/wdnut/excerpt/color_names.html

# - Color combinations

# ANSI Color code Solarized Notes Universal SolDark SolLight

# 00 none NORMAL, FILE

# 30 black base02

# 01;30 bright black base03 bg of SolDark

# 31 red red docs & mm src

# 01;31 bright red orange EXEC

# 32 green green editable text

# 01;32 bright green base01 unimportant text

# 33 yellow yellow unclear in light bg multimedia

# 01;33 bright yellow base00 fg of SolLight unimportant non-text

# 34 blue blue unclear in dark bg user customized

# 01;34 bright blue base0 fg in SolDark unimportant text

# 35 magenta magenta LINK

# 01;35 bright magenta violet archive/compressed

# 36 cyan cyan DIR

# 01;36 bright cyan base1 unimportant non-text

# 37 white base2

# 01;37 bright white base3 bg in SolLight

# 05;37;41 unclear in Putty dark

### By file type

# global default

NORMAL 00

# normal file

FILE 00

# directory

DIR 01;34

# symbolic link

LINK 35

# pipe, socket, block device, character device (blue bg)

FIFO 30;44

SOCK 35;44

DOOR 35;44 # Solaris 2.5 and later

BLK 33;44

CHR 37;44

#############################################################################

### By file attributes

# Orphaned symlinks (blinking white on red)

# Blink may or may not work (works on iTerm dark or light, and Putty dark)

ORPHAN 05;37;41

# ... and the files that orphaned symlinks point to (blinking white on red)

MISSING 05;37;41

# files with execute permission

EXEC 01;31 # Unix

.cmd 01;31 # Win

.exe 01;31 # Win

.com 01;31 # Win

.bat 01;31 # Win

.reg 01;31 # Win

.app 01;31 # OSX

#############################################################################

### By extension

# List any file extensions like '.gz' or '.tar' that you would like ls

# to colorize below. Put the extension, a space, and the color init string.

# (and any comments you want to add after a '#')

### Text formats

# Text that we can edit with a regular editor

.txt 32

.org 32

.md 32

.mkd 32

# Source text

.h 32

.hpp 32

.c 32

.C 32

.cc 32

.cpp 32

.cxx 32

.objc 32

.cl 32

.sh 32

.bash 32

.csh 32

.zsh 32

.el 32

.vim 32

.java 32

.pl 32

.pm 32

.py 32

.rb 32

.hs 32

.php 32

.htm 32

.html 32

.shtml 32

.erb 32

.haml 32

.xml 32

.rdf 32

.css 32

.sass 32

.scss 32

.less 32

.js 32

.coffee 32

.man 32

.0 32

.1 32

.2 32

.3 32

.4 32

.5 32

.6 32

.7 32

.8 32

.9 32

.l 32

.n 32

.p 32

.pod 32

.tex 32

.go 32

.sql 32

.csv 32

### Multimedia formats

# Image

.bmp 33

.cgm 33

.dl 33

.dvi 33

.emf 33

.eps 33

.gif 33

.jpeg 33

.jpg 33

.JPG 33

.mng 33

.pbm 33

.pcx 33

.pdf 33

.pgm 33

.png 33

.PNG 33

.ppm 33

.pps 33

.ppsx 33

.ps 33

.svg 33

.svgz 33

.tga 33

.tif 33

.tiff 33

.xbm 33

.xcf 33

.xpm 33

.xwd 33

.xwd 33

.yuv 33

# Audio

.aac 33

.au 33

.flac 33

.m4a 33

.mid 33

.midi 33

.mka 33

.mp3 33

.mpa 33

.mpeg 33

.mpg 33

.ogg 33

.opus 33

.ra 33

.wav 33

# Video

.anx 33

.asf 33

.avi 33

.axv 33

.flc 33

.fli 33

.flv 33

.gl 33

.m2v 33

.m4v 33

.mkv 33

.mov 33

.MOV 33

.mp4 33

.mp4v 33

.mpeg 33

.mpg 33

.nuv 33

.ogm 33

.ogv 33

.ogx 33

.qt 33

.rm 33

.rmvb 33

.swf 33

.vob 33

.webm 33

.wmv 33

### Misc

# Binary document formats and multimedia source

.doc 31

.docx 31

.rtf 31

.odt 31

.dot 31

.dotx 31

.ott 31

.xls 31

.xlsx 31

.ods 31

.ots 31

.ppt 31

.pptx 31

.odp 31

.otp 31

.fla 31

.psd 31

# Archives, compressed

.7z 1;35

.apk 1;35

.arj 1;35

.bin 1;35

.bz 1;35

.bz2 1;35

.cab 1;35 # Win

.deb 1;35

.dmg 1;35 # OSX

.gem 1;35

.gz 1;35

.iso 1;35

.jar 1;35

.msi 1;35 # Win

.rar 1;35

.rpm 1;35

.tar 1;35

.tbz 1;35

.tbz2 1;35

.tgz 1;35

.tx 1;35

.war 1;35

.xpi 1;35

.xz 1;35

.z 1;35

.Z 1;35

.zip 1;35

# For testing

.ANSI-30-black 30

.ANSI-01;30-brblack 01;30

.ANSI-31-red 31

.ANSI-01;31-brred 01;31

.ANSI-32-green 32

.ANSI-01;32-brgreen 01;32

.ANSI-33-yellow 33

.ANSI-01;33-bryellow 01;33

.ANSI-34-blue 34

.ANSI-01;34-brblue 01;34

.ANSI-35-magenta 35

.ANSI-01;35-brmagenta 01;35

.ANSI-36-cyan 36

.ANSI-01;36-brcyan 01;36

.ANSI-37-white 37

.ANSI-01;37-brwhite 01;37

#############################################################################

# Your customizations

# Unimportant text files

# For universal scheme, use brightgreen 01;32

# For optimal on light bg (but too prominent on dark bg), use white 01;34

.log 01;32

*~ 01;32

*# 01;32

#.log 01;34

#*~ 01;34

#*# 01;34

# Unimportant non-text files

# For universal scheme, use brightcyan 01;36

# For optimal on dark bg (but too prominent on light bg), change to 01;33

.bak 01;36

.BAK 01;36

.old 01;36

.OLD 01;36

.org_archive 01;36

.off 01;36

.OFF 01;36

.dist 01;36

.DIST 01;36

.orig 01;36

.ORIG 01;36

.swp 01;36

.swo 01;36

*,v 01;36

#.bak 01;33

#.BAK 01;33

#.old 01;33

#.OLD 01;33

#.org_archive 01;33

#.off 01;33

#.OFF 01;33

#.dist 01;33

#.DIST 01;33

#.orig 01;33

#.ORIG 01;33

#.swp 01;33

#.swo 01;33

#*,v 01;33

# The brightmagenta (Solarized: purple) color is free for you to use for your

# custom file type

.gpg 34

.gpg 34

.pgp 34

.asc 34

.3des 34

.aes 34

.enc 34

.sqlite 34

linux中如何自定义命令行,linux终端颜色和命令行自定义相关推荐

  1. linux卸载先驱的命令是,【单选题】在Linux中,若要在同一行书写多条命令,命令之间应使用符号()分隔A. 转义字符\\ B. 分号; C. , D. 空格...

    [单选题]在Linux中,若要在同一行书写多条命令,命令之间应使用符号()分隔 A. 转义字符\\ B. 分号; C. , D. 空格 更多相关问题 [单选] 以下不属于野兽派的代表人物() [单选] ...

  2. linux中_Linux基础知识(Linux系统、Linux中的链表)

    Linux系统简介 Linux系统的结构及特点 Linux系统的结构图如下图所示: 从上图可以看出,Linux是一个典型的宏内核(一体化内核)结构.硬件系统上面时硬件抽象层,在硬件抽象层上面时内核服务 ...

  3. 19. linux中权限详解,Linux权限位,读写执行权限真正含义,chmod详解

    linux中权限详解,Linux权限位,读写执行权限真正含义,chmod详解 文章目录 Linux权限位 读写执行 三种权限真正含义和作用 权限对文件的作用 权限对目录的作用 示例 chmod 使用数 ...

  4. centos sudo不能运行_如何在 Linux 中配置 sudo 访问权限 | Linux 中国

    Linux 系统中 root 用户拥有 Linux 中全部控制权力.Linux 系统中 root 是拥有最高权力的用户,可以在系统中实施任意的行为.-- Magesh Maruthamuthu Lin ...

  5. linux取证教程,Linux中的取证(Forensics in Linux)

    Linux中的取证(Forensics in Linux) 数字调查的主要问题是通过加密或任何其他格式保护重要证据或数据. 基本示例是存储密码. 因此,有必要了解Linux操作系统在数字取证实施中的使 ...

  6. Linux中文件写保护,Linux_在Linux下创建写保护的文件的教程,假如你想对Linux中的一些重要 - phpStudy...

    在Linux下创建写保护的文件的教程 假如你想对Linux中的一些重要文件做写保护,这样它们就不能被删除或者被篡改成之前的版本或者其他东西,或者在其他情况下,你可能想避免某些配置文件被软件自动修改.使 ...

  7. Linux中重定向的实验总结,Linux中重定向命令行的总结

    1. 标准输入的控制 语法:命令< 文件将文件做为命令的输入. 例如: mail -s "mail test" < file1 将文件file1 当做信件的内容,主 题 ...

  8. linux中read函数的用法,Linux中read命令的简介及使用方法

    Linux中read命令的简介及使用方法 发布时间:2020-08-17 16:40:04 来源:亿速云 阅读:107 作者:小新 这篇文章给大家分享的是有关Linux中read命令的简介及使用方法的 ...

  9. linux中对文件进行归档,linux归档压缩命令 linux中对文件进行归档的命令为

    13. 为了将当前目录下的归档文件myftp.tgz解压缩到/tmp目录下,用户可以使用命令 A. tar xvzf myftp.tgz –C /tmp B. tar : xvzf : myftp.t ...

最新文章

  1. 对数组中的数字 1 和 2 进行排序,使得数字 1、2 分别位于前、后部分
  2. 机器推理文本+视觉,跨模态预训练新进展
  3. x86 X64指令集之间的关系
  4. python 列表转字典
  5. logback配置(与log4j对比)
  6. Topic交换器-编写消费者
  7. ruby 爬虫爬取拉钩网职位信息,产生词云报告
  8. C语言第12轮:指针
  9. 如何查找求职简历模板及pdf编辑器去水印
  10. 【阿里云盘】2022付费考研课程
  11. python综合应用名片管理系统_综合应用——名片管理系统
  12. HTML之基础标签_思维导图版
  13. Ubuntu完全教程,让你成为Ubuntu高手!
  14. 邮件营销活动如何被病毒式传播?
  15. GNSS入门1-误差
  16. putty怎么上传下载文件和目录
  17. android App中bug收集的工具类
  18. krait和kryo_为什么现在高通的kryo架构只是在arm公版架构基础上小修小补?
  19. 上职高学计算机可以考师范大学吗,职业高中也可以考大学,你知道吗?
  20. Linux内核(2)——子系统

热门文章

  1. Operations Manager 2007 监控Active Directory SCOM-Part 3
  2. linux中ftp的工作原理,Linux系统学习 十二、VSFTP服务—简介与原理
  3. 为什么有的人喜欢夜间工作_为什么开发人员喜欢在夜间编码
  4. sphinx python_如何使用Sphinx记录Python代码
  5. 持续集成与持续部署实践_持续集成和部署的3个最佳实践
  6. Ecere SDK:用于GUI和图形的跨平台工具包
  7. 程序员项目_您如何让程序员加入您的项目?
  8. html5 canvas气泡动画
  9. ​第二十四章:皮衣大卖
  10. k8s | 搞不明白为什么大家都在学习 k8s