Managing Files Flashcards
Many commands produce “_______” output. Normally, output is displayed on the screen.
Visible.
Linux likes to think of everything as a…?
file.
One of the features of the bash command shell is that the output which would normally be directed at the screen through _______ can, instead be redirected to some other file. (This is done by using the special redirection symbol, >.
STDOUT
cat…?
Concatenate File(s) to standard output.
Cat command copies each of the…?
files listed to standard output. (If more than one file is listed, this effectively concatenates the files. As for any other command, this output will display on the screen by default, but could also be redirected to a file. We will use it to display a file by naming a single file and not redirecting the results.)
If the file already exists, redirection will….?
delete and re-create the file empty, then capture the new output. If, however, a double arrow (») is used, the new output is appended to the file. If»_space; is used and the target file does not exist, it is created, just as if > had been used.
The > symbol is an example of a…?
shell meta-character, that is, a symbol with special meaning which the bash shell sees and interprets before the rest of the command is acted upon.
Simplest command that produces visible output is…?
Echo. (This command takes whatever text is typed as part of the command and echos it to STOUT (usually the display).)
Duplicate copies of files can be created with the …?
cp (copy) comand.
cp [OPTIONS] {SOURCE} {TARGET}
cp [OPTIONS] {SOURCE…} {DIRECTORY}
In the first form, a copy of the SOURCE file is made as TARGET. In the second form, one or more files can be copied at one time to a directory. A copy of SOURCE, …, is made in DIRECTORY and named DIRECTORY/SOURCE, …. With the appropriate options (not discussed here - try man cp) whole subdirectory trees can be copied at once.
Make a copy of mysong.midi and name the copy backup.midi….?
cp mysong.midi backup.midi
Make a copy of mynovel.txt in /tmp….?
cp mynovel.txt /tmp
The resulting file will be named /tmp/mynovel.txt.
Copy the files songs.tar and novels.tgz into the directory /tmp….?
cp songs.tar novels.tgz /tmp
The resulting files will be named /tmp/songs.tar and /tmp/novels.tgz.
Make a copy of webpage.html from your home directory to the current directory…?
cp ~/webpage.html .
The resulting file will be named ./webpage.html.
Files can be moved from one directory to another, or from one name to another (renamed), with…?
the mv (move) command.