码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 【linux命令讲解大全】057.UNIX实用命令详解:col、colrm和dircolors的用法


    文章目录

    • col
      • 补充说明
      • 语法
      • 选项
    • colrm
      • 补充说明
      • 语法
      • 参数
    • dircolors
      • 补充说明
      • 语法
      • 选项
      • 参数
      • 实例
    • 从零学 `python`

    col

    过滤控制字符

    补充说明

    col命令是一个标准输入文本过滤器,它从标准输入设备读取文本内容,并把内容显示到标准输出设备。在许多UNIX说明文件里,都有RLF控制字符。当我们运用shell特殊字符>和>>,把说明文件的内容输出成纯文本文件时,控制字符会变成乱码,col命令则能有效滤除这些控制字符。

    语法

    col [选项]

    选项

    • -b:过滤掉所有的控制字符,包括RLF和HRLF;
    • -f:滤掉RLF字符,但允许将HRLF字符呈现出来;
    • -x:以多个空格字符来表示跳格字符;
    • -l <缓冲区列数>:预设的内存缓冲区有128列,用户可以自行指定缓冲区的大小。

    colrm

    删除文件中的指定列

    补充说明

    colrm命令用于删除文件中的指定列。colrm命令从标准输入设备读取书记,转而输出到标准输出设备。如果不加任何参数,则colrm命令不会过滤任何一行。

    语法

    colrm [参数]

    参数

    • 起始列号:指定要删除的指定列;
    • 结尾列号:指定要删除的结尾列。

    dircolors

    置ls命令在显示目录或文件时所用的色彩

    补充说明

    dircolors命令设置ls命令在显示目录或文件时所用的色彩。dircolors可根据[色彩配置文件]来设置LS_COLORS环境变量或是显示设置LS_COLORS环境变量的命令。

    语法

    dircolors [选项] [参数]

    选项

    • -b或--sh或--bourne-shell:显示在Boume shell中,将LS_COLORS设为目前预设置的shell指令;
    • -c或--csh或--c-shell:显示在C shell中,将LS_COLORS设为目前预设置的shell指令;
    • -p或--print-database:显示预设置;
    • -help:显示帮助;
    • -version:显示版本信息。

    参数

    • 文件:指定用来设置颜色的文件。

    实例

    [root@localhost ~]# dircolors -p
    # Configuration file for dircolors, a utility to help you set the
    # LS_COLORS environment variable used by GNU ls with the --color option.
    # The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
    # slackware version of dircolors) are recognized but ignored.
    # Below, there should be one TERM entry for each termtype that is colorizable
    TERM linux
    TERM linux-c
    TERM mach-color
    TERM console
    TERM con132x25
    TERM con132x30
    TERM con132x43
    TERM con132x60
    TERM con80x25
    TERM con80x28
    TERM con80x30
    TERM con80x43
    TERM con80x50
    TERM con80x60
    TERM cygwin
    TERM dtterm
    TERM putty
    TERM xterm
    TERM xterm-color
    TERM xterm-debian
    TERM rxvt
    TERM screen
    TERM screen-bce
    TERM screen-w
    TERM vt100
    TERM Eterm
    # 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
    NORMAL 00 # global default, although everything should be something.
    FILE 00 # normal file
    DIR 01;34 # directory
    LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
               # numerical value, the color is as for the file pointed to.)
    FIFO 40;33 # pipe
    SOCK 01;35 # socket
    DOOR 01;35 # door
    BLK 40;33;01 # block device driver
    CHR 40;33;01 # character device driver
    ORPHAN 40;31;01 # symlink to nonexistent file
    SETUID 37;41 # file that is setuid (u+s)
    SETGID 30;43 # file that is setgid (g+s)
    STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
    OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
    STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
    # This is for files with execute permission:
    exec 01;32
    # 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 '#')
    # If you use DOS-style suffixes, you may want to uncomment the following:
    #.cmd 01;32 # executables (bright green)
    #.exe 01;32
    #.com 01;32
    #.btm 01;32
    #.bat 01;32
    .tar 01;31 # archives or compressed (bright red)
    .tgz 01;31
    .arj 01;31
    .taz 01;31
    .lzh 01;31
    .zip 01;31
    .Z 01;31
    .gz 01;31
    .bz2 01;31
    .deb 01;31
    .rpm 01;31
    .jar 01;31
    # image formats
    .jpg 01;35
    .jpeg 01;35
    .gif 01;35
    .bmp 01;35
    .pbm 01;35
    .pgm 01;35
    .ppm 01;35
    .tga 01;35
    .xbm 01;35
    .xpm 01;35
    .tif 01;35
    .tiff 01;35
    .png 01;35
    .mov 01;35
    .mpg 01;35
    .mpeg 01;35
    .avi 01;35
    .fli 01;35
    .gl 01;35
    .dl 01;35
    .xcf 01;35
    .xwd 01;35
    # audio formats
    .flac 01;35
    .mp3 01;35
    .mpc 01;35
    .ogg 01;35
    .wav 01;35
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108

    从零学 python

    【从零学习python 】92.使用Python的requests库发送HTTP请求和处理响应
    【从零学习python 】91. 使用装饰器和字典管理请求路径的简洁Web应用
    【从零学习python 】93.使用字典管理请求路径
    【从零学习python 】89. 使用WSGI搭建简单高效的Web服务器
    【从零学习python 】88. WSGI接口详解:实现简单高效的Web开发
    【从零学习python 】87. 手动搭建HTTP服务器的Python实现及多线程并发处理
    【从零学习python 】86. 深入了解HTTP协议及其在浏览器和服务器通信中的作用
    【从零学习python 】85.Python进程池的并行计算技术应用
    【从零学习python 】84.深入理解线程和进程
    【从零学习python 】83. Python多进程编程与进程池的使用
    【从零学习python 】82. 基于多线程的聊天程序实现
    【从零学习python 】81.Python多线程通信与队列的应用
    【从零学习python 】80.线程访问全局变量与线程安全问题
    【从零学习python 】79. 线程访问全局变量与线程安全问题
    【从零学习python 】78. 文件下载案例
    【从零学习python 】77. TCP服务端编程及注意事项
    【从零学习python 】76.服务器与客户端:网络通信的关键组成部分
    【从零学习python 】75. TCP协议:可靠的面向连接的传输层通信协议
    【从零学习python 】74. UDP网络程序:端口问题与绑定信息详解
    【从零学习python 】73. UDP网络程序-发送数据
    【从零学习python 】72. 深入理解Socket通信及创建套接字的方法
    【从零学习python 】71. 网络端口及其作用
    【从零学习python 】70.网络通信方式及其应用:从直接通信到路由器连接多个网络
    【从零学习python 】69. 网络通信及IP地址分类解析
    【从零学习python 】68. Python正则表达式中的贪婪和非贪婪模式
    【从零学习python 】67.Python中的re模块:正则替换与高级匹配技术
    【从零学习python 】66.深入了解正则表达式:模式匹配与文本处理的利器
    【从零学习python 】65. Python正则表达式修饰符及其应用详解
    【从零学习python 】64. Python正则表达式中re.compile方法的使用详解
    【从零学习python 】63.正则表达式中的re.Match类及其属性和方法介绍
    【从零学习python 】62. Python正则表达式:强大的字符串匹配工具
    【从零学习python 】61.Python中的property属性详解和应用示例
    【从零学习python 】60.探索生成器:迭代的灵活利器
    【从零学习python 】59.迭代器:优化数据遍历的高效工具
    【从零学习python 】58.Python中的自定义异常及引发异常的方法
    【从零学习python 】57.Python中使用with关键字正确关闭资源
    【从零学习python 】56. 异常处理在程序设计中的重要性与应用
    【从零学习python 】55.Python中的序列化和反序列化,JSON与pickle模块的应用
    【从零学习python 】54. 内存中写入数据
    【从零学习python 】53. CSV文件和Python的CSV模块
    【从零学习python 】52.文件的读写 - Python文件操作指南
    【从零学习python 】51.文件的打开与关闭及其在Python中的应用
    【从零学习python 】49. Python中对象相关的内置函数及其用法
    【从零学习python 】48.Python中的继承与多继承详解
    【从零学习python 】47. 面向对象编程中的继承概念及基本使用
    【从零学习python 】46. Python中的__new__和__init__方法解析及单例设计模式
    【从零学习python 】45.Python中的类方法和静态方法
    【从零学习python 】44.面向对象编程中的私有属性和方法
    【从零学习python 】43. Python面向对象编程中的实例属性和类属性
    【从零学习python 】42.Python中的内置属性和方法
    【从零学习python 】41.python魔法方法(二)
    【从零学习python 】40.python魔法方法(一)
    【从零学习python 】39.面向对象基本语法及应用示例
    【从零学习python 】38.Python包的使用及导入方式
    【从零学习python 】37.Python自定义模块的使用和注意事项
    【从零学习python 】36.Python中使用pip进行第三方包管理的方法与技巧
    【从零学习python 】35. Python常见系统模块及其用法
    【从零学习python 】34.Python模块的导入和使用方法详解
    【从零学习python 】33.装饰器的作用(二)
    【从零学习python 】32.装饰器的作用(一)
    【从零学习python 】31.深入理解Python中的高阶函数和闭包
    【从零学习python 】30.深入理解递归函数和匿名函数
    【从零学习python 】29. 「函数参数详解」——了解Python函数参数的不同用法
    【从零学习python 】28. Python中的局部变量和全局变量
    【从零学习python 】27. Python 函数的使用及嵌套调用
    【从零学习python 】25.函数:提高代码编写效率的利器
    【从零学习python 】24. Python中的字符串操作与遍历方法
    【从零学习python 】23. Python中集合(set)的使用方法和常见操作
    【从零学习python 】22. Python中的字典的增删改查及字典的变量
    【从零学习python 】21.Python中的元组与字典
    【从零学习python 】20. Python列表操作技巧及实例
    【从零学习python 】19. 循环遍历列表和列表嵌套的应用
    【从零学习python 】18. Python列表的基本操作详解(一)
    【从零学习python 】17. Python字符串的format方法(二)
    【从零学习python 】16. Python字符串的format方法(一)
    【从零学习python 】15.深入了解字符串及字符集编码
    【从零学习python 】14.Python字符串常见操作(二)
    【从零学习python 】13.Python字符串常见操作(一)
    【从零学习python 】12.Python字符串操作与应用
    【从零学习python 】11.Python循环语句和控制流程
    【从零学习python 】10.Python条件语句和if嵌套详解
    【从零学习python 】09.Python 中的条件判断语句
    【从零学习python 】08.Python了解位运算符, 运算符优先级
    【从零学习python 】07.Python运算符详解:赋值、比较和逻辑运算符
    【从零学习python 】06. Python中运用算数运算符进行计算和字符串拼接
    【从零学习python 】05. Python中的输出和输入
    【从零学习python 】04. Python编程基础:变量、数据类型与标识符
    【从零学习python 】03. Python交互式编程及注释详解
    【从零学习python 】02. 开发工具介绍
    【从零学习python 】01. 安装配置python

  • 相关阅读:
    UML概述及UML类图详解
    TikTok整合谷歌搜索功能,探索新的流量入口
    CIP或者EtherNET/IP中的PATH是什么含义?
    Android 15新特性,强制edge-to-edge全面屏体验
    索引初识
    MPViT : Multi-Path Vision Transformer for Dense Prediction
    LSTM情感分类问题调试
    java中的MVC设计模式、模型层 model 主要处理数据、视图层 view 显示数据、控制层 controller 处理业务逻辑
    HCIA 访问控制列表ACL
    idea中配置spring boot单项目多端口启动
  • 原文地址:https://blog.csdn.net/qq_33681891/article/details/132684497
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号