知名网站制作红孩子网站建设

news/2025/9/23 18:58:36/文章来源:
知名网站制作,红孩子网站建设,网站开发支付超时如何解决,安网站建设目录 一、truncate功能概述实例#xff08;可用于删除文件末尾指定大小的内容#xff09; 二、head功能概述实例#xff08;可用于删除文件末尾指定大小的内容#xff09; 三、tail功能概述#xff1a;实例#xff08;可用于删除文件开头指定大小的内容#xff09; 四、… 目录 一、truncate功能概述实例可用于删除文件末尾指定大小的内容 二、head功能概述实例可用于删除文件末尾指定大小的内容 三、tail功能概述实例可用于删除文件开头指定大小的内容 四、dd概述 五、应用1. 清空文件内容 一、truncate truncate --help Usage: truncate OPTION... FILE... Shrink or extend the size of each FILE to the specified sizeA FILE argument that does not exist is created.If a FILE is larger than the specified size, the extra data is lost. If a FILE is shorter, it is extended and the extended part (hole) reads as zero bytes.Mandatory arguments to long options are mandatory for short options too.-c, --no-create do not create any files-o, --io-blocks treat SIZE as number of IO blocks instead of bytes-r, --referenceRFILE base size on RFILE-s, --sizeSIZE set or adjust the file size by SIZE bytes--help display this help and exit--version output version information and exitSIZE is an integer and optional unit (example: 10M is 10*1024*1024). Units are K, M, G, T, P, E, Z, Y (powers of 1024) or KB, MB, ... (powers of 1000).SIZE may also be prefixed by one of the following modifying characters:extend by, - reduce by, at most, at least, / round down to multiple of, % round up to multiple of.功能概述 缩小或扩展文件到指定的大小默认文件不存在会被创建如果文件大于指定的大小额外的末尾的数据将被丢弃如果文件小于指定的大小则对其进行扩展并且扩展部分读取为零字节 实例可用于删除文件末尾指定大小的内容 -s 参数设置或调整文件到指定的大小。 -s, --sizeSIZE set or adjust the file size by SIZE bytes$ echo 123456789 test_truncate $ hexdump -C test_truncate 00000000 31 32 33 34 35 36 37 38 39 0a |123456789.| # 文件大于指定的大小额外的末尾的数据将被丢弃 $ truncate -s 5 test_truncate $ hexdump -C test_truncate 00000000 31 32 33 34 35 |12345| # 如果文件小于指定的大小则对其进行扩展并且扩展部分读取为零字节 truncate -s 10 test_truncate $ hexdump -C test_truncate 00000000 31 32 33 34 35 00 00 00 00 00 |12345.....|-r 参数将文件设置为于参考文件相同的大小。 -r, --referenceRFILE base size on RFILE$ ls -l test_truncate* -rw-rw-r-- 1 guest guest 10 Nov 30 01:52 test_truncate -rw-rw-r-- 1 guest guest 21 Nov 30 02:00 test_truncate_ref $ hexdump -C test_truncate 00000000 31 32 33 34 35 00 00 00 00 00 |12345.....| 0000000a # 将test_truncate文件的大小设置为与test_truncate_ref文件相同 $ truncate -r test_truncate_ref test_truncate $ ls -l test_truncate* -rw-rw-r-- 1 guest guest 21 Nov 30 02:01 test_truncate -rw-rw-r-- 1 guest guest 21 Nov 30 02:00 test_truncate_ref $ hexdump -C test_truncate 00000000 31 32 33 34 35 00 00 00 00 00 00 00 00 00 00 00 |12345...........| 00000010 00 00 00 00 00 |.....|-c 参数文件不存在不创建。 -c, --no-create do not create any files# 带-c参数不会创建不存在的文件 ls -l test_truncate ls: cannot access test_truncate: No such file or directory $ truncate -s 100 -c test_truncate $ ls -l test_truncate ls: cannot access test_truncate: No such file or directory# 不带-c参数文件不存在则创建内容都是0 $ truncate -s 100 test_truncate $ ls -l test_truncate -rw-rw-r-- 1 guest guest 100 Nov 30 01:07 test_truncate $ hexdump -C test_truncate 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000060 00 00 00 00 |....| 00000064二、head head --help Usage: head [OPTION]... [FILE]... Print the first 10 lines of each FILE to standard output. With more than one FILE, precede each with a header giving the file name. With no FILE, or when FILE is -, read standard input.Mandatory arguments to long options are mandatory for short options too.-c, --bytes[-]K print the first K bytes of each file;with the leading -, print all but the lastK bytes of each file-n, --lines[-]K print the first K lines instead of the first 10;with the leading -, print all but the lastK lines of each file-q, --quiet, --silent never print headers giving file names-v, --verbose always print headers giving file names--help display this help and exit--version output version information and exitK may have a multiplier suffix: b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024, GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.功能概述 将每个文件的前10行打印到标准输出如果有多个文件则先打印文件名 $ head test_head test_truncatetest_head 1234567890 test_truncate 123451234567890实例可用于删除文件末尾指定大小的内容 -c 参数打印文件的前K个字节如果是-K则去除末尾K字节打印前面所有字节。 -c, --bytes[-]K print the first K bytes of each file;with the leading -, print all but the lastK bytes of each file# 末尾有个回车符 $ cat test_head 1234567890 $ head -c 3 test_head 123$ $ head -c -3 test_head 12345678$ -n 参数打印文件的前K行如果是-K则去除末尾K行打印前面所有行。 -n, --lines[-]K print the first K lines instead of the first 10;with the leading -, print all but the lastK lines of each file$ cat test_head 1234567890 234567890 34567890 4567890 567890 $ head -n 2 test_head 1234567890 234567890 $ head -n -2 test_head 1234567890 234567890 34567890三、tail tail --help Usage: tail [OPTION]... [FILE]... Print the last 10 lines of each FILE to standard output. With more than one FILE, precede each with a header giving the file name. With no FILE, or when FILE is -, read standard input.Mandatory arguments to long options are mandatory for short options too.-c, --bytesK output the last K bytes; or use -c K to outputbytes starting with the Kth of each file-f, --follow[{name|descriptor}]output appended data as the file grows;an absent option argument means descriptor-F same as --followname --retry-n, --linesK output the last K lines, instead of the last 10;or use -n K to output starting with the Kth--max-unchanged-statsNwith --followname, reopen a FILE which has notchanged size after N (default 5) iterationsto see if it has been unlinked or renamed(this is the usual case of rotated log files);with inotify, this option is rarely useful--pidPID with -f, terminate after process ID, PID dies-q, --quiet, --silent never output headers giving file names--retry keep trying to open a file if it is inaccessible-s, --sleep-intervalN with -f, sleep for approximately N seconds(default 1.0) between iterations;with inotify and --pidP, check process P atleast once every N seconds-v, --verbose always output headers giving file names--help display this help and exit--version output version information and exitIf the first character of K (the number of bytes or lines) is a , print beginning with the Kth item from the start of each file, otherwise, print the last K items in the file. K may have a multiplier suffix: b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024, GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.With --follow (-f), tail defaults to following the file descriptor, which means that even if a tailed file is renamed, tail will continue to track its end. This default behavior is not desirable when you really want to track the actual name of the file, not the file descriptor (e.g., log rotation). Use --followname in that case. That causes tail to track the named file in a way that accommodates renaming, removal and creation.功能概述 -n显示文件的最后 n 行默认为 10 行。-f实时追踪文件的变化并输出新增的内容。-q不显示文件名。-s设置输出的间隔时间秒。-c以字节为单位显示指定范围的内容。 实例可用于删除文件开头指定大小的内容 -c 参数打印文件的后K个字节如果是K则从第K个字节开始打印所有后面的内容。 -c, --bytesK output the last K bytes; or use -c K to outputbytes starting with the Kth of each file重点 经验证0和1都表示从第一个字节开始和cat功能一样。可用于删除文件前面的内容输出到新文件 如需删除文件前面的K字节则参数为(K1) $ cat test_tail 1234567890 $ tail -c 3 test_tail 90 $ tail -c 3 test_tail 34567890 $ tail -c 0 test_tail 1234567890 $ tail -c 1 test_tail 1234567890-f 参数实时追踪文件的变化并输出新增的内容。可指定显示几行文件中的内容。 -f, --follow[{name|descriptor}]output appended data as the file grows;an absent option argument means descriptor$ cat test_tail 1234567890 234567890 34567890 4567890 567890 $ tail -2f test_tail 4567890 567890 -n 参数显示文件的最后 n 行默认为 10 行。 -n, --linesK output the last K lines, instead of the last 10;or use -n K to output starting with the Kth$ cat test_tail 1234567890 234567890 34567890 4567890 567890 $ tail -n 3 test_tail 34567890 4567890 567890四、dd dd --help Usage: dd [OPERAND]...or: dd OPTION Copy a file, converting and formatting according to the operands.bsBYTES read and write up to BYTES bytes at a timecbsBYTES convert BYTES bytes at a timeconvCONVS convert the file as per the comma separated symbol listcountN copy only N input blocksibsBYTES read up to BYTES bytes at a time (default: 512)ifFILE read from FILE instead of stdiniflagFLAGS read as per the comma separated symbol listobsBYTES write BYTES bytes at a time (default: 512)ofFILE write to FILE instead of stdoutoflagFLAGS write as per the comma separated symbol listseekN skip N obs-sized blocks at start of outputskipN skip N ibs-sized blocks at start of inputstatusLEVEL The LEVEL of information to print to stderr;none suppresses everything but error messages,noxfer suppresses the final transfer statistics,progress shows periodic transfer statisticsN and BYTES may be followed by the following multiplicative suffixes: c 1, w 2, b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024, xM M GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.概述 if 表示输入文件of 表示输出文件options 是一些可选参数。下面是一些常用的参数 bs设置每次读取和写入的块大小单位为字节或者是可以添加的后缀如b、k、m等默认为512字节。count设置要复制的块数。iflag设置输入选项常用的选项有direct绕过缓存直接读取和sync同步数据到磁盘。oflag设置输出选项常用的选项有direct绕过缓存直接写入和sync同步数据到磁盘。 五、应用 1. 清空文件内容 echo 文件名 echo 文件名 cat /dev/null 文件名 truncate -s 0 文件名 dd if/dev/null of文件名

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/913549.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

