Commands Flashcards

1
Q

Print to Standard Output

A

echo

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

Change Directory

A

cd

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

Manual Page

A

man

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

Print Working Directory

A

pwd

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

List directory

A

ls (ls -a to list hidden files)

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

Make Directory

A

mkdir (mkdir -p to create nested directories)

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

Delete file

A

rm (rm -rf to force delete)

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

Delete Directory

A

rmdir

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

Copy

A

cp

cp -R (select a directory to copy)

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

Move

A

mv

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

Create a link

A

ln

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

Print contents of file

A

cat

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

Print contents of file with paging

A

less

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

Evaluate an expression

A

expr

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

Create a data disc

A

dd

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

Check for a regular expression

A

grep

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

Search for processed by regular expression

A

pgrep

pgrep -l to list PID and process name

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

Use extended regular expressions

A

egrep

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

Print the field at a particular index in a record

A

awk

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

Edit each line of text

A

sed

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

Determine type of file

A

file

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

Find files matching a specific criteria

A

find

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

Update Database of files

A

updatedb

24
Q

Search database for an entry

A

locate

25
Q

Extract the file name and remove extension

A

basename

26
Q

Extract a directory name

A

dirname

27
Q

Resolve the path for a file

A

realpath

28
Q

Extract first few lines of a file

A

head

29
Q

Extract the last few lines of a file

A

tail

30
Q

Reverse the input

A

rev

31
Q

Word count

A

wc

32
Q

Extract a charcter or word from input

A

cut

33
Q

Translate characters

A

tr

34
Q

Reads one record from input into the shell variable

A

read

35
Q

Print or set the system date

A

date

36
Q

Print the full path to the executable

A

type

37
Q

set shell variables

A

set

38
Q

Print os name

A

uname

39
Q

Print list of currently logged in users

A

w

40
Q

Compare two files to check if they are the same

A

cmp

41
Q

Compare to files to seee if they are different

A

diff

42
Q

List current running processes

A

ps

43
Q

Show system data and counters

A

top

44
Q

Kill a process

A

kill

45
Q

Pause activity in CPU

A

sleep

46
Q

Lists any unique (non-repetitive) records in input.

A

uniq

47
Q

Changes the permissions of to match .

A

chmod

48
Q

Changes the owner of to .

A

chown

49
Q

Create a file

A

touch

50
Q

Create an archive

A

tar

51
Q

Compress/Defalte an archive

A

gzip (gunzip to extract)

52
Q

Get url

A

wget

53
Q

Explain the difference between hard links and symbolic links

A

Hard links are simply another name for the original file

Symbolic links provide a pointer to the original file

54
Q

Test

A

Check if a condition is true or false

55
Q

Evaluate an expression

A

expr

56
Q

How do you examine the exit status of previous command

A

Echo the exit status of the previous command using a special shell variable:

$?

This is useful for confirming the result of the test command.

0 is true, 1 is false

57
Q

Word count

A

wc