Filesystem Fundamentals Flashcards

1
Q

What is a file

A

nothing more than a named sequence of
bytes stored on a permanent, non-volatile storage medium. It is entirely up to other software to
impose syntax and semantic meaning on a file’s sequence of bytes

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

what is a filesystem

A

an abstraction that allows the organization of files in a hierarchical structure.

consists of a root directory which may contain files, or more directories sometimes called sub-directories

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

Special Directory Names

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

Filename Extensions

A

Indicated by a period.
e.g .txt, .jpg
.c - C language source code files
.so - used by LINUX for compiled dynamic C libraries

In LINUX, an executable program
does not need to have a specific extension, nor does it need to have any extension at all

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

Filename and Pathname Rules and Properties

A

filename is limited to 255
characters.
A path name is limited to 4096 characters. these limits can be changed

file and directory names are case sensitive

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

LINUX System Directories

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

Basic Filesystem Commands

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

Operations on Multiple Files

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

Filename Globbing (Wildcard Filenames)

A

File globs are patterns
specified with wildcard characters.

file globbing is a feature of the shell and cannot generally be used elsewhere, such as within another application, unless that application also supports some form
of file globbing.

  • character matches any number of characters of any kind, including no characters at all.For example, the file glob *.jpg matches any file that has a .jpg extension, regardless of howmany characters are before the extension.

? character matches any single character. For example, the file glob quest?.txt matches
all of quest1.txt, questX, and questj.txt.

A list of characters inside a pair of square brackets matches any one of the listed characters.
For example, the glob quest[12345].txt would match quest1.txt and quest4.txt but not
quest8.txt or questX.txt

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

Access Permission Categories

A

every file and directory has an owner,group and at times other

owner of a file is a user ID
group of the file is the ID of a file group
A file group has: groupID and every usrID is either a member of that group or not

other is a userID that is not the owner nor a member of the file’s group

each category has read,write,execute; each denoted by 3 letter.

  • indicates that the category doesn’t have access to this.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Permissions for Files

A

read permission allows the file to be opened for reading only

write permission allows the file to be opened for writing only,Write permission does not imply read permission

execute permission allows the file to be executed if the file is a compiled C program, a shell script, or another executable file format

If a file with the execute permission is not an
executable file type, it will try executing it anyway, but the operating system will issue an error

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

Permissions for Directories

A

read permission grants the ability to read what files are in the directory, but revoking this
permission does not necessarily prevent reading a file in that directory if you know it’s name

write permission grants the ability to create or remove files in/from a directory

execute permission grants the ability to use the directory in a pathname and set the directory
to be the current working directory using cd. If you do not have execute permission on a directory,
you cannot access anything in subdirectories of that directory.

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

Displaying File Permissions

A

ls -l

displays persmission, then a number, then file owner,file group,file size,date/time

the permissions of a parent directory could override file access. For example,
if the parent directory of the shown listing denies read and execute permission to other, the read permissions granted to other on a.out and test.c are irrelevant, and access would be denied

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

Changing Ownership

A

changes the owner of a file or directory. The syntax
is:  
chown <newowner> <path1> ...</path1></newowner>

newowner> is the user ID you wish to change the owner to,

<path1> ... is/are one or more path(s) to the file(s) or directory(ies) you wish to change the owner of
</path1>

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

Changing the File Group

A

chgrp <newgroup> <path1> ...</path1></newgroup>

<newgroup> is the new file group ID you wish to assign,
</newgroup>

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

Changing Access Permissions

A

chmod <mode> <path1> ...
The <mode> string is broken down as follows:
   </mode></path1></mode>

<cat><op><perm>

cat : either u for user meaning owner;g - group; o - other ; a - all owner,group,other.

op: + (grant) ; - (revoke)

perm - r,w,x

![!BS! ](https://s3.amazonaws.com/brainscape-prod/system/cm/409/017/348/a_image_ios.?1669828232 "eyJvcmlnaW5hbFVybCI6Imh0dHBzOi8vczMuYW1hem9uYXdzLmNvbS9icmFpbnNjYXBlLXByb2Qvc3lzdGVtL2NtLzQwOS8wMTcvMzQ4L2FfaW1hZ2Vfb3JpZ2luYWwuP2M2YjQyZWVkOWRjMWIzMTVhYjRkNjI3OGE0ZmE5NWNlIn0=")
</perm></op></cat>