The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
shell script to process file line by line royalsing UNIX for Dummies Questions & Answers 5 09-17-2008 04:22 AM
Deleting Junks at the end of each line in a file dave_nithis UNIX Desktop for Dummies Questions & Answers 5 10-05-2007 02:51 AM
Urgent help required in deleting a line without opening a file usinga shell script naan Shell Programming and Scripting 6 07-20-2006 03:42 AM
Deleting end line spaces for along file osymad Shell Programming and Scripting 3 02-23-2005 01:56 PM
how to replace a line in a file using shell script cs_sakthi UNIX for Advanced & Expert Users 3 01-27-2002 11:57 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-18-2009
badrimohanty badrimohanty is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 17
Shell Script for deleting the first line in a file

Hi,

Could any one please post the shell script for deleting the first line in a file?
  #2 (permalink)  
Old 06-18-2009
redoubtable redoubtable is offline
Registered User
  
 

Join Date: Aug 2008
Location: Portugal
Posts: 242
Code:
sed -e '1d' filename > new_filename_without_the_first_line
  #3 (permalink)  
Old 06-18-2009
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,119
Code:
printf '1d\n.\nwq!\n' | ex myFile
  #4 (permalink)  
Old 06-18-2009
pritish.sas pritish.sas is offline
Registered User
  
 

Join Date: Dec 2008
Location: Mumbai
Posts: 44
try it

sed -i '1d' filename

---------- Post updated at 08:56 PM ---------- Previous update was at 08:55 PM ----------

Quote:
Originally Posted by badrimohanty View Post
Hi,

Could any one please post the shell script for deleting the first line in a file?

sed -i '1d' filename
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:33 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0