内核实用程序,针对文本及文件操作。涉及到102条linux命令。
命令列表:cpinstall、ln、mvlsecho……

常见选项


1.退出状态

2.备份选项

  cp, install, ln, mv

短选项 长选项 注解
-b '--backup'[=method] 当某个文件存在被移动(mv)、覆盖的情况时,如何备份的指定选项。
短选项不接受任何参数,默认是“--backup=existing“。
-S SUFFIX --suffix=SUFFIX 与“-b”同时使用,添加到文件名中。

  当不指定“method”,有点复杂,建议指定。参数接受“唯一性缩写”、多字符表示,参数如下:

METHOD参数 注解

none

off

永不备份

numbered

t

总是进行编号备份

existing

nil

已有的编号备份,其他的简单备份

simple

never

简单备份

3.目标目录

  cp, install, ln, mv

短选项 长选项 注解
-T File --no-target-directory

指定普通文件,父目录必须是存在的。格式:install -T large.cnf /etc/my.cnf
效果,就像复制后重命名,目标在最后且是个普通文件。

-t DIR --target-directory=DIR

指定目录文件,该目录必须存在。格式:install -t /etc my.cnf

像是复制进去一样,目标在前,且是目录。

  例子,使用“-T”:

[root@right mag]# ll
total
drwxr-xr-x. root root Dec : back
drwxr-xr-x. root root Dec : mag
[root@right mag]# mv -T mag back
mv: overwrite ‘back’? y
[root@right mag]# ll
total
drwxr-xr-x. root root Dec : back

  例子,使用“-t”:

[root@right mag]# ll
total
drwxr-xr-x. root root Dec : back
drwxr-xr-x. root root Dec : mag
[root@right mag]# mv -t mag back
[root@right mag]# ll
total
drwxr-xr-x. root root Dec : mag
[root@right mag]# ls mag/
back

  使用“-t”,效果等同于:

[root@right mag]# ll
total
drwxr-xr-x. root root Dec : back
drwxr-xr-x. root root Dec : mag
[root@right mag]# mv back mag
[root@right mag]# ll
total
drwxr-xr-x. root root Dec : mag
[root@right mag]# ls mag/
back

GNU coreutils的更多相关文章

  1. mac 终端 使用 gnu coreutils 工具 ls 颜色显示

    mac 终端默认 ls 命令无颜色显示: 1: 使用 ls -G 可以显示基本颜色 2:使用 gnu coreutils 工具 mac 终端 使用 gnu coreutils 工具 ls 颜色显示 以 ...

  2. Coreutils - GNU core utilities

    coreutils 是GNU下的一个软件包,包含linux下的 ls等常用命令.这些命令的实现要依赖于shell程序.一般在系统中都默认安装,也可自己安装或更新.例如,安装coreutils-6.7. ...

  3. 【Mac】Mac OS X 安装GNU命令行工具

    macos的很多用户都是做it相关的人,类unix系统带来了很多方面,尤其是经常和linux打交道的人. 但是作为经常使用linux 命令行的人发现macos中的命令行工具很多都是bsd工具,跟lin ...

  4. AutoMySQLBackup 3.0 Bug:"du: WARNING: use --si, not -H"

    案例环境: 操作系统版本: Red Hat Enterprise Linux Server release 5.7 64bit 数据库版本 : 5.6.19 MySQL Community Serve ...

  5. Linux命令学习总结:date命令

    命令简介: date 根据给定格式显示日期或设置系统日期时间.print or set the system date and time 指令所在路径:/bin/date 命令语法: date [OP ...

  6. Linux split拆分文件

    200 ? "200px" : this.width)!important;} --> 介绍 split可以将一个大文件拆分成指定大小的多个文件,并且拆分速度非常的快,拆分一 ...

  7. Linux下怎么查看当前系统的版本

    Linux下怎么查看当前系统的版本:   uname -r 功能说明:uname用来获取电脑和操作系统的相关信息. 语 法:uname [-amnrsvpio][--help][--version] ...

  8. 如何以nobody用户执行命令?

    最近在logstash中使用nobody用户启动logstash,一想,nobody用户的shell不是/sbin/nologin吗? 不能登录执行命令呀? 于是看了一下它的启动脚本,是使用其他方式进 ...

  9. centos 7.0 ln命令 和chkconfig 命令介绍 开机自动启 服务

    有时候centos需要 程序开机启动的时候  自启动 首先在 /etc/init.d/ cd /etc/init.d 文件夹下建立开机启动项 使用ln命令 使用方式 : ln [options] so ...

随机推荐

  1. Centos7 设置Mongodb开机启动-自定义服务

    (1).在/lib/systemd/system/目录下新建mongodb.service文件,内容如下 [Unit] Description=mongodb After=network.target ...

  2. 亚马逊 AWS ip反向解析:Configurable Reverse DNS for Amazon EC2’s Elastic IP Addresses

    I’d like to call your attention to a new feature that we rolled out earlier this month. You can now ...

  3. innobackupex per table

    #innobackupex export tableinnobackupex --defaults-file=/etc/my.cnf --sock=/data/3306/mysql_3306.sock ...

  4. DEVC++ C++ Builder6.0

    Devc++安装后无法正常编译程序 出现错误,不知道是什么,可能是不兼容的原因 然后就是一直编译出错,程序是最简单的helloworld程序. 之后选择安装C++ Builder 6.0

  5. elasticsearch 口水篇(7) Eclipse中部署ES源码、运行

    ES源码可以直接从svn下载 https://github.com/elasticsearch/elasticsearch 下载后,用Maven导入(import——>Existing Mave ...

  6. Maven打包将所有的依赖都打入

    附上pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www ...

  7. 小程序支持打开APP

    根据微信的官方文档,小程序支持打开APP,专门研究了下这个API有什么,官方文档地址如下 https://mp.weixin.qq.com/debug/wxadoc/dev/component/but ...

  8. 阿里云ECS安装Kubernetes问题收集与解答

    问题1 kubernetes pod启动报错open /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such fil ...

  9. 导入jar包的方法

    右键项目弹出菜单,进行如下选择: 4.在配置页中,选中Libraries标签页,然后点击Add JARs选择刚才拷贝过来的jar包.最后点击apply and close. 添加完成后图标会发生变化 ...

  10. 若是汉字的一半,就舍弃这个汉字输出,例如:“js3范ad啊asd”,截取4,则输出:“js3”

    package com.jt.test.redis; import org.junit.Test; /* 题目要求 * 编码:GBK,一个英文字符占一个字节,一个汉字占2个字节 * 随机给定一个字符串 ...