Linux 3 Flashcards
cURL lets us _______ from the command line.
query a URL
What is the simplest thing to do with cURL?
Make an HTTP request to a given server and print its response out to the console.
What flag can you use to provide more information about server response?
curl -i
What flag can you use to follow a redirect?
-L
What flag can we use to download a file from a URL using cURL?
curl -O
How can we give a downloaded file a custom name using the curl command?
curl -o desired_name
What flag can you use to change the kind of request you are sending with the curl command?
-X
What is the usage format of the find command?
Find
What option do we use with find to search for the name of a file?
-name
e.g.: find . -name james.txt
(find, in the current parth, a file named james.txt
What option makes the find command search for a pattern within a path?
-path
What is the use of the type flag within the find command?
-type f and -type d flags tell the command to search for files or directorys, respectively.
How would we search for files whose path name contains session and whose file name contains mem?
find . -path *session* -type f -name *mem*
What kind of query is it when you use the -name and the -path flags together?
an AND query
How can you use the find command to do an OR query?
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
Most of the problems you’ll run into with find queries arise because of _____.
improper escaping.