How to add content of one file into another file at the beginning
Answers were Sorted based on User's Feedback
Answer / tejaswa
Hi Durgesh, by this command you can add the content at the end of file2 not in the beginning.
| Is This Answer Correct ? | 16 Yes | 4 No |
Answer / pritam sahu
cat fil2 file1>>file3 then rename the file3 as file2 by mv
file3 file2.
| Is This Answer Correct ? | 6 Yes | 2 No |
Answer / dick
concatenate file1 and file2, in the below command file1 content will be insert in front of that in file2, and then combined content will be redirected to file3
cat file1 file2 > file3
| Is This Answer Correct ? | 8 Yes | 5 No |
Answer / preet mala
If we want to add content of file1 at the beginning of file2
then use the following command:-
cat file2 file1 >> file3 | mv file3 file2;
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / rakesh kumar ray
cat > file1
rakesh
kumar
ray
cntrl + d
cat > file2
rintu
rohan
rocky
cntrl +d
cat < file1 > file2
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / green
(To insert file2 content to file1; then the command is)
vi file1
(in command mode)
:0 r! cat file2 (press enter)
( file2 content is inserted to file1 )
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ahmed
Use sed command
sed -i'' '1 i this is firts line' temp123
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / abhishek bhardwaj
If one wants to add content of file1 on top of file2 then
cat file2 >> file1
| Is This Answer Correct ? | 0 Yes | 2 No |
Write a command to find all of the files which have been accessed within the last 30 days.
5 Answers Google, IBM, Satyam,
when we installing aix os the ssh installed default?
Is there any command in Unix, other than:ls, to list the files in a directory? The answer will be highly appreciated...
Write a command that will find all text files in a directory such that it does not contain the word "amazing" in any form (that is, it must include the words amazing, amazing, or amazing)?
What is rmdir command?
What is shrinking file system in AIX where it actually resides?
How do I delete files from command prompt?
what do you understand bythe term 'de-mountable volumes'?
What is pipe command in unix?
Is command prompt unix?
If JFS file system is 100% full how we can increase the file system ?
What is awk used for?