Linux command
nth 命令
文本
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Extract nth field
echo "[a b c]" | nth [2]
Extract from CSV
nth -d "," [1] < [file.csv]
Extract multiple fields
nth [1] [3] [5] < [file.txt]
Use custom delimiter
nth -d ":" [1] < [/etc/passwd]
说明
nth extracts specific fields from input. Simple alternative to awk/cut. The tool handles field extraction efficiently. Cleaner syntax than awk.
参数
- -d _DELIMITER_
- Field delimiter (default: whitespace).
- -0
- Use null as output separator.
- --help
- Display help information.
FAQ
What is the nth command used for?
nth extracts specific fields from input. Simple alternative to awk/cut. The tool handles field extraction efficiently. Cleaner syntax than awk.
How do I run a basic nth example?
Run `echo "[a b c]" | nth [2]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -d _DELIMITER_ do in nth?
Field delimiter (default: whitespace).