- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Trimming filles
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp
Knowledge Base
Discussions
Forums
Discussions
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
Discussion Boards
Community
Resources
Forums
Blogs
- 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
08-11-2006 03:00 AM
08-11-2006 03:00 AM
Is there any was ti trim a file let's say the file is 1MB and i want to trimit to 500kb, I know that this could be done via SAM, but is there a way to do it via command line.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2006 03:04 AM
08-11-2006 03:04 AM
SolutionThis thread should help you out,
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1033864
Regards,
Jaime.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2006 03:05 AM
08-11-2006 03:05 AM
Re: Trimming filles
mv file2 file
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2006 03:06 AM
08-11-2006 03:06 AM
Re: Trimming filles
As a one off:
either
use vi or tail -xxxxx > tempfile
or
split the file into chunks the size you want then cp the final split to the original file.
see man split
For the more elegant solution I'd stick to SAM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2006 03:10 AM
08-11-2006 03:10 AM
Re: Trimming filles
If we assume that you are talking about ASCII files, 'sed' or 'perl' are easily leveraged. For instance, consider a 1000-line file where you want to preserve only the last 500 lines:
# sed -ne '501,$p' file
With Perl:
# perl -ni -e 'print if $. > 501'
The perl script will update your file "in-place' leaving a trimmed copy.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2006 03:19 AM
08-11-2006 03:19 AM