All Flashcards

1
Q

ls -l

A

List all in file with information about the file including file type and permission, memory blocks used, owner of file, group of the owner, file size in bytes, date and time it was last created or modified, and the file/directory name.

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

Metacharacter?

A

characters that have a special meaning in unix (* or ?)

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

? metacharacter meaning?

A

This is like * (which matches with 0 or more characters) whereas ? matches with a single character.

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

-a flag to ls

A

Lists invisible files

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

Invisible files

A

An invisible file is one, the first character of which is the dot or the period character (.). Unix
programs (including the shell) use most of these files to store configuration information.
Some common examples of the hidden files include the files −
 .profile − The Bourne shell ( sh) initialization script
 .kshrc − The Korn shell ( ksh) initialization script
 .cshrc − The C shell ( csh) initialization script
 .rhosts − The remote shell configuration file

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

. meaning

A

cd

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

..

A

parent directory

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

How to save from emacs?

A

C-x C-c

Control-x control-c

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

cat meaning

A

show contents of file

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

Copy command syntax

A

cp source_file destination_file

This will copy all bits of source and make a new file/overwrite destination

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

Renaming file syntax

A

mv old_file new_file

Renames it!

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

3 Unix streams?

A

stdin, stdout, stderr

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

Home directory

A

The directory in which you find yourself when you first login is called your home directory.

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

cd ~

A

brings you to your home directory

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

cd -

A

brings you to your last directory

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

How to open a directory within the current directory?

A

cd chem/notes
NOT
cd /chem/notes

This will open chem, then open notes.

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

pwd

A

print working directory

Will print for example
“/user0/home/amrood”

18
Q

How to list the files inside of a directory?

A

ls directoryName

19
Q

How to open a directory regardless of cd?

A

cd /user/chem/notes

This STARTS WITH A BACKSLASH and will begin with the home directory and move from there.

20
Q

Make a directory

A

mkdir dirname

makes in cd

21
Q

Make a directory in home directory’s “files” directory… while your in a different directory called dogs

A

mkdir ~/files/dogs

22
Q

Requirement for removing directory?

A

-it needs to be empty, no files or sub-directories

23
Q

Full path vs relative path

A

full path begins with /, relative path begins with a directory inside the currentDirectory

24
Q

Is cd ../../home/amrood a valid relative path?

A

Yes!!

25
Q

How to rename a directory?

A

mv olddir newdir

26
Q

Permissions questions:

In the ls -l, what does the first character tell us?

A

the type of file!

27
Q

Permissions questions:

In the ls -l, what does the 2-4 characters tell us?

A

permissions for the file’s owner

28
Q

Permissions questions:

In the ls -l, what does the 5-7 characters tell us?

A

permissions for the group too which the file belongs

29
Q

Permissions questions:

In the ls -l, what does the 8-10 characters tell us?

A

permissions for everyone else

30
Q

Permissions questions:

First character is -. This means?

A

Regular file, such as an ASCII text file, binary executable, or hard link

31
Q

Permissions questions:

First character is b. This means?

A

Block special file. Block input/output device file such as a physical hard
drive

32
Q

Permissions questions:

First character is c. This means?

A

Character special file. Raw input/output device file such as a physical
hard drive

33
Q

Permissions questions:

First character is d. This means?

A

Directory file that contains a listing of other files and directories

34
Q

Permissions questions:

First character is l. This means?

A

Symbolic link file. Links on any regular file

35
Q

r-x is the group’s permissions. This means?

A

The group can read and execute but not write to this file!

36
Q

testfile permissions using ls -l is
-rwxrwxr–

How to let the world write and execute?

A

chmod o+wx testfile

Which would result in
-rwxrwxrwx. Everybody can now do everything!

37
Q

testfile permissions using ls-l is
-rwxrwxrwx

Make the group only able to read and execute!

A

chmod g=rx testfile
or
chmod g-w testfile

38
Q

How to combine chmod commands?

A

chmod o+wx,u-x testfile

39
Q

Access classes?

A

u user
g group
o other
a all (u,g,o)

You can modify these with chmod, o+w, u-x

40
Q

Pipe?

A

|

Output of one program is put into the input of another

41
Q

How to exit a process

A

control c