![Forrest logo](/images/logo.png)
On this page you find all important commands for the CLI tool tsort. If the
command you are looking for is missing please ask our AI.
tsort
tsort is a command line tool used for topological sorting in Unix-like operating systems. It stands for "topological sort" and is used to sort a directed acyclic graph (DAG). The goal of topological sorting is to arrange the nodes in such a way that for every directed edge (u, v), node u comes before node v in the sorted order.
- tsort reads a text file containing a DAG as input.
- The input file defines the nodes and their dependencies.
- Each line consists of two node names separated by a whitespace, representing a directed edge from the first node to the second.
- tsort outputs a linear ordering of the nodes, such that for every edge (u, v), u comes before v in the output.
- If the input graph has cycles, tsort detects them and reports an error.
- It uses a depth-first search algorithm to perform the topological sorting.
- In case of multiple valid orderings, tsort outputs any valid ordering.
- The sorted output is printed to the standard output.
- If there are no input files provided, tsort reads from the standard input.
- tsort is commonly used for dependency resolution, build systems, and task scheduling.
List of commands for tsort:
-
tsort:tldr:3ec7b tsort: Perform a topological sort consistent with a partial sort per line of input separated by blanks.$ tsort ${filename}try on your machineexplain this command