NWP lab1 Flashcards

1
Q

pwd

A

Print the working directory you are in

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

cd ..

A

Return directly to its home directory

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

ls

A

List all files in the working directory

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

ls –rtl

A

Display detailed information about all files in the working directory and sort by their modification time in ascending order.

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

ls –l

A

Display detailed information about all files in the working directory.

  • Column 1: The permissions on the particular file for user, group and others,
  • Column 2: The number of files contained in the particular directory.
  • Column 3: user
  • Column 4: group
  • Column 5: the size of the file in KB.
  • Column 6: month and day at which the file was created or last modified.
  • Column 7: the name of the file
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

cd

A

Change the working directory to your home directory

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

mkdir test

A

Short for make directory. Used to create directories.

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

rmdir test

A

Short for remove directory. Used to remove/ delete directories.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
  • *chmod commands:**
  • *The way to use this format:**
A

chmod [newpermission] [filenames]

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

The following are symbolic parameters used by the command chmod

A

u

User (yourself)

g

Group

o

others (rest of the world)

a

All of the above (u,g and o)

-

Remove this permission

+

Add this permission

r

Read access

w

Write access

x

Execute access

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

To better understand the chmod command you must divide the first column into parts:

A

Lets take -r–r–r– as an example the first part _-_r–r–r– shows what kind of file it is. The table to the right shows each symbol with its meaning. In this case it is a file. The other part is -_r–_r–r– this shows the permissions for the user. -r–_r–_r– this shows the permissions for the group. And finally -r–r–r– this shows the permissions for others.

-

File

c

Character device file

d

Directory

l

Symbolic link or shortcuts

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

chmod g-r test

A

Remove read access from group

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

chmod o-r test

A

Remove read access from others (the rest of the world)

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

chmod go-x test

A

Remove Execute access from group and others

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

chmod u-rwx test

A

Remove read, write and execute access from user (yourself)

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

chmod uog+rwx test

A

Add read, write and execute access to user, group and others

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

who

A

Get information on currently logged in users.

  • Column 1: user name
  • Column 2: show how the user is connected. tty means the user is connected directly to the computer, while pts means the user is connected from remote.
  • Column 3 & 4: date and time
  • Column 5: show IP address where the users are connected.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

ps –ef

A

See processes on the system. Pipes the output to “less” to make it scrollable. Divide the output to pages.

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

ps –fu user4

A

See processes on user 4 system

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

touch file4

A

Create new, empty file

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

mv file4 test

A

move file4 to the directory (test)

22
Q

cd test

A

change directory to test

23
Q

cp /home/user1/test/file1 .

A

Copy file1 from (test directory located in user1 from home) to current location

24
Q

cd ~user1

A

Change to home directory (user1)

25
Q

su root

A

enter root, requires password

26
Q

rm file0

A

remove file

27
Q

Print the working directory you are in

A

pwd

28
Q

Return directly to its home directory

A

cd ..

29
Q

List all files in the working directory

A

ls

30
Q

Display detailed information about all files in the working directory and sort by their modification time in ascending order.

A

ls –rtl

31
Q

Display detailed information about all files in the working directory.

  • Column 1: The permissions on the particular file for user, group and others,
  • Column 2: The number of files contained in the particular directory.
  • Column 3: user
  • Column 4: group
  • Column 5: the size of the file in KB.
  • Column 6: month and day at which the file was created or last modified.
  • Column 7: the name of the file
A

ls –l

32
Q

Change the working directory to your home directory

A

cd

33
Q

Short for make directory. Used to create directories.

A

mkdir test

34
Q

Short for remove directory. Used to remove/ delete directories.

A

rmdir test

35
Q

chmod [newpermission] [filenames]

A
  • *chmod commands:**
  • *The way to use this format:**
36
Q

u

User (yourself)

g

Group

o

others (rest of the world)

a

All of the above (u,g and o)

-

Remove this permission

+

Add this permission

r

Read access

w

Write access

x

Execute access

A

The following are symbolic parameters used by the command chmod

37
Q

Lets take -r–r–r– as an example the first part _-_r–r–r– shows what kind of file it is. The table to the right shows each symbol with its meaning. In this case it is a file. The other part is -_r–_r–r– this shows the permissions for the user. -r–_r–_r– this shows the permissions for the group. And finally -r–r–r– this shows the permissions for others.

-

File

c

Character device file

d

Directory

l

Symbolic link or shortcuts

A

To better understand the chmod command you must divide the first column into parts:

38
Q

Remove read access from group

A

chmod g-r test

39
Q

Remove read access from others (the rest of the world)

A

chmod o-r test

40
Q

Remove Execute access from group and others

A

chmod go-x test

41
Q

Remove read, write and execute access from user (yourself)

A

chmod u-rwx test

42
Q

Add read, write and execute access to user, group and others

A

chmod uog+rwx test

43
Q

Get information on currently logged in users.

  • Column 1: user name
  • Column 2: show how the user is connected. tty means the user is connected directly to the computer, while pts means the user is connected from remote.
  • Column 3 & 4: date and time
  • Column 5: show IP address where the users are connected.
A

who

44
Q

See processes on the system. Pipes the output to “less” to make it scrollable. Divide the output to pages.

A

ps –ef

45
Q

See processes on user 4 system

A

ps –fu user4

46
Q

Create new, empty file

A

touch file4

47
Q

move file4 to the directory (test)

A

mv file4 test

48
Q

change directory to test

A

cd test

49
Q

Copy file1 from (test directory located in user1 from home) to current location

A

cp /home/user1/test/file1 .

50
Q

Change to home directory (user1)

A

cd ~user1

51
Q

enter root, requires password

A

su root

52
Q

remove file

A

rm file0