Linux shell create file methods

touch, cat, echo, EOF

touch

$ touch file.py

$ touch file1.txt file2.txt file3.txt

$ > empty_file.md

cat

$ cat > file.md

Heredoc

$ cat << EOF > file1.txt
Some line
Some other line
EOF

echo

$ echo "Some lines" > file.md

$ echo file.md

EOF

$ cat > test.py <<EOF
# coding: utf8 __author__ = 'xgqfrms'
__editor__ = 'vscode'
__version__ = '1.0.1'
__copyright__ = """
Copyright (c) 2012-2050, xgqfrms; mailto:xgqfrms@xgqfrms.xyz
"""
EOF

dd

$ dd if=/dev/zero of=1G.test bs=1 count=0 seek=1G

fallocate

$ fallocate -l 1G 1G.test

refs

https://linuxize.com/post/create-a-file-in-linux/



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


Linux shell create file methods的更多相关文章

  1. run commands in linux shell using batch file

    adb shell as root after device rooted once device rooted, we must perform "su" before we g ...

  2. Linux系统Vsftp 传文件出现 553 Could Not Create File错误的解决方法

    解决方法: 登录出现了这个错误提示:553 Could not create file SELinux设置如下 查看SELinux设置 [root@localhost ~]# getsebool -a ...

  3. linux中ftp提示--553 Could not create file

    今天在阿里云的linux上搭建ftp服务的时候,搭建成功之后,上传文件时总提示553 Could not create file,找了半天原因,终于解决了 ftp主目录为/home/myftp /ho ...

  4. Linux / UNIX create soft link with ln command

    How to: Linux / UNIX create soft link with ln command by NIXCRAFT on SEPTEMBER 25, 2007 · 42 COMMENT ...

  5. Bash For Loop Examples for Your Linux Shell Scripting--ref

    There are two types of bash for loops available. One using the “in” keyword with list of values, ano ...

  6. Linux shell日常命令和技巧

    转自:http://www.vaikan.com/linux-shell-tips-and-tricks/ 原文:http://www.techbar.me/linux-shell-tips/ 使用L ...

  7. linux shell编程总结

    linux shell编程总结 本周学习了unix/linux shell编程,参考的是<LINUX与UNIX Shell 编程指南>,David Tansley著:徐焱,张春萌等译,由机 ...

  8. Linux Shell 文件描述符 及 stdin stdout stderr 重定向

    Abstract: 1) Linux Shell 命令的标准输入.标准输出.标准错误,及其重定位: 2)Linux Shell 操作自定义文件描述符: 文件描述符是与文件相关联的一些整数,他们保持与已 ...

  9. Linux Shell 笔记

    1.查看进程的环境变量 普通:$cat /proc/1642/environ  换行:$cat /proc/1642/environ | tr '\0' '\n' tr的命令格式是tr SET1 SE ...

随机推荐

  1. python基础之 列表、元组操作 字符串操作 字典操作 集合操作 文件操作 字符编码与转码

    本节内容 列表.元组操作 字符串操作 字典操作 集合操作 文件操作 字符编码与转码 1. 列表.元组操作 列表是我们最以后最常用的数据类型之一,通过列表可以对数据实现最方便的存储.修改等操作 定义列表 ...

  2. 控制反转 依赖注入 main函数

    通过依赖注入.服务定位实现控制反转 Go kit - Frequently asked questions https://gokit.io/faq/ Dependency Injection - W ...

  3. 线上一次大量 CLOSE_WAIT 复盘

    https://mp.weixin.qq.com/s/PfM3hEsDa3CMLbbKqis-og 线上一次大量 CLOSE_WAIT 复盘 原创 ms2008 poslua 2019-07-05 最 ...

  4. Dubbo 总结:关于 Dubbo 的重要知识点

    一 重要的概念 1.1 什么是 Dubbo? Apache Dubbo (incubating) |ˈdʌbəʊ| 是一款高性能.轻量级的开源Java RPC 框架,它提供了三大核心能力:面向接口的远 ...

  5. LOJ10099矿场搭建

    HNOI 2012 煤矿工地可以看成是由隧道连接挖煤点组成的无向图.为安全起见,希望在工地发生事故时所有挖煤点的工人都能有一条出路逃到救援出口处.于是矿主决定在某些挖煤点设立救援出口,使得无论哪一个挖 ...

  6. Codeforces Round #628 (Div. 2) B. CopyCopyCopyCopyCopy(Set)

    题意: 给你一个数组,可以像题目那样无限拼接,问递增子序列的最大长度(可不连续). 思路: 序列的最大长度即为数组中不同元素的个数. Tips: 一开始不知道back-to-back什么意思,看到题目 ...

  7. 2020牛客暑期多校训练营(第四场)BCFH

    BCFH B. Basic God Problem 题意 给出c和n,求fc(n). 题解 递归到最后 fc 函数肯定等于1,那么就变成了求c被乘了几次,只要找到 x 最多能被分解成多少个数相乘就好了 ...

  8. Codeforces 1355 E. Restorer Distance(三分)

    传送门:E - Restorer Distance  题意:给出四个数 N, A, R, M ,然后给出一个长度为N的序列.让一个数+1花费A,-1花费R,从一个大的数向一个小的数移动1花费M.问让所 ...

  9. zjnuSAVEZ (字符串hash)

    Description There are eight planets and one planetoid in the Solar system. It is not a well known fa ...

  10. Codeforces Round #529 (Div. 3) C. Powers Of Two (二进制)

    题意:给你一个数\(n\),问是否能有\(k\)个\(2\)次方的数构成,若满足,输出一种合法的情况. 题解:从高到低枚举二进制的每一位,求出\(n\)的二进制的\(1\)的位置放进优先队列中,因为\ ...