- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: strange output to file behaviour.
Operating System - Linux
1753840
Members
9138
Online
108806
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2009 04:50 PM
тАО06-17-2009 04:50 PM
Hi All
The following commands work as I expect them to:
free >> free1.out
free | grep "ers/c" >> free2.out
free -s 5 >> free3.out
The last command continually adds to the file.
BUT
This command will not update the output file:
free -s 5 | grep "ers/c" >> free4.out
It displays to the screen ok, but I am unable to redirect it to a file. Why not?
The following commands work as I expect them to:
free >> free1.out
free | grep "ers/c" >> free2.out
free -s 5 >> free3.out
The last command continually adds to the file.
BUT
This command will not update the output file:
free -s 5 | grep "ers/c" >> free4.out
It displays to the screen ok, but I am unable to redirect it to a file. Why not?
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2009 08:35 PM
тАО06-17-2009 08:35 PM
Solution
> [...] Why not?
Perhaps because the fancy-shmancy GNU "grep"
is too clever by half:
debi# uname -a
Linux debi 2.6.26-2-mckinley #1 SMP Fri Mar 27 05:13:51 UTC 2009 ia64 GNU/Linux
debi# date ; free -s 5 | grep 'ers/c' | cat ; date
Wed Jun 17 23:29:10 CDT 2009
^C
Wed Jun 17 23:29:25 CDT 2009
debi# date ; free -s 5 | grep --line-buffered 'ers/c' | cat ; date
Wed Jun 17 23:29:46 CDT 2009
-/+ buffers/cache: 184816 16495696
-/+ buffers/cache: 188544 16491968
-/+ buffers/cache: 187040 16493472
^C
Wed Jun 17 23:29:57 CDT 2009
Perhaps because the fancy-shmancy GNU "grep"
is too clever by half:
debi# uname -a
Linux debi 2.6.26-2-mckinley #1 SMP Fri Mar 27 05:13:51 UTC 2009 ia64 GNU/Linux
debi# date ; free -s 5 | grep 'ers/c' | cat ; date
Wed Jun 17 23:29:10 CDT 2009
^C
Wed Jun 17 23:29:25 CDT 2009
debi# date ; free -s 5 | grep --line-buffered 'ers/c' | cat ; date
Wed Jun 17 23:29:46 CDT 2009
-/+ buffers/cache: 184816 16495696
-/+ buffers/cache: 188544 16491968
-/+ buffers/cache: 187040 16493472
^C
Wed Jun 17 23:29:57 CDT 2009
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2009 08:36 PM
тАО06-17-2009 08:36 PM
Re: strange output to file behaviour.
> This command will not update the output file:
Check back again tomorrow. (Could be a
pretty big buffer.)
Check back again tomorrow. (Could be a
pretty big buffer.)
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP