Term
Concatenate/display the files in file-list on standard ouput |
|
Definition
cat [options] file-list - n Put line numbers with the displayed line |
|
|
Term
Command to display file(s) have line numbers. |
|
Definition
|
|
Term
Command to display file(s) with time stamp and page numbers and also partitions the file into pages and insert a header for each page. |
|
Definition
|
|
Term
Concatenate/display the files in the file-list on standard output a screenful at a time |
|
Definition
|
|
Term
Give two commands for displaying a file named 'grades' with line numbers |
|
Definition
|
|
Term
Give the command for displaying all C program files in the ~/courses/programs directory a page at a time with 20 lines per page |
|
Definition
more -20 ~/courses/programs/*.c |
|
|
Term
Command used to identify the type of data stored in a file. The command to display the beginning portions of files in the file-list. |
|
Definition
head [options] file list -N Display first N lines (default is 10) |
|
|
Term
Give the command for displaying the first 20 lines of the sample file by using the head command. Can you use any other command to perform the same operation? If yes, show the command line. |
|
Definition
head -20 sample more -20 sample |
|
|
Term
Command used to display the last portions of the files in the file-list |
|
Definition
|
|
Term
follow the growth of the file after displaying the last line of a file, and display lines are they are appended to the file - this option is terminated with |
|
Definition
|
|
Term
Start n lines from the beginning of the file for +n, and n lines before the end of file or n units before the end of file. By default, -n is -10. |
|
Definition
|
|
Term
Display the lines in revers order(last line first) |
|
Definition
|
|
Term
Give the command line for displaying the tail of the sample file starting with line 28. |
|
Definition
|
|
Term
Shw the command that displays the lat five lines of the file 'sample' in reverse order |
|
Definition
|
|
Term
Show the command to display the last 10 iines of file 'sim.data' and displays new lines as they are appended to the file |
|
Definition
|
|
Term
Command to copy file1 to file2; if file2 is a directory, make a copy of file1 in this directory |
|
Definition
cp [options] file1 file2 You must have permission to read file1 and to execute(search) the directories that contain file1 and file2 and write permission to file2. |
|
|
Term
Command used to copy both the data and attributes of the source file. |
|
Definition
|
|
Term
Command to copy a complete directory to another directory. |
|
Definition
|
|
Term
4. Show the command line for copying all C program files in the ~/courses/programs directory into the ~/backups/programs directory. If a source files already exists in the destination directory, prompt the user before overwriting. |
|
Definition
cp –ir ~/courses/programs/*.c ~/backups/programs |
|
|
Term
For the cp file1 directory/file2 command to be successfully executed, what privileges are required for file1, file2, and directory? |
|
Definition
The user must have read permission for file1 and write/execute permission for the directory. If file2 already exists then the user must have write permission on the file. |
|
|
Term
A directory hierarchy with its own root stored on a disk or disk partition, mounted under a directory. |
|
Definition
|
|
Term
Command to move file1 to file2 or rename file 1 as file2 |
|
Definition
|
|
Term
Command to move all the files in file-list to a directory |
|
Definition
mv [options] file-list directory |
|
|
Term
Command to force move regardless of the permissions of the destination file |
|
Definition
|
|
Term
Command to prompt the users before overwriting the destination |
|
Definition
|
|
Term
6. Assume that there is a directory hierarchy, dir1, and a directory new_dir1. Give the command line for moving everything under dir1 to new_dir1. |
|
Definition
mv dir1/* to new_dir1 This command will fail if new_dir1 is not a directory, if it does not exist, or if you do not have write and execute permissions for it. |
|
|
Term
Command to remove files in the file-list from the file structure (and disk) |
|
Definition
|
|
Term
command to force remove regardless of the permissions for file-list |
|
Definition
|
|
Term
command to prompt the user before removing the files in file-list |
|
Definition
|
|
Term
Command to recursively remove the files in the directory, which is passed as an arugment |
|
Definition
|
|
Term
7. Give the command line for recursively and interactively removing an unwanted directory, NotNeededDirectory in your home directory. |
|
Definition
rm –ir N NotNeededDirectory |
|
|
Term
8. Assume that you have two files, f1 and f2, that you want to concatenate and store in a file called f1nf2. Show the cat command needed to perform this task. |
|
Definition
|
|
Term
Show the command needed to put your name, taken from the keyboard, as the last line of f1nf2. |
|
Definition
Cat >> f1nf2 Raul Zuniga Ctrl+d |
|
|
Term
Command to display sizes of the files in file-list as number lines, words, and characters |
|
Definition
|
|
Term
command to display only the number of characters of the files in file-list |
|
Definition
|
|
Term
command to display only the number of lines of the files in file-list |
|
Definition
|
|
Term
command to display only the number of words of the files in file-list |
|
Definition
|
|
Term
Use the wc command to confirm that you have concatenated files f1 and f1 into file f1nf2. |
|
Definition
wc –lwc f1 f2 f1nf2 The results of these commands should match. |
|
|
Term
Show the command for displaying the contents of textfile named A*R*T*H*U*R, in a directory called funstuff in your home directory. |
|
Definition
more ~/funstuff/A*R*T*H*U*R |
|
|
Term
Command to append the contents of the files in file-list at the end of destination-file |
|
Definition
cat file-list >> desitination file |
|
|
Term
Command to combine file in the file-list and put them in destination-file |
|
Definition
cat file-list > destination-file |
|
|
Term
Command to compare file1 with file2 line-by-line and display differences between them as a series of commands that can be used to convert file1 to file2 or vice versa |
|
Definition
diff [options] file1 file2 note: file1 & file2 can be directories which compares all pairs fo files with the same names |
|
|
Term
command to remove repetitious lines from the sorted input-file and send unique lines to the output file. |
|
Definition
unique [options] [+N] [input-file][output-file] |
|
|
Term
If file1 is a file and dir1 is an empty directory then the cp file1 dir1 command creates a new file dir1/file1, provided you have read permission for file1 and write permission for dir1. |
|
Definition
|
|
Term
If the file sample has its permissions set to 340 then the cp sample sample.new command will create a new file sample.new, if sample.new does not exist and you have write permission for the current directory or sample.new exists and you have write access for it. |
|
Definition
|
|
Term
The mv sample dir1 command will execute successfully if permissions on sample are set to 440 and on dir1 are set to 544. |
|
Definition
|
|
Term
The head -5 sample command is equivalent to the head +5 sample command. |
|
Definition
|
|
Term
The head -5 sample command is equivalent to the tail +5 sample command. |
|
Definition
|
|
Term
The tail –f sample command runs until terminated explicitly (e.g., by pressing ) and displays the new data appended to the sample file. |
|
Definition
|
|
Term
The wc –lw sample memo lab command displays three lines, one each for sample, memo, and lab, containing line count, word count, and file name. |
|
Definition
|
|
Term
The cat sample example >> ample and cat sample example > ample commands are equivalent if ample is empty or does not exist. |
|
Definition
|
|
Term
The uniq –u sample command displays repeated lines in the sample file. |
|
Definition
|
|
Term
How can you see the long listing of a lengthy directory one page at a time? |
|
Definition
|
|