Directories, files and Redirection Flashcards

1
Q

What is an alias?

A

Alias gives a command an alias name to use, only around during your current shell however you can save it in the startup file, however other currently running shells will have to be restarted to get that configuration

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

What is one limitation for a alias?

A

cannot put any variable information into the alias

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

What are the values in “drwr-xr 2 jacob jacob 4096 Jan 10 16:40 bin” for

A

–first set of values indicates the file type d is a folder, and - is a normal file.

–After the D or - the r, rw, x, indicates permissions.
R - read,
RW - read and write,
x - execute
–number is a link count
–Next information is the owner, then group
–number is the size of the file or folder
–date and time of last modification
–Last is the name of the file or folder

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

What option would you use with ls command to show you hidden files/folders

A

-a, those files start with a .

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

What option would you use with ls to show the file size in bytes?

A

-li

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

What does the mkdir command do?

A

makes a directory

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

What does the cd command do?

A

changes the directory, followed by the directory name

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

What does the touch command do?

A

creates and empty file

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

What does the rm command do?

A

removes a file

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

What does the cd.. command do?

A

takes you back one level

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

What does the rmdir command do?

A

removes a directory

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

What does the pwd command do?

A

print working directory

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

What does the cd - command do?

A

takes you back to where you last were

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

What does the cd command do with no other input?

A

takes you home, cd~ also takes you home

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

What does the cd~/bin command do?

A

takes you to the home and then to the bin directory, replace bin for any other directory

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

What does the cat command do?

A

shows you the content of the string

17
Q

What does the cp command do? What would the structure look like?

A

copies a file. Two ways of using this command.

  1. Moving a file to a new folder cp file /tmp, where /tmp is the new location and file is the name of the file you are moving
  2. Renaming a file, cp file file2, where file is the file to be copied and file2 is the new name
18
Q

What does the mv command do? What would the structure look like?

A

mv moves files, renames files,

  1. moving a file, mv file /tmp
  2. moving and renaming, mv file /tmp/new-name
19
Q

Absolute Path

A

Always starts with the root, example cd /etc/init.d as opposed to the relative path cd ../../etc/init.d

20
Q

Realative Path

A

../../etc.init.d as opposed to the absolute path /etc/init.d