如何做网站线上监控金融棋牌网站建设

缓存系统MemCached的Java客户端优化历程(转载自http://code.google.com/p/memcache-client-forjava/。)Memcached是一种集中式Cache,支持分布式横向扩展。这里需要解释说明一下,很多开发者觉得Memcached是一种分布式缓存系统&…

手机网站分页明年开春有望摘口罩

C/C__VA_ARGS__学习--自动打印函数的参数和返回值 一.参考二.输出三.代码 通过__VA_ARGS__,自动打印函数的参数和返回值 一.参考 c/c:提取可变参数宏__VA_ARGS__中偶数位置参数 二.输出 input:A StructA StructA[1,2,3,4,10,11,12,13,] input:B StructB* StructB[26,27,28,…

阳谷聊城网站优化php网站开发课程

一、需求 点击链接跳转,只点击标红区域才跳转,右侧空白区域不要跳转 二、实现 宽度太宽,导致右侧空白区域也加了跳转效果,修改为 将元素的最大宽度设置为其内容所需的宽度。 方法一:建议方式 使用 display: inline…

网站文风网站建设技术员工资

传送门 首先那个\(O(n^2)\)的dp都会吧,不会自己找博客或者问别人,或是去做模板题(误) 对以下内容不理解的,强势推荐flash的博客 我们除了原来记录最长上升子序列的\(f_{i,j}\),再记\(g_{i,j}\)表示到\(i,j\)时的最长上升子序列个数,同时设两个字符串为\(A,B\) 若\(A_iB_j\) ,则…

龙岗网站多少钱手机小游戏网站大全

生成式 AI 是一项惊人的技术,但它并非万能。在这个视频中,我们将仔细看看大型语言模型(LLM)能做什么,不能做什么。我们将从我发现的一个有用的心理模型开始,了解它能做什么,然后一起看看 LLM 的…

哪些行业做网站的多ps怎么做网站视频特效

1. 工厂模式介绍 工厂模式(Factory Pattern)的意义就跟它的名字一样,在面向对象程序设计中,工厂通常是一个用来创建其他对象的对象。工厂模式根据不同的参数来实现不同的分配方案和创建对象。 在工厂模式中,我们在创建…

百度网站的优缺点设计说明书模板

上一小节介绍了怎么使用 Python 读取多维表的数据,看似可以成功获取到了所有的数据,但是在实际生产使用过程中,我们会发现,上一小节的代码并不能获取到所有的多维表数据,它只能获取一页,默认是第一页。因为…

hao123网站浙江省建设厅网站资质迁移

背景介绍 至尊宝和紫霞仙子是电影《大话西游》中的人物。该电影讲述了至尊宝放弃戴上金箍成为盖世英雄,选择当一个凡人,与‌紫霞仙子长相厮守的故事。这部电影通过奇幻、冒险、喜剧和悲剧的元素,展现了一段跨越时空的爱情故事,充…

婚介网站建设的策划中国前十强企业

macOS 12 Monterey是苹果公司的一次重大突破,它打破了设备间的壁垒,将不同设备无缝地连接在一起,极大地提升了用户的工作效率和娱乐体验。Monterey带来了通用控制、AirPlay、捷径等新功能,以及一些实用的新小功能。 安装&#xf…

动漫php网站模板seo公司

这里写目录标题 一、前言二、下载三、简要总结 一、前言 原文以及该系列后续文章请参考:安装Electron 随着前端的不断强盛,现在的前端已经不再满足于网页开发了,而是在尝试能否使用前端的开发逻辑来开发PC端的桌面软件。 即用html、js、css…

大丰区住房和城乡建设局网站虾米播播支持wordpress吗

期待已久的时刻已经到来,现在我们很高兴地宣布, CUBA平台终于加入了自由软件社区! 从现在开始,平台的所有运行时部分都是开源的,并根据Apache 2.0许可进行分发。 这意味着您将完全可以免费创建和分发应用程序&#xff…

Hetao P10588 十载峥嵘桀骜 题解 [ 紫 ] [ 树的直径 ] [ 矩阵加速 DP ] [ 状态设计优化 ]

十载峥嵘桀骜:感觉挺简单的,就是代码处理比较繁琐。 一个最简单的部分分是暴力模拟建图之后跑矩阵快速幂转移,时间复杂度 \(O(n^3\log t)\),随便拼点其他特殊性质就能 68pts 了。 考虑正解,结合树的直径的 DFS 求…

GO学习记录九——数据库触发器的运用+redis缓存策略

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

顺德网站建设哪家好深圳龙岗网络

问题 今天在使用lombok简化model类时。使用Builder建造者模式。报以下异常 解决办法。 去掉NoArgsConstructor添加AllArgsConstructor源码分析 下图是编译后的源码 只使用Builder会自动创建全参构造器。而添加上NoArgsConstructor后就不会自动产生全参构造器

用 Julia 提取轮廓和字符特征进行验证码识别

验证码图像中的字符常常被干扰线穿插、扭曲变形,导致传统的二值化 + OCR 方法失效。为了解决这类问题,我们可以借助轮廓提取技术,分析字符的几何结构,通过区域形状进行字符识别。本篇博客介绍如何使用 Julia 实现轮…

深入解析:269-基于Python的58同城租房信息数据可视化系统

深入解析:269-基于Python的58同城租房信息数据可视化系统2025-09-23 18:51 tlnshuju 阅读(0) 评论(0) 收藏 举报pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important…

企业网站建设的实践意义哪里有做网站系统的

FastAPI 概述 参考文档: 中文文档轻松上手Python的Web神器:FastAPI教程 介绍 FastAPI 是一个基于 Python 的现代 Web 框架,它具有快速构建高性能 API 的特点。 FastAPI 关键特性: 快速:可与 NodeJS 和 Go 并肩的极高性能&am…

吉林集安市建设局网站哈尔滨网站优化对策

jax可微分编程的笔记(8) 第八章 循环神经网络 神经网络是可微分编程中最为重要的模型构造形式,也是当代 深度学习的基本组成部分,深度学习中的“深度”一词,便是对 神经网络的层数的形容。 8.1 神经网络的生物学基础 通过层层近似&#x…

建设执业资格注册管理中心网站wordpress 两栏

欢迎来到设计模式系列的第三篇文章!在前两篇文章中,我们已经学习了设计模式的基本概念以及单例模式的应用。 今天,我们将深入探讨第二个模式——工厂方法模式。 工厂方法模式简介 工厂方法模式是一种创建型设计模式,它提供了一…

你有网站 我做房东 只收佣金的网站电商平台建设费用

概念 ToF 是 Time of Flight 的缩写, ToF 测量法又被称作飞光时间测量法,是通过给目标连续发射激光脉冲,然后用传感器接收在被测平面上反射回来的光脉冲,通过计算光脉冲的飞行往返时间来计算得到确切的目标物距离。因为返回时间很…