Zip or Unzip Files and Folders Using Command Line on Ubuntu Server
To zip or unzip files and folders using the command line on Ubuntu Server, you can use the "zip" and "unzip" commands respectively. Here are the steps:
To zip a file or folder:
Open the terminal on your Ubuntu Server.
Navigate to the location of the file or folder that you want to zip using the "cd" command. For example, if your file is located in the "Documents" folder, type "cd Documents" and press Enter.
Type the following command:
zip -r zipfile.zip foldername/
Replace "zipfile.zip" with the name you want to give to the zip file, and "foldername/" with the name of the folder that you want to zip.
Press Enter. The command will create a zip file of the specified folder.
To unzip a file:
Open the terminal on your Ubuntu Server.
Navigate to the location where the zip file is located using the "cd" command.
Type the following command:
unzip zipfile.zip
Replace "zipfile.zip" with the name of the zip file that you want to unzip.
Press Enter. The command will extract the contents of the zip file into a new folder in the current directory.
That's it! You now know how to zip and unzip files and folders using the command line on Ubuntu Server.
Comments
Post a Comment