内核实用程序,针对文本及文件操作。涉及到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. Hadoop "Cannot create directory .Name node is in safe mode."解决方案

    转载自:http://www.waitig.com/hadoop-name-node-is-in-safe-mode.html 在使用Hadoop建立文件的时候,出现“Cannot create di ...

  2. windows服务命令 转载

    OnCustomCommand executes when the Service Control Manager (SCM) passes a custom command to the servi ...

  3. 为什么.net 4.6.1装了却没看到

    今天在做SignalR网站,需要在发布到的云服务器安装.net4.6.1 从网上下载了安装包,安装完之后,到Windows文件夹的 Microsoft.NET文件夹中却找不到4.6.1的文件夹. 云服 ...

  4. python--BUG--python socket.error: [Errno 9] Bad file descriptor的解决办法

    这个错误很明显 ,是因为关闭了套接字对象后,又再次去调用了套接字对象,此时套接字链接已经被关闭,不能再去调用,所以才会出现这种错误,复查一下代码,很快就可以解决.

  5. 数据仓库专题(21):Kimball总线矩阵说明-官方版

    一.前言 Over the years, I have found that a matrix depiction of the data warehouse plan is a pretty goo ...

  6. 使用googletest进行C++单元测试(Netbeans为例)

    googletest设置步骤(Netbeans为例) 下载googletest [https://github.com/google/googletest],解压到<gtest_dir> ...

  7. uoj #49. 【UR #3】铀仓库

    http://uoj.ac/problem/49 这题二分答案可以做,同时存在另一个直接二分的解法. 考虑对每个点,二分能向左右延伸的最大半径,由于权值范围较大,不能O(1)查询向一侧走指定距离后到达 ...

  8. Dubbo(5)优化:接口抽取以及依赖版本统一

    优化点: 1.在上面provider和consumer程序中都存在DemoProviderService接口了,两个项目中存在同样的东西,代码多余以及不方便管理: 正式的项目中存在很多的接口的,将统一 ...

  9. C语言中sizeof与strlen的区别

    1.sizeof sizeof为编译时期被替换,不会等到程序运行再来判断,所以sizeof返回的是数组的总字节数 #include<stdio.h> int main() { ]={'a' ...

  10. MyBatis的入门案例

    1.MyBatis的结构 2.MyBatis入门案例 a.创建java项目,并在其中导入相关开发包 b.导入约束文件 http://mybatis.org/dtd/mybatis-3-config.d ...