mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
add information about input, output, and error redirection
This commit is contained in:
parent
9d0f731ad5
commit
9c8c0af0af
@ -86,6 +86,13 @@ ls -l # Lists every file and directory on a separate line
|
||||
# txt files in the current directory:
|
||||
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 $( ):
|
||||
# The following command displays the number of files and directories in the
|
||||
# current directory.
|
||||
|
Loading…
Reference in New Issue
Block a user