sort -u -t, -k1,1 file
-u
for unique-t,
so comma is the delimiter-k1,1
for the key field 1
Test result:
[email protected],2009-11-27 00:58:29.793000000,xx3.net,255.255.255.0
[email protected],2009-11-27 01:05:47.893000000,xx2.net,127.0.0.1
More Related Contents:
- Sorting on the last field of a line
- create a file with prefix =file1 followed by the random number
- Why to code a script which will check if some package is installed in linux and if not then install it?
- How to pass command output as multiple arguments to another command
- Get exit code of a background process
- Is there a way to change the environment variables of another process in Unix?
- Automatically enter SSH password with script
- Aborting a shell script if any command returns a non-zero value
- Shell script: Run function from script over ssh
- How can I quickly sum all numbers in a file?
- Sorting multiple keys with Unix sort
- How to run a shell script when a file or directory changes?
- Redirect STDERR / STDOUT of a process AFTER it’s been started, using command line?
- Does “argument list too long” restriction apply to shell builtins?
- Given two directory trees, how can I find out which files differ by content? [closed]
- Using the passwd command from within a shell script
- Add a bash script to path
- How to extract only the raw contents of an ELF section?
- Get last dirname/filename in a file path argument in Bash
- Docker Alpine executable binary not found even if in PATH
- Bash script execution with and without shebang in Linux and BSD
- bash command not found when setting a variable
- Shell command to tar directory excluding certain files/folders
- Exit code of variable assignment to command substitution in Bash
- How to compare two DateTime strings and return difference in hours? (bash shell)
- How to find directory of some command?
- bash, command not found [duplicate]
- Linux shell sort file according to the second column?
- Count lines in large files
- How to convert hex to ASCII characters in the Linux shell?