Basic Commands Flashcards
What does the [cat] command do?
It lists the contents of a file.
What is a [stream]?
A source of input or output that processes use to read or write data.
What is difference between the commands: [CTRL-D] and [CTRL-C]?
[CTRL-D] tells the running process that it has reached the EOF (End of File) and this usually terminates the process because it cannot receive any further input.
[CTRL-C] terminates the process regardless of its input/output stream.
What do [stdin] and [stdout] mean?
Standard Input (Default Input source)
Standard Output (Default Output Source)
Where do many commands read from if you do not specify an input file?
[stdin] Standard Input - The Default Input Source.
Where do programs send output?
Some programs send output to stdout (like [cat]).
Others send output directly to files.
What is the third standard I/O stream?
Standard Error
What is the best feature of standard streams?
You can easily modify them to read or write data to streams other than the terminal.
What does the [ls] command do?
It lists all the contents of a directory. By default, this is set to the current directory (input stream).
Is the [ls] command limited to the current directory?
No. I can change the program’s argument from the default current directory to any other file or directory.
What does [ls -l] argument do?
It gives a detailed (long) list of the contents of a directory.
What doe the [ls -F] argument do?
It gives details of file types in a list.
What does the [cp] command do?
It copies files.
Using the [cp] command, what is the syntax for copying one file to another?
[cp file1 file2]
Using the [cp] command, what is the syntax for copying one file to a directory?
[cp file dir]
What does the [mv] command do?
It moves (cuts) files/directories from one location to another.