NWP lab1 Flashcards

(52 cards)

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
su root
enter root, requires password
26
rm file0
remove file
27
Print the working directory you are in
pwd
28
Return directly to its home directory
**_cd .._**
29
List all files in the working directory
ls
30
Display detailed information about all files in the working directory and sort by their modification time in ascending order.
ls –rtl
31
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
ls –l
32
Change the working directory to your home directory
cd
33
Short for make directory. Used to create directories.
mkdir test
34
Short for remove directory. Used to remove/ delete directories.
rmdir test
35
**chmod [newpermission] [filenames]**
* *_chmod commands:_** * *The way to use this format:**
36
**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**
**The following are symbolic parameters used by the command chmod**
37
**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**
**To better understand the chmod command you must divide the first column into parts:**
38
Remove read access from group
chmod g-r test
39
Remove read access from others (the rest of the world)
chmod o-r test
40
Remove Execute access from group and others
chmod go-x test
41
Remove read, write and execute access from user (yourself)
chmod u-rwx test
42
Add read, write and execute access to user, group and others
chmod uog+rwx test
43
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.
who
44
See processes on the system. Pipes the output to “less” to make it scrollable. Divide the output to pages.
ps –ef
45
See processes on user 4 system
ps –fu user4
46
Create new, empty file
touch file4
47
move file4 to the directory (test)
mv file4 test
48
change directory to test
cd test
49
Copy file1 from (test directory located in user1 from home) to current location
cp /home/user1/test/file1 .
50
Change to home directory (user1)
cd ~user1
51
enter root, requires password
su root
52
remove file
rm file0