In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to create files in Linux". In daily operation, I believe many people have doubts about how to create files in Linux. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts about "how to create files in Linux". Next, please follow the editor to study!
First of all, touch creates one file touch yyTest.ini simultaneously creates two files touch test1.txt test2.txt batch creation files (such as creating 2000 files) touch test {0001... 2000} .txt change the file yyTest.ini time to the current time (yyTest.ini already exists) touch yyTest.inivi and vim here do not expand the explanation vi and vim, the blog posts will be supplemented later
Vi test.txt vim touch.txt uses > to overwrite the original file directly without any prompt.
> > append to the end of the original file and will not overwrite the contents of the original file
Create a file directly with > create empty file > test.inils (write result to file) ls > test.inils > > test.inigrep create file (write result to file) ps-ef | grep java > test.ini ps-ef | grep java > > test.iniecho create file (write result to file) echo $PATH > test.iniecho $PATH > > test.ini creates a file using cp to create a file as long as the target file is a new file For detailed command interpretation of cp, please see this blog post: https://www.cnblogs.com/poloyy/p/12514389.html
Using cat to create files is easy to use >, > cat > test.inicat > > test.ini is also useful > and > >, but there is one difference: after typing the above command, you will enter the editing mode of test.ini. You can enter the content you want to write directly, and finally press ctrl+z to exit the editing mode to save automatically.
Cat combined with eofcat > > test.ini eof can be used as a delimiter, stop input when you encounter the next delimiter; case-same oh cat combined with exit and eof synonymous cat > > test.ini so far, the study on "how to create a file for Linux" is over, hoping to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.