![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| file command | rprajendran | UNIX for Advanced & Expert Users | 3 | 05-13-2008 10:45 AM |
| rm command not able to remove file | jambesh | Shell Programming and Scripting | 7 | 12-21-2007 03:37 AM |
| VI command for File Please | $Circle$ | UNIX for Dummies Questions & Answers | 12 | 09-05-2005 01:23 AM |
| End of file using more command | Enda Martin | UNIX for Dummies Questions & Answers | 3 | 06-18-2001 07:49 AM |
| for file in ???? - command | tamer | UNIX for Dummies Questions & Answers | 10 | 01-31-2001 05:40 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
I don't know a specific command, but this one liner works fine in sh, bash, and tcsh (a bunch of other shells too):
Code:
( echo "Line to add" ; cat targetfile ) > tempfile ; cat tempfile > targetfile ; rm -f tempfile |
|
|||
|
existing file filename "file_one.dat"
which contains AMITH ARUN ARVIND I am adding "I LOVE PIZZA" in the first line of this file Here it is: echo "I LOVE PIZZA" | cat > tempfile ; cat file_one.dat >> tempfile ; mv tempfile file_one.dat Result: I LOVE PIZZA AMITH ARUN ARVIND |
|||
| Google The UNIX and Linux Forums |