- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- delete duplicates ..
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
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
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
02-26-2002 07:43 AM
02-26-2002 07:43 AM
quick on here ..
I have a list of numbers like
1
1
1
2
2
3
3
3
4
4
4
4
I need to delete the duplicates and just endup with one of each
1
2
3
4
Thanks
Richard
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2002 07:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2002 07:51 AM
02-26-2002 07:51 AM
Re: delete duplicates ..
man uniq
Hope this helps.
...jcd...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2002 07:52 AM
02-26-2002 07:52 AM
Re: delete duplicates ..
that vi sort is great! I learned something new, thing my boss will let me go home for the day?
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2002 07:53 AM
02-26-2002 07:53 AM
Re: delete duplicates ..
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2002 07:58 AM
02-26-2002 07:58 AM
Re: delete duplicates ..
You can run ANY command like that, too..
Want to put a directory listing in the file you are editing? Here's how:
:.!ls -l
(make sure you are on a clean line, or it get's whacked).
In general, you send a range to the command after the bang, then any ouput get's inserted back into your current buffer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2002 08:03 AM
02-26-2002 08:03 AM
Re: delete duplicates ..
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2002 09:11 AM
02-26-2002 09:11 AM
Re: delete duplicates ..
that's sweet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2002 10:56 AM
02-26-2002 10:56 AM
Re: delete duplicates ..
in window mode (editing, not input)
replace the current line with the uname output
!!uname -a
Sort the contents of a file immediately after opening
!Gsort -u
No problem to put pipes in there too.
Take out the dups (including symlinks) and nonexisting directories in a directory listing:
!Gperl -ne '-d&&$P{$_}++==0&&push@P,$_;}END{print join":",@P;'
If the command is to be pasted from a nice mail someone sent you, open a new line and paste that text into that line, then delete the complete line into a named buffer (say m) and execute the command using "@m"
So if the current display has a line containing
:r /tmp/swagent.log
and you delete the line using
"mdd
you can now go to the line after wich you want the contents of /tmp/swagent.log inserted and type
@m
More tips like these can be found on a well written place like http://www.networkcomputing.com/unixworld/tutorial/009/009.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2002 07:03 PM
02-26-2002 07:03 PM
Re: delete duplicates ..
G
:r! spell
In fact, you can assing this to an unused vi command in your .exrc file. The example uses S since this isn't defined in vi:
map S G:w!^M:r!spell %^M
The ^M are literal carriage returns and must be added using the CTRL-V option flag in vi.
For word processing, you can use the adjust command to format paragraphs using word wrap:
!)exec adjust -m60
This command starts on the current line and works to the end of the paragraph (next blank line), adjusting the righthand margin to no more than 60 characters but breaking the lines on a word boundary. adjust is fairly coll in that it pays attention to indents.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2002 07:33 PM
02-26-2002 07:33 PM
Re: delete duplicates ..
:w !spell -b
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2002 08:04 PM
02-26-2002 08:04 PM
Re: delete duplicates ..
Richard