Linux+ Chapter 3

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Explain the "cp" command and common options

"Copy" command for coping files. -a ; archive: perform a recursive copy and keep all the files original attributes -f ; force: Overwrite any preexisting destination files with the same name as DEST -i ; interactive: ask before overwriting any preexisting destination files with the same name as DEST -n ; no clobber: Do not overwrite any preexisting destination files with same name as DEST -R, -r ; recursive -u ; update: only overwrite preexisting destination files with the same name as DEST if the source file is newer -v ; verbose: provide detailed command action information as command executes.

You are using the ls command to look at a directory file's metadata but keep seeing metadata for the files within it instead. What command option will rectify this situation?

-d this switch allows you to view a directory's metadata instead of seeing metadata for the files managed by the directory

Which diff option is the best options to allow you to quickly determine if two text files are different from one another?

-q brief

Explain the "cat" command and its common options.

A Linux command used to display (or concatenate) the entire contents of a text file to the screen. -n ; displays the file in column format using n columns. -l n ; change default page length from 66 lines to n lines -m ; merge: when displaying multiple files, display them in parallel with one tile in each column -s ; separator: change the default column separator from tab to c -t; omit header: do not display any file header or trailers -w, width, changes the 72 character page width -w

explain the "find" command and its common options

A flexible command that allows you to locate files based on data. find [PATH...][OPTION][EXPRESSION] Path is the search starting point, -cmin displays names of files whose status changed n minutes ago -empty displays names of files that are empty -gid n ; displays names of files whose group id is equal to n -size n ; displays names of files whos size matches n.

Explain the "touch" command

Allows you to create empty files, update a files timestamps.

explain the "whereis" command

Allows you to locate any commands binaries and also locate source code files as well as manual pages.

What is the "rsync" command used for? What are some common options?

Copying large files, or large groups of files. Making backups. -a; use archive mode -D; retain device and special files -g; retain file's group -h; human readable -l; links: copy symbolic links as symbolic links -0; retain file's owner -p; retain file's permission -r; recursive -t; retain files modification time -v; verbose: provides detailed command action information as command executes.

You are trying to decide whether to use a hard link or a symbolic link for a data file. The file is 5gb, has mission critical data and is accessed via the command line by three other people. What should you do?

Create three hard links and provide the links to the three other people for data protection. This will prevent the three other people from accidentally deleting the data.

You have a lengthy file names, FileA.txt. What will the head -15 FileA.txt command do?

Display the first 15 lines of the file.

You need to figure out what configuration files hold a host name directive. Which of the following commands is the best one to use?

the grep utility will allow you to search quickly and effectivley

Soft link (symbolic link)

Provides a pointer to a file that may reside on another filesystem. Files will not share the same inode number. use the -s option with the "ln" command to create a soft link

explain the "which" command

Shows the full path name of a shell command passed as an argument.

Explain the "diff" command and its options

The diff command allows you to make comparisons between two files, line by line. -e; create an ed script -q; brief: if files are different, issue a simple message -s; same; if tiles are same, issue a simple message -r; recursive -W; width -y; display two columns, side-by-side

What command creates a "Hard Link", and what is a hard link?

Use "ln" to create a hard link. A file or directory that has one index (inode) number but at least two different file names. Its a single data file on the system but it can be accessed in multiple ways.

You are looking at a directory that you have not viewed in a long time and need to determine which files are actually subdirectories. Which command is the best one to use?

ls -F this is append a indicator code of / to every directory name

Explain the "ls" command and it's common options.

ls = list most basic command for viewing a files name and metadata. -a --all ; Display all file and subdir names including hidden files -d --directory ; Show a directory's own metadata instead of its contents -F --classify ; Classify each file type -i --inode ; Display all file and subdir names along with their associated index number. -l ; display file and subdir metadata, which includes file type, access permissions, hard link count, file owner, file group etc -R ; (recursive) Shows a directory's contents and for any subdir within the directory tree, shows their contents as well

You have two short text files that have max record lengths of 15 characters. You want to review these files side by side, what command would be the best to use?

pr -mtl 20 This command will display side by side, remove any headers or trailers, and set the page length to 20 lines so the files to not scroll off your screen.

Explain the "rm" command and some of its options

remove tool is used to delete stuff -d; deletes any empty directories -f; force -i; interactive: asks before deleting -r/-R; recursive -v; verbose: provides detailed command action as command executes

You have a file that is over 10gb in size and it needs to be backed up. What is the best utility to use in this situation?

rsync

explain the "locate" command and its common options

simple utility for finding files, it searches a database "mlocate.db" to determine if a file exists on the local system. -A; display files names that match all the patterns -b; display only files names that match the pattern -c; count: display only the number of files whose name matches the patter instead of displaying file names -i; ignore case in the pattern for matching files names -q; quiet: do not display any error messages -w; wholename: display filenames that match the pattern and include any directory names that match the patter.

Explain the "mv" command and common options

use to rename a file or directory -f force -i interactive -n no-clobber -u update -v verbose


Set pelajaran terkait

Chapter 4: Malware and Automated Computer Attacks

View Set

Configuring Color and Text with CSS - Chapter 3

View Set

Chapter 24: The Child with Hematologic or Immunologic Dysfunction ANS

View Set

Week 10: Quiz - Graphics & Presentations

View Set

Vocabulario del Día de Acción de Gracias

View Set

CompTIA Input/Output devices and display technology and management

View Set