Linux 3 Flashcards

1
Q

cURL lets us _______ from the command line.

A

query a URL

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

What is the simplest thing to do with cURL?

A

Make an HTTP request to a given server and print its response out to the console.

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

What flag can you use to provide more information about server response?

A

curl -i

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

What flag can you use to follow a redirect?

A

-L

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

What flag can we use to download a file from a URL using cURL?

A

curl -O

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

How can we give a downloaded file a custom name using the curl command?

A

curl -o desired_name

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

What flag can you use to change the kind of request you are sending with the curl command?

A

-X

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

What is the usage format of the find command?

A

Find

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

What option do we use with find to search for the name of a file?

A

-name
e.g.: find . -name james.txt
(find, in the current parth, a file named james.txt

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

What option makes the find command search for a pattern within a path?

A

-path

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

What is the use of the type flag within the find command?

A

-type f and -type d flags tell the command to search for files or directorys, respectively.

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

How would we search for files whose path name contains session and whose file name contains mem?

A

find . -path *session* -type f -name *mem*

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

What kind of query is it when you use the -name and the -path flags together?

A

an AND query

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

How can you use the find command to do an OR query?

A

Using the -or flag within parantheses.
e.g. find . (-name *.gemspec -or -name *.jpg ) -type f
notice we are using backslashes to escape special characters

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

Most of the problems you’ll run into with find queries arise because of _____.

A

improper escaping.

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

How can we search for files or directories that don’t match a certain pattern?

A

using the -not operator in front of the -path flag

e.g. find . -not -path *t* -type f

17
Q

What is another way to call the -not operator?

A

with a bang

e.g. find . ! -path *t* -type f

18
Q

How can you search for files whose last modified date was the last n days.

A
  • mtime

e. g. find . -mtime -1

19
Q

How can we look for files that have been modified in that last n minutes?

A

find . -mmin -n

20
Q

How can we search for files whose size is greater than 200 kilobytes?

A

find . -size +200k

21
Q

What are the modifiers for the -size flag for kilobytes, megabytes, gigabytes, terabytes, and petabytes?

A

k M G T P

22
Q

How can we find a bunch of files, print them, and delete them with the find command?

A

find ./guides -type f -name *.yml -print -delete