Chapter 4 Managing Files Flashcards

1
Q

A few characters have special meaning and should never be used in file names. What are they? pg 179

A

*,? / "

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a wild card? pg 180

A

A wildcard is a symbol or set of symbols that stand in for other characters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are 3 common classes of wildcards in Linux?

A
  • Star, ? Question Mark, Square or bracketed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the cp command do?

A

copies a file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the 3 operating modes of cpio? pg 191

A

Copy-Out, Copy-In,Copy Pass

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the mkdir command do? ?pg 198

A

Creates a Directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the rmdir command do? pg 198

A

Destroys the directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

which command will delete an entire directory tree? pg 198

A

-p or –parents Example(rmdir -p one/two/three)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the sticky bit? pg 205

A

its used to protect files from being deleted by those who don’t own the files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what are the prerequisites of using Linux’s disk quota system?

A

Linux’s disk quota system requires support in the Linux kernel for the file system on which quotas are to be used. you must also run the quotation command typically from a start up script to enable this feature.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Describe linux file ownership system?

A

Every file has an owner and a group, identified by a number. File permissions can be assigned independently to the files owner,the files’s group, and to all other users.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

True or False pg 190 True

A

the xz compression tool has gained so much popularity, the linux kernel is now compressed with it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Linux-native file systems maintain three time stamps for every file: what are the three?

A

Last File Modification time,Last inode change time,Last access time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

/root

A

root is the user name or account that by default has access to all commands and files on a Linux or other Unix-like operating system. It is also referred to as the root account, root user and the superuser.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

summarize Linux’s directory manipulation commands?

A

the mkdir command creates a new directory. and rmdir deletes a directory. You can also use many file manipulation commands such as mv and rm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

if you want to search a directory and perhaps some limited number of sub directories what can you use?

A

-maxdepth

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

on Page 221 there are 5 directories that should not be on their own partitions. Name them?

A
/bin
/dev
/etc
/lib
/sbin
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

A superuser can turn quotas on at anytime by using what command? pg 214

A

quotaon

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

A superuser can turn quotas off at anytime by using what command? pg 214

A

quotaoff

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is symbolic mode?

A

its a set of codes related to the string representation of the permissions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Tail Merging pg 213

A

is a feature of some computer file systems which allows large blocks or allocation units to be used while making efficient use of “slack” space at the end of large files, space which would otherwise be lost for other use to internal fragmentation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Set User ID (SUID)

A

is a special type of file permissions given to a file. Normally in Linux/Unix when a program runs, it inherits access permissions from the logged in user. SUID is defined as giving temporary permissions to a user to run a program/file with the permissions of the file owner rather that the user who runs it. In simple words users will get file owner’s permissions as well as owner UID and GID when executing a file/program/command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Set Group ID (SGID)

A

is a special type of file permissions given to a file/folder. Normally in Linux/Unix when a program runs, it inherits access permissions from the logged in user. SGID is defined as giving temporary permissions to a user to run a program/file with the permissions of the file group permissions to become member of that group to execute the file. In simple words users will get file Group’s permissions when executing a Folder/file/program/command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What does FHS stand for in Linux?

A

File system Hierarchy Standard(FHS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

what is a symbolic link?

A

its a separate file whose contents point to the linked to file.

26
Q

force overwrite

A

the -f or –force options forces the system to overwrite any existing files.

27
Q

interactive mode

A

-i or –interactive option causes cp to ask you before overwriting any existing files.

28
Q

recursive copy

A

-r or –recursive option and specify a directory as the source option, the entire directory, including sub directories.

29
Q

Archive Copy

A

-a or –archive option is similar to -R but it also preserves ownership and copies links as is.

30
Q

Update Copy

A

-u or –update options tells cp to copy the file only if the original is newer than the target or if the target doesn’t exist.

31
Q

tar command (tar) tape archiver

A

archive data to other media

32
Q

tarballs

A

are often used for transferring multiple files between computers in one step, such as when distributing source code. A tarball is an archive file created by tar and typically compressed with gzip, xz, or bzip2

33
Q

c, –create

A

x, –extract, –get

34
Q

A, –catenate, –concatenate

A

Append tar files to an archive.

35
Q

d, –diff, –compare

A

Append tar files to an archive.

36
Q

–delete

A

Delete from the archive. (This function doesn’t work on magnetic tapes).

37
Q

r, –append

A

Append files to the end of a tar archive.

38
Q

t, –list

A

List the contents of an archive.

39
Q

–test-label

A

Test the archive label, and exit.

40
Q

u, –update

A

Append files, but only those that are newer than the copy in the archive.

41
Q

x, –extract, –get

A

Extract files from an archive.

42
Q

copy-out mode

A

This mode,activated by use of the -o or –create option,creates an archive and copies files into it.

43
Q

copy-in mode

A

you activate copy-on mode by using the -i or –extract option. This mode extracts data from an existing archive. If you provide a filename or a pattern to match, cpio extracts only those files whose names match the pattern you provide.

44
Q

copy pass mode

A

this mode is activated by the -p or –pass though option.

45
Q

link

A

is a way to give a file multiple identities, similar to shortcuts in windows and aliases in Mac OS.

46
Q

Three reasons Linux employs links?

A

1) help make files more accessible
2) give commands to multiple names
3) to enable programs that look for the same files in different locations to access the same files.

