How To Install Sort On Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS?
Maintainer: Michael Stone
Email: [email protected] .
Website: https://gnu.org/software/coreutils
Section: utils
Install sort
-
Debian
apt-get install coreutilsClick to copy -
Ubuntu
apt-get install coreutilsClick to copy -
Alpine OS
apk add coreutilsClick to copy -
Arch Linux
pacman -S coreutilsClick to copy -
Kali Linux
apt-get install coreutilsClick to copy -
CentOS
yum install coreutilsClick to copy -
Fedora
dnf install coreutilsClick to copy -
Raspbian
apt-get install coreutilsClick to copy -
macOS
brew install coreutilsClick to copy
Sort lines of text files.
How to use sort?
Below are few example commands for sort that you can use in the terminal.
Sort a file in ascending order:sort filenameClick to copySort a file in descending order:sort -r filenameClick to copySort a file in case-insensitive way:sort --ignore-case filenameClick to copySort a file using numeric rather than alphabetic order:sort -n filenameClick to copySort the passwd file by the 3rd field, numerically:sort -t: -k 3n /etc/passwdClick to copySort a file preserving only unique lines:sort -u filenameClick to copySort human-readable numbers (in this case the 5th field of `ls -lh`):ls -lh | sort -h -k 5Click to copy
To install the latest version of sort in your favorite operating system just copy the sort installation command from above and paste it into terminal. It will download and install the latest version of sort 2026 package in your OS.




