|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
remove the contents of a file
Hi
Let say a flat file contains 1000 lines. The cursor is at the 530 line number. Now I like to delete all the line at one ahot. how it can be done? |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
You want to empty the file ? At the prompt give Code:
> file.name Within the editor (say vi), give Code:
:g/.*/d |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Quote:
or u can type something like this: # cat /dev/null > filename where "filename" is the file u want to empty at one shot ![]() |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to copy a file without remove the contents of the target file? | ahmedamer12 | UNIX for Dummies Questions & Answers | 2 | 04-22-2011 05:19 PM |
| Remove lines based on contents of another file | bashshadow1979 | Shell Programming and Scripting | 4 | 03-25-2009 12:32 PM |
| Compare two files and remove all the contents of one file from another | royalibrahim | Shell Programming and Scripting | 3 | 11-17-2008 11:55 PM |
| Remove spaces from first field, and write entire contents into other text file | carriehoff | Shell Programming and Scripting | 3 | 11-11-2008 01:45 PM |
| Query:just need to remove the contents of the file without deleting that | namishtiwari | Shell Programming and Scripting | 3 | 02-04-2008 04:41 AM |
|
|