Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash sort strings by frequency

# Basic syntax:
cat your_file | sort | uniq -c | sort -nr
# Where:
#	- you can replace cat your_file with any command that produces output
#		you want to sort in this way
#	- sort sorts the input it gets from the upstream command and sorts it in
#		alphanumeric order
#	- uniq -c counts the number of occurrences of each line
#	- sort -nr sorts the input it gets numerically in reverse order (high to
#		low)
# Note, you have to sort before passing to uniq -c because uniq -c counts
#	adjacent lines that are identical (and resets the count if they aren't)
Comment

PREVIOUS NEXT
Code Example
Shell :: rostopic bag file to csv 
Shell :: warp out files in linux 
Shell :: download video cart driver for manjaro 
Shell :: vmplayer kernel headers not found 
Shell :: how to check if matpot is installed 
Shell :: find all the git repos recursivelty 
Shell :: how to install guitarix 
Shell :: using ffmpeg on mac to record screen 
Shell :: install svelte 
Shell :: check full memory details 
Shell :: how to see all branches in git 
Shell :: uninstall edb postgres mac 
Shell :: bash dev/null 
Shell :: uninstall tesseract 4 
Shell :: flutter doctor --android-licenses java error 
Shell :: linux command if directory exists 
Shell :: how to close serveice on perticular port number 
Shell :: Verificação de acesso de escrita [/srv/moodle/lib/editor/atto/plugins] Instalação abortada devido a falha de validação 
Shell :: how to fix network issues on ubuntu 
Shell :: yarn frozen lockfile 
Shell :: how to change date of file in linux 
Shell :: virtual box config networkt config ubuntu 
Shell :: powershell find in history 
Shell :: echo /etc/hosts permission denied 
Shell :: bash ls each file on a single line 
Shell :: mysql inline password command line 
Shell :: Zathura not displaying any documents 
Shell :: how to switch remote from https to ssh on in github 
Shell :: linux set env permanent 
Shell :: setxkbmap toggle 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =