Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9225679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:38:28+00:00 2026-06-18T04:38:28+00:00

I wanna save this command to another text: awk ‘{print $2}’ it extract’s from

  • 0

I wanna save this command to another text:
awk ‘{print $2}’
it extract’s from text.
now i wanna save output too another text.
thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:38:30+00:00Added an answer on June 18, 2026 at 4:38 am
    awk '{ print $2 }' text.txt > outputfile.txt
    

    > => This will redirect STDOUT to a file. If file not exists, it will create it. If file exists it will clear out (in effect) the content and will write new data to it

    >> => This means same as above but if file exists, this will append new data to it.

    Eg:

    $ cat /etc/passwd | awk -F: '{ print $1 }' | tail -10 > output.txt
    $ cat output.txt 
    _warmd
    _dovenull
    _netstatistics
    _avbdeviced
    _krb_krbtgt
    _krb_kadmin
    _krb_changepw
    _krb_kerberos
    _krb_anonymous
    _assetcache
    

    Alternatively you can use the command tee for redirection. The command tee will redirect STDOUT to a specified file as well as the terminal screen

    For more about shell redirection goto following link:

    http://www.techtrunch.com/scripting/redirections-and-file-descriptors

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My question is I wanna apply strategy pattern to save log from Image above
I wanna execute this query: String query = select login,full_name from users where team_id='
I wanna run selenium tests from TeamCity using Maven at Linux server without display.
I want to check if my subgrid exists (is expanded). I wanna do this
This test checks if only one SP ends with Insert, Load, or Save, then
I wanna to save some files as saved searches or saved items(some binary files
I have a question about NSUserDefault. Currently, i wanna write a function which save
I wanna log the emails which are being sent from a particular method of
I have an array of objects where I wanna only save a sub object
i need to save a simple field to configurate my APP, cause this, i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.