LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-06-2007, 02:09 AM   #1
Dee-ehn
Member
 
Registered: Apr 2004
Distribution: Suse 9 pro
Posts: 52

Rep: Reputation: 15
Bash scripting, deleting an entry from a list


Hi,

In a bash script, I use the following line:
Code:
ls -al | awk {'print $1'}
.

Now I want to remove the first 3 lines from the list this outputs. How can I do that?

I figured I can use the tail command, but on certain input, tail seems to struggle (leading "-" characters).

TIA!
 
Old 04-06-2007, 03:40 AM   #2
almatic
Member
 
Registered: Mar 2007
Distribution: Debian
Posts: 547

Rep: Reputation: 67
try this:

ls -al | awk {'print $1'} | sed -n '4,$p'
 
Old 04-06-2007, 06:15 AM   #3
Dee-ehn
Member
 
Registered: Apr 2004
Distribution: Suse 9 pro
Posts: 52

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by almatic
try this:

ls -al | awk {'print $1'} | sed -n '4,$p'
Thanks a lot, that really did the trick!!!
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete quota entry when deleting user weotch Linux - Software 5 10-26-2012 08:38 AM
Bash scripting problem: Can't get a list of all files, including hidden ones oxi Programming 24 03-12-2007 06:19 AM
Seg Fault in GCC when deleting Node from Linked List gren838 Programming 2 12-11-2005 04:21 PM
sources.list entry format for suse 9.2.9 repository TomF SUSE / openSUSE 4 04-06-2005 04:49 PM
HCL entry not on list webwolf70 LQ Suggestions & Feedback 10 07-01-2004 08:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration