LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Closed Thread
  Search this Thread
Old 04-24-2016, 02:58 PM   #1
PleaseHelpMeUnderstand
Member
 
Registered: Apr 2016
Posts: 32

Rep: Reputation: 0
Redirection and piping help please


I want to write a command (one command) that would take a long listing of the /etc directory, but select only the last 5 entries (last 5 lines) in the directory AND save the results to a file named: etclisting in my current directory.

Would my command ls -l /etc | tail -5 >> etclisting be sufficient for this?

Last edited by PleaseHelpMeUnderstand; 04-24-2016 at 03:18 PM.
 
Old 04-24-2016, 03:13 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,680

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Continue here:
http://www.linuxquestions.org/questi...ng-4175578232/
 
  


Closed 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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Redirection and piping PleaseHelpMeUnderstand Linux - Newbie 5 04-25-2016 08:28 AM
Linux piping vs Windows piping emanabela Linux - Newbie 1 05-10-2009 12:58 PM
piping | jezz Linux - General 2 05-04-2008 04:28 AM
Piping ls Kcghost Linux - General 9 03-05-2008 07:24 PM
Piping + redirection teddyZA Linux - General 6 04-10-2007 01:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:50 PM.

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