Use Basic Unix Commands for cURL


cURL, a command-line-only program, is used to request and retrieve data and information from your server. These requests to the server are made using several kinds of protocols such as LDAP, HTTP, SFTP, FTP, TELNET, TFTP, and many others. The greatness of the cURL command line is based on the fact that its operations can be very, very complex. And because of the complexity and elaborateness of the operations in cURL, this is also its downfall. Even the most basic UNIX commands can be used in cURL. Just follow the few basic steps below for using UNIX commands in cURL.

  • Activate cURL. cURL is really easy to activate. You just have to type (at a BASH prompt) “curl [url]”, in which your “[url]” will be the Resource Locator Address of the data that you want to request from the server. If no output is specified, cURL will receive the data and save it in the same location where your command was used.
  • Know the defaults of cURL. By default, there are several efficient ways cURL uses to retrieve data. In its first step, cURL will try to automatically figure out the proper protocol to use solely based on the commands you type. When the URL typed in is a bit ambiguous, HTTP will be the first protocol used. But when the URL used has a familiar hostname, like the URL ftp.myurl.com, then cURL will try to use the FTP protocol using the hostname.
  • Understand request consolidation. As an additional feature, cURL will also try to consolidate or merge all the requests that are coming in to one server. This means the program will attempt to combine all the commands to the server into a single server request to avoid using multiple sessions and adding traffic to the TCP overhead.
  • A list of some basic UNIX commands to be used in the program
    • -create-dirs
      • This command will produce a mirrored hierarchy tree from the composition of the requested URL. The command must also be used with the option –o, where it states the location where your data will be saved locally. In the –o option, if no directory name is used or if the name of the directory mentioned already exists, no directory will be created.
    • -d
      • The –d command is also like a common “POST” command in HTTP. This option is very useful in copying browser instances in which the user would type a value in a text input form.
    • -f
      • This command is very close to the –d command. The only difference is that this type of command will send your POST only upon pressing the Submit button.
    • -o [file]
      • The –o command writes data to the location specified in the command, where the [file] is the path used for saving the data.
    • -u user:password
      • This command will specify the username and password used in accessing the server.
    • -s
      • This command will activate silent mode, where no outputs are displayed.
    • -v
      • This command will put your program into Verbose mode, where statistics and status bars are produced simultaneously with the data received.
    • -A
      • This command is used to name a specific Browser Agent String.
    • -h or –help
      • This option will list down commands that can be used in cURL.


Now you are already armed with these basic commands, which you can further branch out and study in the future. Good luck!









Use Basic Unix Commands for cURL


Use Basic Unix Commands for cURL : Multi-thousand tips to make your life easier.


cURL, a command-line-only program, is used to request and retrieve data and information from your server. These requests to the server are made using several kinds of protocols such as LDAP, HTTP, SFTP, FTP, TELNET, TFTP, and many others. The greatness of the cURL command line is based on the fact that its operations can be very, very complex. And because of the complexity and elaborateness of the operations in cURL, this is also its downfall. Even the most basic UNIX commands can be used in cURL. Just follow the few basic steps below for using UNIX commands in cURL.

  • Activate cURL. cURL is really easy to activate. You just have to type (at a BASH prompt) “curl [url]”, in which your “[url]” will be the Resource Locator Address of the data that you want to request from the server. If no output is specified, cURL will receive the data and save it in the same location where your command was used.
  • Know the defaults of cURL. By default, there are several efficient ways cURL uses to retrieve data. In its first step, cURL will try to automatically figure out the proper protocol to use solely based on the commands you type. When the URL typed in is a bit ambiguous, HTTP will be the first protocol used. But when the URL used has a familiar hostname, like the URL ftp.myurl.com, then cURL will try to use the FTP protocol using the hostname.
  • Understand request consolidation. As an additional feature, cURL will also try to consolidate or merge all the requests that are coming in to one server. This means the program will attempt to combine all the commands to the server into a single server request to avoid using multiple sessions and adding traffic to the TCP overhead.
  • A list of some basic UNIX commands to be used in the program
    • -create-dirs
      • This command will produce a mirrored hierarchy tree from the composition of the requested URL. The command must also be used with the option –o, where it states the location where your data will be saved locally. In the –o option, if no directory name is used or if the name of the directory mentioned already exists, no directory will be created.
    • -d
      • The –d command is also like a common “POST” command in HTTP. This option is very useful in copying browser instances in which the user would type a value in a text input form.
    • -f
      • This command is very close to the –d command. The only difference is that this type of command will send your POST only upon pressing the Submit button.
    • -o [file]
      • The –o command writes data to the location specified in the command, where the [file] is the path used for saving the data.
    • -u user:password
      • This command will specify the username and password used in accessing the server.
    • -s
      • This command will activate silent mode, where no outputs are displayed.
    • -v
      • This command will put your program into Verbose mode, where statistics and status bars are produced simultaneously with the data received.
    • -A
      • This command is used to name a specific Browser Agent String.
    • -h or –help
      • This option will list down commands that can be used in cURL.


Now you are already armed with these basic commands, which you can further branch out and study in the future. Good luck!


Use Basic Unix Commands for cURL

Use Basic Unix Commands for cURL : Multi-thousand tips to make your life easier.
Use Basic Unix Commands for cURL
Use Basic Unix Commands for cURL
Recommend to friends
  • gplus
  • pinterest

Comment

Leave comment

Rating