What does this command mean?
I am reading a tool manual and it instructs to use such a command:
Code:
cat word-list | sort +1 -rn | \ awk '{ print $1}' > result.txt Thanks for explanation. |
From this link:
Quote:
|
For any basic command there will be a man page ... 'man sort' 'man awk'
- sort: I'm not sure whether the '+1' is valid but -r = reverse and -n = numeric - awk: $1 indicates it will print the first field cheers |
Quote:
The original command from the manual is here: Code:
cat UNTAGGED-CORPUS | Utilities/wordlist-make.prl | sort +1 -rn | \ |
The '\' is interpreted as meaning "continue on the next line", it's used in textbooks and examples so you can copy/paste without having to worry about fixing up long lines.
The '+1' may be valid on other *nix's |
Quote:
|
Quote:
"Sort on n+1 st field (old style key definition): sort +n" So if the file has this format: a 2 b 3 c 2 ... 'sort +1' will sort the first column in that file? |
Hi,
Welcome to LQ! Just a few links to aid you to gaining some understanding. Sure some may seem beyond a newbie but you must start somewhere; Linux Documentation Project Rute Tutorial & Exposition Linux Command Guide Utimate Linux Newbie Guide LinuxSelfHelp Getting Started with Linux Bash Beginners Guide Bash Reference Manual Advanced Bash-Scripting Guide Linux Home Networking The above links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links! |
Quote:
cheers |
All times are GMT -5. The time now is 07:49 PM. |