Home>Article>Operation and Maintenance> How to create a new file in linux
how to create a new file: 1. use the redirection character ">" file, syntax is "> file name"; 2. touch command "touch 3 , use echo file; 4. printf 5. cat 6. vi vim 7. nano 8. head ;9. tail 10. truncate file. < p>< blockquote>
< p>
#the operating environment of this tutorial: linux7.3 system, dell g3 computer.
we all know that on linux, everything including devices are files. linux administrators should perform creation activities multiple times per day (perhaps 20, 50, or even more, depending their environment).
efficiently creating very important ability. why do i say efficient? if you few ways your current efficiently, can more with less. this will save lot time. you useful time other things.
the following introduce methods files linux. suggest choose simple and efficient ones assist work. not need install any commands as they already installed system part core tools.
creating be done in six ways:
>< code>: the standard allows us an empty 0kb. li>touch< does exist, code> 0kbecho< display line text through parameter.printf< used display given terminal.cat< it concatenates prints output.vi<vim< vim editor upward compatible vi. commonly used for editing various types plain text.nano< user-friendly editor. replicates look benefitspico< code>, but free software.head< print beginningtail< lasttruncate< reduce expand size specified size. ul>creating using (>) linux< strong>< h2>
the typically redirect output when symbol without command, it creates >but allow enter into when it. however less diligent administrators. just followed by name want.
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn