ubuntu search and java write to file

  1. The indexed way: locate -i process.txt (run sudo updatedb to update indexes but Ubuntu update it everyday via cron ).
  2. Or search with find . -iname 'process.txt' -print if it is in the current folder.
  3. You can change it to find / -iname 'process.txt' -print to search from root.
public static void writeFile2() throws IOException {
	FileWriter fw = new FileWriter("out.txt");
 
	for (int i = 0; i < 10; i++) {
		fw.write("something");
	}
 
	fw.close();
}
原文地址:https://www.cnblogs.com/goldengallo/p/6493426.html