47
Q

Hard links

A

are produced by creating two directory entries that point to the same file( more precisely the same mode)

48
Q

ln command

A

creates hard links by default. The source file must exist before a hardlink is created.

49
Q

permission bits

A

individual permissions such as execute access for the file owner are often referred to as permission bits.

50
Q

/bin

A

this directory contains certain critical executable files such as ls,cp and mount.

51
Q

/sbin

A

/sbin is a standard sub directory of the root directory in Linux and other Unix-like operating systems that contains executable (i.e., ready to run) programs. They are mostly administrative tools, that should be made available only to the root (i.e., administrative) user.

52
Q

/lib

A

The /lib directory contains kernel modules and those shared library images (the C programming code library) needed to boot the system and run the commands in the root filesystem, ie. by binaries in /bin and /sbin. Libraries are readily identifiable through their filename extension of *.so. Windows equivalent to a shared library would be a DLL (dynamically linked library) file. They are essential for basic system functionality. Kernel modules (drivers) are in the subdirectory /lib/modules/’kernel-version’. To ensure proper module compilation you should ensure that /lib/modules/’kernel-version’/kernel/build points to /usr/src/’kernel-version’ or ensure that the Makefile knows where the kernel source itself are located

53
Q

/opt

A

This directory is reserved for all the software and add-on packages that are not part of the default installation. For example, StarOffice, Kylix, Netscape Communicator and WordPerfect packages are normally found here. To comply with the FSSTND, all third party applications should be installed in this directory. Any package to be installed here must locate its static files (ie. extra fonts, clipart, database files) must locate its static files in a separate /opt/’package’ or /opt/’provider’ directory tree (similar to the way in which Windows will install new software to its own directory tree C:\Windows\Progam Files"Program Name”), where ‘package’ is a name that describes the software package and ‘provider’ is the provider’s LANANA registered name.

54
Q

/mnt

A

This is a generic mount point under which you mount your filesystems or devices. Mounting is the process by which you make a filesystem available to the system. After mounting your files will be accessible under the mount-point. This directory usually contains mount points or sub-directories where you mount your floppy and your CD. You can also create additional mount-points here if you wish. Standard mount points would include /mnt/cdrom and /mnt/floppy. There is no limitation to creating a mount-point anywhere on your system but by convention and for sheer practicality do not litter your file system with mount-points. It should be noted that some distributions like Debian allocate /floppy and /cdrom as mount points while Redhat and Mandrake puts them in /mnt/floppy and /mnt/cdrom respectively.

55
Q

/root

A

This is the home directory of the System Administrator, ‘root’. This may be somewhat confusing (‘root on root’) but in former days, ‘/’ was root’s home directory (hence the name of the Administrator account). To keep things tidier, ‘root’ got his own home directory. Why not in ‘/home’? Because ‘/home’ is often located on a different partition or even on another system and would thus be inaccessible to ‘root’ when - for some reason - only ‘/’ is mounted.

56
Q

/dev

A

/dev is the location of special or device files.

57
Q

/proc

A

/proc is very special in that it is also a virtual filesystem. It’s sometimes referred to as a process information pseudo-file system. It doesn’t contain ‘real’ files but runtime system information (e.g. system memory, devices mounted, hardware configuration, etc). For this reason it can be regarded as a control and information centre for the kernel. In fact, quite a lot of system utilities are simply calls to files in this directory. For example, ‘lsmod’ is the same as ‘cat /proc/modules’ while ‘lspci’ is a synonym for ‘cat /proc/pci’. By altering files located in this directory you can even read/change kernel parameters (sysctl) while the system is running.

58
Q

-gid

A

searches for files whose group ID is set to gid.

59
Q

whereis

A

it searches doe files in a restricted set of locations,such as standard binary files directories,library directories and ma pages directories.

60
Q

-size

A

you can search for a file of a given size with the -size n expression.