mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-09-25 22:09:00 +02:00
add information about input, output, and error redirection
This commit is contained in:
@@ -86,6 +86,13 @@ ls -l # Lists every file and directory on a separate line
|
|||||||
# txt files in the current directory:
|
# txt files in the current directory:
|
||||||
ls -l | grep "\.txt"
|
ls -l | grep "\.txt"
|
||||||
|
|
||||||
|
# You can also redirect a command output, input and error output.
|
||||||
|
python2 hello.py < "input.in"
|
||||||
|
python2 hello.py > "output.out"
|
||||||
|
python2 hello.py 2> "error.err"
|
||||||
|
# The output error will overwrite the file if it exists, if you want to
|
||||||
|
# concatenate them, use ">>" instead.
|
||||||
|
|
||||||
# Commands can be substitued within other commands using $( ):
|
# Commands can be substitued within other commands using $( ):
|
||||||
# The following command displays the number of files and directories in the
|
# The following command displays the number of files and directories in the
|
||||||
# current directory.
|
# current directory.
|
||||||
|
Reference in New Issue
Block a user