DEV Community

Ibrar Hussain
Ibrar Hussain

Posted on

Useful Commands for Ubuntu

Following are the handy/useful list of commands & usage that we need from time to time.

Table Of Contents

Curl

  • Download a remote file
curl -O [URL]
Enter fullscreen mode Exit fullscreen mode

Or

curl –-remote-name [URL]
Enter fullscreen mode Exit fullscreen mode

An example would be:

curl -O https://en-au.wordpress.org/latest-en_AU.zip
Enter fullscreen mode Exit fullscreen mode

Or

curl –-remote-name https://en-au.wordpress.org/latest-en_AU.zip
Enter fullscreen mode Exit fullscreen mode
  • To save a remote file with a different name:
curl –O [FILENAME] [URL]
Enter fullscreen mode Exit fullscreen mode
  • Download multiple remote files
curl -O [URL1] -O [URL2]
Enter fullscreen mode Exit fullscreen mode
  • Download a remote file via FTP
curl -O [FTP_URL]
Enter fullscreen mode Exit fullscreen mode
  • Download remote files via FTP with credentials
curl -u [FTP_USER]:[FTP_PASSWORD] -O [FTP_URL]
Enter fullscreen mode Exit fullscreen mode

Wget

  • Download a remote file
wget [URL]
Enter fullscreen mode Exit fullscreen mode
  • Download a remote file with a different name
wget -O [FILENAME] [URL]
Enter fullscreen mode Exit fullscreen mode
  • Download a remote file via FTP
wget [FTP_URL]
Enter fullscreen mode Exit fullscreen mode
  • Download files via FTP with credentials
wget -u [FTP_USER]:[FTP_PASSWORD] -O [FTP_URL]
Enter fullscreen mode Exit fullscreen mode

Unzip

  • Test if a zip file is valid file
unzip -t [ZIP_FILE_PATH]
Enter fullscreen mode Exit fullscreen mode

An example would be:

unzip -t ./test.zip
Enter fullscreen mode Exit fullscreen mode
  • List contents of a zip file
unzip -l [ZIP_FILE_PATH]
Enter fullscreen mode Exit fullscreen mode
  • Extract a zip file
unzip [ZIP_FILE_PATH]
Enter fullscreen mode Exit fullscreen mode
  • Extract a zip file to a different location/directory
unzip [ZIP_FILE_PATH] –d [DESTINATION_DIRECTORY_PATH]
Enter fullscreen mode Exit fullscreen mode

Top comments (0)