ECM 1413 Linux commands Flashcards

1
Q

ls

A

list files and directories

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

ls options

A

-l: Long format listing

-a: Include hidden files

-h: Human-readable files

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

cd

A

change directory

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

pwd

A

Print current working directory

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

mkdir

A

make new directory

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

rm

A

Remove files and directories

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

rm options

A

-r: Remove directories recursively
-f: Force removal without confirmation

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

cp

A

copy files and directories

(-r to copy recursively)

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

mv

A

move/rename files and directories

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

touch

A

create an empty file or update file timestamps

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

cat

A

view the contents of a file

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

head

A

Display the first few lines of a file

-n to specify the number of lines to display

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

tail

A

Display the last few lines of a file

-n to specify the number

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

ln

A

create links between files

-s to create a soft link (hard by default)

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

find

A

search for files and directories

-name to search by file name
-type to search by file type

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

chmod

A

change file permissions

u: user/owner permissions

g: group permissions

o: other permissions

+: add permissions

-: remove permissions

=: set permissions explicitly

17
Q

chown

A

change file ownership

18
Q

chgrp

A

change group ownership

19
Q

unmask

A

set default file permissions

20
Q

tar

A

create or extract archive files

-c: create a new archive

-x: Extract files from an archive

-f: Specify the archive file name

-v: verbose mode

-z: compress the archive with gzip

-j: compress the archive with bzip2

21
Q

gzip

A

compress files

-d: Decompress files

22
Q

zip

A

Create compressed zip archives

-r: Recursively include directories

23
Q

ps

A

Display running processes

-aux: Show all processes

24
Q

top

A

Monitor system processes in real-time

25
kill
Terminate a process -9: Forcefully kill a process
26
pkill
terminate processes based on name
27
pgrep
List processes based on their name
28
grep
used to search for specific patterns or regular expressions in text files or streams and display matching lines.
29
*
wildcard equating to 0 or more characters
30
?
wildcard equating to exactly 1 character
31
[]
wildcard. Matches any one of the enclosed characters in the [].
32
[a-z]
wildcard. Matches any one of the enclosed characters in the [] in a specified range.
33
{}
wildcard equating to any of the comma-separated characters in the {}