Command Line Flashcards

1
Q

od

A

display file content’s in octal

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

nl

A

number lines in text file

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

sort

A

sorts in alphabetic order

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

sort -n

A

sort in numerical order

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

less

A

pager utility lets you move through file one page at a time, more flexible than more

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

head

A

lists top ten lines of text file

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

tail

A

shows last ten lines of text file

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

wc

A

displays file lines, words, and bytes

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

uniq

A

finds repeat lines in a text file

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

md5sum

A

can check a files integrity

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

name the secure hash algorithms

A

sha224sum, sha256sum, sha384sum, sha512sum

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

secure hash algorithms

A

can be used to check file integrity, generally used for cryptography

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

grep

A

filters text files

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

STDOUT

A

directs output to terminal

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

>

A

sends the command’s output

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

> >

A

appends data to preexisting file

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

The file descriptor that identifies a command or script file error is

A

2

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

how do you make grep use extended regular expressions (ERE)?

A

grep -E or egrep

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

The file descriptor that identifies output from a command or script file is

A

1

20
Q

STDERR

A

identifies a command or script file error

21
Q

The file descriptor that identifies an input into a command or script is

A

0

22
Q

STDIN

A

identifies an input into a command or script

23
Q

2>

A

redirect STDERR to a specified file.

24
Q

A

redirect STDERR to the specified file. (append)

25
Q

&>

A

redirect STDOUT and STDERR to the specified file

26
Q

A

redirect STDOUT and STDERR to the specified file (append)

27
Q
A

redirect STDIN from the specified file into the command

28
Q

<>

A

redirect STDIN from the specified file into command and redirect STDOUT to the specified file

29
Q

where is the password file

A

/etc/passwd

30
Q

|

A

redirect STDOUT, STDIN, and STDERR between multiple commands

31
Q

sed

A

stream editor

32
Q

stream editor

A

modifies text that is passed to it via a file or output from a pipeline

33
Q

echo “I like cake.” | sed ‘s/cake/donuts’

A

I like donuts

34
Q

echo “I love cake and more cake.” | sed ‘s/cake/donuts/g’

A

I love donuts and more donuts.

35
Q

watch

A

use it to enact a command over and over again

36
Q

placing an & after a command does what?

A

runs it in the background

37
Q

sleep

A

used for adding a pause in a shell script.

38
Q

how do you specify the number of seconds for sleep to run?

A

sleep n

39
Q

jobs

A

allows you to see any processes that belong to you that you are running

40
Q

how do you return a program to the foreground?

A

fg %[job number]

41
Q

jobs -l

A

lists jobs

42
Q

Ctrl+Z

A

pauses a process

43
Q

how do you send a program to the background?

A

bg %[job number]

44
Q

what is the syntax to stop a job in the background with the kill command?

A

kill %[job number]

45
Q

what command keeps a job running after logout?

A

nohup [command] &