Difference between revisions of "Linux"
From PHYSpedia
(→Useful Commands) |
(→Useful Commands) |
||
Line 10: | Line 10: | ||
==Useful Commands== | ==Useful Commands== | ||
− | The following is a (short) list of useful command when manipulating data in text files. Some common options are listed, but may not be explained. For full descriptions of each command, see the <code>man</code> page. | + | The following is a (short) list of useful command when manipulating data in text files. Some common options are listed, but may not be explained. For full descriptions of each command, see the <code>man</code> page. stdin, stdout, and stderr refer to standard input, output and error, respectively. |
;<code>cat [file1 [ file2 [...] ] ]</code> | ;<code>cat [file1 [ file2 [...] ] ]</code> | ||
− | : print text file(s) to | + | : print text file(s) to stdout. if multiple files are given, their text is concatenated |
: useful for starting a pipeline of commands from the contents of a text file | : useful for starting a pipeline of commands from the contents of a text file | ||
;<code>echo [args...]</code> | ;<code>echo [args...]</code> | ||
− | : print arguments to | + | : print arguments to stdout |
: useful for starting a pipeline of commands from a variable's value | : useful for starting a pipeline of commands from a variable's value | ||
: useful for printing output to the terminal from inside a script | : useful for printing output to the terminal from inside a script | ||
;<code>sort<code> | ;<code>sort<code> | ||
− | : read from | + | : read from stdin, sort lines, and write to stdout |
: command options: -k, -t, -n, -g | : command options: -k, -t, -n, -g | ||
+ | ;<code>cut<code> | ||
+ | : read from stdin and write selected columns to stdout. |
Revision as of 19:06, 21 January 2013
These topics have their own pages.
Common C, C++, FORTRAN Libraries
Useful Commands
The following is a (short) list of useful command when manipulating data in text files. Some common options are listed, but may not be explained. For full descriptions of each command, see the man
page. stdin, stdout, and stderr refer to standard input, output and error, respectively.
cat [file1 [ file2 [...] ] ]
- print text file(s) to stdout. if multiple files are given, their text is concatenated
- useful for starting a pipeline of commands from the contents of a text file
echo [args...]
- print arguments to stdout
- useful for starting a pipeline of commands from a variable's value
- useful for printing output to the terminal from inside a script
sort<code>
- read from stdin, sort lines, and write to stdout
- command options: -k, -t, -n, -g
- <code>cut<code>
- read from stdin and write selected columns to stdout.