1) To find the duplicates in a file
cat $filename | sort | uniq -c | awk '$1 > 1 {print $2}'
sort To sort contents of a file
uniq -c Counts number of duplicates in a file
awk '$1 > 1 {print $2}' Print values which has count greater than 1 (Duplicates)
2) Replace a text in vim editor
shift +R To replace mode
3) Copy the entire file in vim editor
From top
shift + v To enter visual mode
shift+gg To Select the entire file
From bottom
shift + v To enter visual mode
shift
No comments:
Post a Comment