Tag Info

New answers tagged

0

This will append to the file: echo "some text" >> someFile.txt This will overwrite to the file: echo "some text" > someFile.txt This will append text from one file to another: cat someFile.txt >> someOtherFile.txt This will overwrite text from one file to another: cat someFile.txt > someOtherFile.txt


0

Most *nix systems support a few CLI text editors, the most common of which is vi and vim. See here (and google for about a thousand others) for a tutorial on vi. http://www.howtogeek.com/102468/a-beginners-guide-to-editing-text-files-with-vi/ Another really common one, especially for programmers is emacs. Tutorial here: ...


1

On most OS's this is done with redirect commands, almost always these are > to over-write any existing file, or >> to append to a file. Lookup pipes and redirects for more info. Not a Mac expert but since MacOS is largely unix these days I imagine it will be the same.


1

Use the xargs command. To pass the file names from a file to a cp command we can do: cat 'file_name'| args -I % cp % destination_directory But if you want to see the how it would echo then: cat 'file_name' | args -I % echo cp % destination_directory This will just echo.



Top 50 recent answers are included