Trending February 2024 # How To Access And Use Onedrive On Linux # Suggested March 2024 # Top 10 Popular

You are reading the article How To Access And Use Onedrive On Linux updated in February 2024 on the website We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested March 2024 How To Access And Use Onedrive On Linux

Microsoft OneDrive is a popular cloud storage service that allows you to store and access your important files from any device. However, it’s worth noting that OneDrive doesn’t offer official support for Linux. Luckily, there are several ways for you to access and synchronize your OneDrive files on a Linux system.

This article guides you through various methods to integrate OneDrive with your Linux environment. With these methods, you can access and manage your OneDrive files seamlessly within your Linux file systems.

Table of Contents

Can You Use OneDrive on Linux?

Yes, you can access and use OneDrive on Linux in a few different ways. While there isn’t an official OneDrive client for Linux, several unofficial alternatives are available.

For instance, you can use an open-source, unofficial OneDrive client for Linux or a command-line tool like rclone instead. You can also access your OneDrive files quickly from your web browser.

Remember that these are unofficial solutions; your experience might vary depending on the tool and your Linux distribution. Regardless, these options allow you to integrate OneDrive into your Linux workflow.

Using the Unofficial OneDrive Client for Linux

The unofficial OneDrive client for Linux allows you to access and use OneDrive on Linux systems. Please note that this unofficial client isn’t supported by Microsoft in any way—you’ll need to use it at your own risk.

While it’s not officially supported, the OneDrive client for Linux is a free, open-source, and well-maintained option for Linux users to use.

Installing the Unofficial OneDrive Client for Linux

Follow these steps to download and install the Unofficial OneDrive client for Linux on a Debian or Ubuntu-based Linux system. Other distributions may need to follow different instructions.

    Open the terminal on your Linux PC.

      Update your package manager by typing

      sudo apt update

      and wait for it to complete.

      Once your package manager is updated, run

      sudo apt install


      no-install-suggests ldc onedrive

      in the terminal and wait for it to complete.

        Configuring and Using the Client

        At this point, you should have successfully installed the unofficial Linux OneDrive client. You’ll need to configure it next to access your files.

          To run the client for the first time and generate the default configuration file, type


          into the terminal.

          You’ll be prompted to visit a Microsoft URL to authenticate and grant access to your OneDrive account. Open the URL in a web browser, sign in with your Microsoft credentials, and grant the necessary permissions.

            After granting permissions, you’ll see a blank page—copy the URL, paste it back into the terminal, and press the



              The client will alert you if you were successful. To start synchronisation, type

              onedrive –synchronize

              into the terminal. This should start synchronizing your OneDrive files to a local folder (


              by default). You’ll need to allow time for this process to complete.

              If you want the client to run in the background, type and run

              onedrive –monitor

              from your terminal.

              For more information on the client’s features and settings, you can refer to the official documentation for the client on GitHub.

              How to Access OneDrive on Linux Using Rclone

              rclone is a powerful, open-source terminal tool for synchronizing and transferring files across local or remote systems on a Linux PC. By using rclone, you can set up your Linux PC to allow access to your OneDrive storage.

              To use rclone with OneDrive on Linux, follow these steps.

                  Once Rclone is installed, type

                  rclone config

                  into the terminal to initiate the configuration process.

                  When prompted, select the


                  key to create a new remote, and then enter a name for your OneDrive remote (such as



                    Next, locate the number for

                    Microsoft OneDrive

                    as the storage provider (typically


                    ), type it in, and press


                    to confirm.


                      client id


                      client secret

                      , leave blank and press



                      Choose your authentication region for OneDrive (typically by pressing


                      and hitting enter), then choose


                      to use the typical setup process to authenticate.

                        When prompted, press


                        to open a web browser to sign in. Enter your OneDrive account details and authorize Rclone to access your OneDrive account and storage by following the on-screen instructions.

                          After the configuration is complete, close the browser and return to the terminal.

                          Choose your OneDrive configuration—typically


                          for standard OneDrive access. Press the


                          key to continue.

                            Choose your OneDrive ID from the options provided, typically by pressing


                            and hitting the





                              again to confirm.

                                At this point, the configuration should be complete. Press


                                to confirm again and make it your default configuration.



                                  to exit the configuration tool. You can use the


                                  command to interact with your OneDrive files. For instance, to list the contents of your OneDrive account, run the command

                                  rclone ls onedrive:

                                  in your terminal.

                                    To download a file from your OneDrive account, run the command

                                    rclone copy onedrive:/path/to/file /path/to/local/directory

                                    in the terminal. Replace the


                                    paths with the file location and the location where you’d like to save the file on your local PC.

                                    To upload a file to your OneDrive account, run the command

                                    rclone copy /path/to/local/file onedrive:/path/to/remote/directory

                                    . Replace the


                                    paths with the file location and location in your OneDrive storage that you’d like to upload the file to.

                                      You can also use the

                                      rclone sync

                                      command to synchronize all of the files between your OneDrive account and your local Linux filesystem. For example, to synchronize all files in your OneDrive account to a local directory called


                                      , run the command

                                      rclone sync onedrive: ~/onedrive


                                      To synchronize a specific directory in your OneDrive account to a local directory, run the command

                                      rclone sync onedrive:/path/to/remote/directory /path/to/local/directory

                                      and replace the


                                      paths with the correct remote and local directories.

                                      How to Access OneDrive on Linux Using Your Web Browser

                                      Don’t want to install any additional software? You can quickly access your OneDrive files from a Linux PC using your web browser.

                                      You can also share your files with others by selecting the file and pressing the Share button.

                                      Remember that changes made to files and documents on the OneDrive website will be synchronized with any other devices connected to your Microsoft account.

                                      Managing Your Linux Files

                                      Using OneDrive on Linux can be achieved using one of the tools above (or by using the OneDrive website). Although Microsoft doesn’t offer a native OneDrive application for Linux, these alternatives provide a similar experience.

                                      Worried about your files? Remember to keep your file backups automated, ensuring your data stays secure and up to date. Be mindful of potential OneDrive sync issues that could arise, and always double-check your settings if you run into problems.

                                      You're reading How To Access And Use Onedrive On Linux

                                      How To Use Onedrive Files On

                                      OneDrive Files On-Demand helps gain access to all the files in OneDrive without needing to download them and waste device storage. You will never lose your files, and they won’t even take up any space on your hard disk. What could be more convenient than that? So, if you aren’t already onboard the OneDrive train, here is a guide to help you find your way through OneDrive Files On-Demand. You need to have Windows 11/10 and add your account to sign in with.

                                      OneDrive Files On-Demand in Windows 11/10

                                      On turning on Files On-Demand, you will have all your files in the File Explorer. You will also get new info about every file. The files you create online or on some device other than the one you are accessing them from, will not take any storage space on the device. With an active internet connection, you can access and edit every file as if they were on the device. All changes will be saved, they can even be shared, but they won’t take up any hard disk space. The only files that will take up hard disk space are obviously, only the ones you created or downloaded on the device.

                                      How to enable OneDrive Files On-Demand

                                      You may or may not have Files On-Demand active on your Windows PC. Here is how to turn on OneDrive Files On-Demand  if it isn’t already enabled.

                                      1] Sign in to OneDrive on the device from which you want to access Files On-Demand.

                                      3] Go to ‘Settings’ tab.

                                      This way you would have enabled the Files On-Drive feature to use files without downloading them while the internet is on and have the option to download them for offline mode as well.

                                      If you can’t find the Files On-Demand option even after installing OneDrive, it is because:

                                      Files On-Demand needs Windows 10 Fall Creators Update or a later version. Make sure you have that.

                                      You need to install the latest version of OneDrive.

                                      You need to restart your device to let the latest updates come into effect.

                                      You might need to launch OneDrive on the device.

                                      You will need to sign in with one of your OneDrive accounts.

                                      Following these steps will ensure Files On-Demand is available for use.

                                      Files On-Demand settings are saved device-wise and not account-wise. So you will need to do this on every device you want to access your OneDrive Files On-Demand from.

                                      With OneDrive Files On-Demand you can choose to use some files or folders online only and some in offline mode as well. That means you have the option to download some and keep some on the Cloud alone. This is how you can do it:

                                      Select “Always keep on this device” for offline use or ‘Free up space’ to keep it on the drive.

                                      With the ‘Always keep on this device’ option, new files and folders will be downloaded and saved on the device for offline use. Even an ‘online-only’ folder can have individual files that are always available.

                                      Hide a folder on OneDrive

                                      Here’s how to hide your personal files and folders on OneDrive:

                                      Run OneDrive and go to ‘Activity Center’.

                                      Go to ‘Settings’ followed by ‘Choose folders’.

                                      How to sign into OneDrive

                                      When you add a new account or download OneDrive for the first time on your desktop, you will need to sign in. Here’s how:

                                      Go to ‘Settings’ followed by ‘Account’.

                                      Go to ‘add an account’ and enter your preferred account to sign in.

                                      OneDrive Files On-Demand Quick facts

                                      Here are some quick facts that you might want to know about OneDrive:

                                      1] Deleting an online-only file through the device used to log into OneDrive will result in deleting the file forever and from everywhere. It will no more be available on the cloud storage.

                                      2] You can restore one such deleted file or folder from the OneDrive recycle bin within 30 days from deletion. The OneDrive recycle bin is the place you look for accidentally deleted files and folders.

                                      3] Deleting a locally available file will result in the file moving to the recycle bin of the device. From there it can be restored through regular recycle bin restoring ways.

                                      4] Changing a file to ‘online-only’ doesn’t delete a file. It just removes it from all devices. You will be able to access it from any device with which you sign into OneDrive.

                                      5] You can also use desktop search for OneDrive files. However, for the ‘online-only’ files, you will need to search within the Drive. They aren’t recorded on the device.

                                      6] Windows might automatically start downloading files for various apps on your device. If you do not want that, you can immediately ‘Cancel download’ and then follow through with ‘Block app’.

                                      7] Avoid blocking apps you often use OneDrive files with. Trust only known apps.

                                      How do I access OneDrive Files On-Demand? Why can’t I see Files On-Demand in OneDrive?

                                      In order to use Files On-Demand in OneDrive, a few things need to be matched. First, you must use Windows 10 v1709 or a later version. It is not available in Windows 8.1 or Windows 7. Secondly, you must sign in to your OneDrive account. Otherwise, most options, including Files On-Demand, are not visible in the OneDrive Options wizard.

                                      Now that you know almost everything about the Windows Files On-Demand, you can get started.

                                      How To Use Access Control Lists To Control File Permissions On Linux

                                      A very useful feature in Linux is the “Access Control Lists” which controls access to files and directories. Here is how the access control lists work to control the file permissions in Linux.

                                      Note: To thoroughly grasp how access control lists work, we’re first setting up some users and groups on a working Linux system. The following exercise is carried out on a virtual machine running Kali operating system. The root user has the power to add new users to the system and allot them to groups.

                                      Creating users and groups

                                      Firstly, we will log in as root, create users and put them in respective groups as shown in the table below. The users have been given simple names to help comprehend the concept better.

                                      User Group

                                      john3 johns

                                      jane2 janes

                                      We will use the adduser command to add new users to the system.

                                      The id command will display the details of the newly created user. It will show the user id (uid), group id (gid) and group name (groups). The user, upon creation, is automatically added to a group with the same name as the user name. That user would be the sole member of the group.

                                      Likewise, users “john2” and “john3” are also created.

                                      adduser john2 adduser john3

                                      Once the three users have been created, use theid command to view the respective user and group ids.

                                      We can see that the three users are in their own groups – 1000, 1001 and 1002. According to the table shown earlier, we want the three users to be in the same group: johns. Since such a group does not exist on the system currently, we will create it with the groupadd command:

                                      The new group ID is specified as 5000. If the -g switch is ignored, then the system will automatically pick a group ID. The name of the new group is “johns.” Now the three users – “john1,” “john2” and “john3” – need to be added as members of this group. We will use the usermod command for this task.

                                      The same process is done for users “john2” and “john3.”



                                      johns john2 usermod


                                      johns john3

                                      Finally, details of the three users in the “johns” group can be viewed using id command.

                                      We have successfully created three users and added them to the same group.

                                      Similarly, users “jane1” and “jane2” are created and added to the “janes” group with gid 6000. Their details can be viewed using the id command as shown below.

                                      What is the need for Access Control Lists?

                                      Let’s assume user “john1” logs in,

                                      creates a new file in the Home directory,

                                      and adds some content to it.

                                      Using thels command, we view the file’s metadata.

                                      The first few characters in the output, - rw - r - - r - - account for the permission string. Let us dissect it.

                                      – rw – r – – r – –

                                      file type permissions john1 has on the file permissions members of johns group have on the file permissions given to others not in johns group

                                      This article is a good primer on file permissions.

                                      What if “john1,” being the file owner, wants to additionally give write permissions only to “john2” and “jane1” but persist with read permissions for “john3” and “jane2?”

                                      rw – r – –

                                      jane1 jane2

                                      One option would be to create a new group with read, write permissions for “john1,” “john2” and “jane1” and another group with only read permissions for “john3” and “jane2.” In case john1 wishes to modify permissions further for any group member, then more groups need to be created. Creating and managing multiple groups is a burden to the system administrator.

                                      Instead, an “Access Control List” can be created for a file which would clearly state the operations any user can perform on that file.

                                      How to Create an Access Control List (ACL) for a file?

                                      Every file upon creation has an ACL assigned to it. Using it efficiently is simply a matter of modifying it. Only the file owner and root user can modify the ACL of a file.

                                      We can use the getfacl command to view the existing ACL:

                                      Let us use the setfaclcommand to modify the existing ACL on the file.

                                      entity name permissions

                                      user (u) or group(g) or others(o)

                                      the read,write,execute permissions are denoted by the letters r,w,x

                                      “john2” is first given read, write access to the file,

                                      followed by “jane1.”

                                      Let us view the updated ACL for “secretfile.”

                                      We can see that read and write permissions have been assigned to “john2” and “jane1.”

                                      Verifying the authenticity of the ACL

                                      We can see that “john2” is able to read the file and write to it.

                                      The new information entered by “john2” has been appended to the file.

                                      Likewise, “jane1” gets the same privilege – read access and write access.

                                      But “john3” in the same group is unable to write to the file.

                                      “jane2,” who belongs to the other category, is also unable to write to the file.


                                      The same process can be extended to directories, too. Access Control Lists enable a system administrator to handle file and directory access in an adept manner.

                                      Divya Lakshmanan

                                      Divya divides her time between speculating the existence of aliens and writing about her technical findings.

                                      Subscribe to our newsletter!

                                      Our latest tutorials delivered straight to your inbox

                                      Sign up for all newsletters.

                                      By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.

                                      How To Use Bigbluebutton For Web Conferencing On Linux

                                      In today’s online world, we’re becoming more and more connected with web conferencing. School, work, and even friendships are taking place over platforms like Zoom, WebEx, and Google Hangouts. However, for those of us looking for an open-source option, there aren’t all that many. That’s where BigBlueButton comes in, which is an open-source web-conferencing and e-learning platform that you build yourself. Here we show you how to use BigBlueButton for web conferencing on Linux.

                                      Before You Install BigBlueButton

                                      I won’t quote the documentation page much, but there are a couple of things to note about installing BigBlueButton on Linux.

                                      The first is that if you’re planning to use it in production, you will need more than the specs I’m using. Their installation page states that you should have the following to run an actual server:

                                      Ubuntu 16.04 64-bit OS running Linux kernel 4.x

                                      16 GB of memory with swap enabled

                                      8 CPU cores, with high single-thread performance

                                      500 GB of free disk space (or more) for recordings or 50GB if session recording is disabled on the server

                                      TCP ports 80 and 443 accessible

                                      UDP ports 16384 – 32768 accessible

                                      250 Mbits/sec bandwidth (symmetrical) or more

                                      TCP port 80 and 443 not in use by another web application or reverse proxy

                                      A hostname (such as chúng tôi for setup of a SSL certificate

                                      IPV4 and IPV6 address

                                      Dedicated (bare metal) hardware

                                      They recommend not running it as a VM for production use because of the audio packet processing program they use and time-syncing problems with recordings. Essentially, I’d recommend picking up an off-lease enterprise 1U server or something along those lines. That way you can have more requirements than necessary, including multiple bonded NICs, 8-16 CPU physical CPU cores, and lots of RAM.

                                      However, I’m just going to be running it in a VM for the purpose of showing you how it’s done. Those requirements are as follows:

                                      4 CPU cores/8 GB of memory

                                      Installation on a local VM or LXC container

                                      50G of disk space

                                      IPV4 address only

                                      BigBlueButton Installation

                                      There are a couple of ways to install it: the easy way where you don’t learn as much of the inner workings or the hard way where you’ll be intimately familiar with how it works on the inside. The choice is yours, but I’m going with the easy way, as it’s a simpler installation and administration. If you’d like to go with the more difficult route, you can follow a step-by-step on the documentation page.

                                      The easier way to install consists of using either a script from the website or an Ansible role to automate the installation process. I’d recommend the script for those just wanting to test things out.

                                      To go with the script, you’ll need to clone it from GitHub with the following command:














                                      Note that in the script above, HOSTNAME is the hostname of your server and EMAIL is an email address for setting up an SSL, and it’s a necessary step. Using the script should take about 30 minutes or so, meaning you have plenty of time to refill your coffee and take a break.

                                      When you come back, everything should be all set. At that point, you can enter the domain name (or IP address with a virtual test server) and start the demonstration. You can continue to run the script you used to upgrade the packages on the server as well.

                                      How to Use BigBlueButton

                                      If you use the script, you will have the BigBlueButton demonstration package installed, meaning you can learn how everything works without committing too much. Note that this requires a valid SSL certificate, which will require a registered domain name. I don’t have that, so I’m going to use the BigBlueButton demo server.

                                      You’ll be invited to join audio from your microphone or listen only. From there, you’re in the meeting.

                                      In the chat, you’ll see the link to the tutorial videos on YouTube. They’ll be more useful later to learn about the platform.

                                      Every slide is a whiteboard, but there are specific whiteboard slides in this demo server. You can draw whatever you need to. In this example, I drew a couple of network diagram symbols, but you get the idea. There’s also multi-user whiteboarding, which is great for students to show what they’re working on.

                                      The Shared Notes section is also great because it allows you to type out some notes that you have or highlight questions from the chat and work out those answers. You could also copy/paste some of your lecture notes in there and let people work off of them.

                                      BigBlueButton in a Nutshell

                                      For teachers working remotely, there is nothing more exciting than a great new tool. BigBlueButton has many exciting features that make it great for an e-learning platform. If you’re interested in some other video conferencing content, check out our Zoom keyboard shortcuts cheatsheet, our top tips for video conferencing while working from home, and our guide on turning your Raspberry Pi into a video conferencing station.

                                      John Perkins

                                      John is a young technical professional with a passion for educating users on the best ways to use their technology. He holds technical certifications covering topics ranging from computer hardware to cybersecurity to Linux system administration.

                                      Subscribe to our newsletter!

                                      Our latest tutorials delivered straight to your inbox

                                      Sign up for all newsletters.

                                      By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.

                                      How To Access An Android Phone Using Kali Linux

                                      Note: this tutorial is for security researchers and hobbyists. We do not recommend hacking anyone’s phone without their permission.


                                      Before you begin work on Kali Linux, you first need to familiarize yourself with its console terminal.

                                      It readily hosts a comprehensive list of tools which are designed to target a device’s firmware or operating system.

                                      Launching an Android Metasploit

                                      The following steps will demonstrate how to download MSFVenom on a Kali Linux system.

                                      Start the terminal and enter the following command.

                                      To determine the IP address of the listener host, open a new console terminal and enter ifconfig. Usually, port 4444 is assigned for trojans, exploits, and viruses.

                                      Once the IP address has been determined, go back to the previous screen and enter the details.

                                      The file “hackand.apk” will be saved in the desktop and is the main backdoor exploit to be used on the Android phone.

                                      In the next step, launch “msfconsole” which is a common penetration testing tool used with Kali Linux. For this, enter service postgresql start followed by msfconsole. PostgreSQL refers to a database where the console has been stored.

                                      Once the penetration tool is ready, you can launch the remaining exploit.

                                      Next, an executable called “multi-handler” will be used.

                                      use multi



                                      Refer to the image below for connecting the exploit with the console. The same IP address and port numbers will be used.

                                      In the next stage, the msfvenom exploit will be launched and initialized with a simple exploit command. Now, we have to find a target which will be an Android phone.

                                      Connecting Kali Linux Terminal with Android Phone

                                      The chúng tôi file which we downloaded earlier is only 10 KB in size. You will have to find a way to insert the file in the target’s phone. You can transfer the virus using USB or a temporary email service.

                                      Generally, webmail providers such as Gmail or Yahoo will refuse to carry this virus infected file.

                                      Android will warn you before you insert the software. But, it just takes less than 20 seconds to complete the installation as you only have to “ignore the risk and install.” This makes the threat somewhat serious if your phone is in unlock mode.

                                      As shown here, a lot of damage can be done to the phone including modifying the storage contents, preventing phone from sleep, connecting and disconnecting from Wi-Fi, setting wallpaper, and more.

                                      Once the APK file is installed, it can be cleverly disguised within the phone.

                                      Now, you can use many commands like the following on Kali Linux terminal to control the phone. You don’t have to remember them really as the list is available from a simple help option in meterpreter.

                                      record_mic: recording the microphone

                                      dump calllog: get the call log

                                      webcam_chat: start a video chat

                                      geolocate: get the phone’s current location


                                      In this tutorial, we saw a basic strategy of using Kali Linux to gain access to an Android smartphone. Even though this is a very simple exploit, it has great implications in terms of IoT security.

                                      Sayak Boral

                                      Sayak Boral is a technology writer with over eleven years of experience working in different industries including semiconductors, IoT, enterprise IT, telecommunications OSS/BSS, and network security. He has been writing for MakeTechEasier on a wide range of technical topics including Windows, Android, Internet, Hardware Guides, Browsers, Software Tools, and Product Reviews.

                                      Subscribe to our newsletter!

                                      Our latest tutorials delivered straight to your inbox

                                      Sign up for all newsletters.

                                      By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.

                                      How To Use The Zip Command In Linux To Compress Files And Folders

                                      The zip command in Linux is probably the simplest and most intuitive way to work with ZIP files on the command line. And not just that, the ZIP file format is universal – almost every OS out there has a native program that can work with it. Here’s all the ways you can use this command in any Linux command line.

                                      How to Install Zip in Linux

                                      The latest version of the Linux zip command should be available in all major package managers.

                                      For Debian/Ubuntu:





                                      For Arch Linux:





                                      For Fedora:





                                      For Gentoo





                                      Note: Before installing anything, make sure to update your package manager first to get the zip command’s latest version. You can learn how to do that and more with our Linux package manager cheatsheet.

                                      Note: With zip installed, the unzip command will also be available now.

                                      Zip Command in Linux: Syntax and Options

                                      There’s a basic syntax to the zip command, and it takes just two parameters: the output ZIP file’s filename and the input’s filename.

                                      As for setting the options, you’ll need to work with flags. There are 8 flags you would regularly need for normal use:

                                      -d delete selected archived entries in the ZIP file.

                                      -q quietly do task without printing anything on the terminal.

                                      -T test the ZIP file’s integrity.

                                      -e encrypt file.

                                      -u update ZIP file by adding new files into the archive.

                                      -m move file into archive.

                                      -r recursively add files within a folder into a ZIP file.

                                      -x exclude files with the selected filenames.

                                      -i include only files with the selected names.

                                      You can place the flags anywhere you like whether they’re before the output, after the input, between the two – you can even use multiple flags scattered all around the line in any order. Just make sure that you type them after typing zip.

                                      The exception are -x and -i which need a new input after using them.

                                      How to Zip a File in Linux Using the Zip Command

                                      The easiest way to archive files with the zip command is to type zip followed by the filename of the ZIP file and then the file you are trying to archive or compress. Flags are optional, so you can do it like that to quickly zip any file on Linux.


                                      chúng tôi text_file.txt

                                      You can also add more files by adding the others after the first file you were trying to archive. And if any of these have spaces in their names, you can enclose them in quotation marks.


                                      chúng tôi

                                      "file 1.txt"

                                      "file 2.txt"

                                      "file 3.txt"

                                      "file 4.txt"

                                      Using the -d Flag

                                      The -d flag lets you delete a file archived within the ZIP file in the same way you would have added it into one.



                                      chúng tôi remove_me.jpg

                                      You can also use it to remove entire folders within the archive. However, this won’t work for files outside of the ZIP file (so you can’t use it to delete files after archiving).

                                      Using the -q Flag

                                      The -q flag is for making sure that zip won’t return a message when it does its thing.



                                      chúng tôi text_file.txt

                                      It’s useful when you’re using the zip command with a script. But if you’re using this by yourself, you might want to avoid using the -q flag since you won’t know if the the archiving process was successful without checking with the dir or ls command.

                                      Using the -T Flag

                                      Some files Some ZIP files can get corrupted during download – it happens. You can use the -T flag to check the integrity so you would know if it really is a broken file or you’re just inputting the wrong password.



                                      chúng tôi is pretty important when downloading large files like OS images. For files like these, you can successfully burn them into a live USB and end up with errors once you run the image file on your machine. The same goes with videos and music that get cut-up parts in random places.

                                      Using the -u Flag

                                      If you wanted to add a new file into an existing ZIP file, you can use the -u flag.



                                      chúng tôi new_file.txt

                                      You can also add more files by adding them after the first file, as if you were using the zip command normally to make a new ZIP archive.

                                      Using the -e Flag

                                      If you want to add a password, you need to use the -e flag. This option only applies the password and encryption into the file you add into the ZIP file within its command, so previous files will remain unencrypted if you use this with the -u flag.



                                      chúng tôi text_file.txt

                                      The great thing about ZIP files is that the password-making process also adds an extra layer of protection besides giving access. Your password works like a digital signature which is used to decrypt an extra encryption layer added into the ZIP file.

                                      Using the -m Flag

                                      Lastly, the -m flag deletes the original file after it gets archived into the ZIP file. Think of this as automating an extra step so you won’t have to remove it by yourself.



                                      chúng tôi text_file.txt

                                      One important bit to remember though: the -m flag deletes files in such a way that makes it impossible to recover them without using a file restoration tool. So be sure to keep a backup, or just remove things manually using the rm command instead.

                                      How to Zip a Folder in Linux Using the Zip Command

                                      If you use the zip command on a raw folder, you’ll be left with a folder that does not contain any files at all. Whenever you are trying to zip a folder, you need to use the -r flag.

                                      Using the -r Flag

                                      The -r flag, aka recursive, goes through each content of a folder and its subfolders and archives every single one into the ZIP file. It will also retain the current structure of each subfolder.



                                      chúng tôi my_folder

                                      This also works if you want to archive everything within the current folder. Just replace my_folder with ./ and it will change its target to everything within the current one.



                                      chúng tôi .


                                      Furthermore, you can use this alongside the -u flag to include folders and their contents into an existing ZIP file.




                                      chúng tôi another_folder Using the -i Flag

                                      The -i flag lets you pick out a specific file that you want to include and excludes everything else within a folder



                                      chúng tôi my_folder







                                      By using * asterisks with the -i flag, you can select files that share similar names but could end with something like a number. For example, typing *.txt will make the zip command include all TXT files within the folder.



                                      chúng tôi my_folder



                                      Using the -x Flag

                                      The -x flag lets you exclude only certain files while zipping a whole folder.



                                      chúng tôi my_folder





                                      Also, the -x flag overrides the -i flag when used together. This way, you can, for example, tell zip to include all the other files of the same type except for the file you don’t want it to zip.



                                      chúng tôi my_folder






                                      dont_zip.txt How to Unzip a File Using the Linux Zip Command

                                      The unzip program is a partner program to the default zip program. It extracts files from your ZIP archive.

                                      To use this program, you just need to type unzip and the filename of the ZIP archive.


                                      chúng tôi using the unzip command, you will unzip the ZIP file within the current working directory regardless of where the ZIP file came from.

                                      To extract or unzip a Linux file within a ZIP file so the others remain unextracted, you can add its filename after the part where you type the archive.


                                      chúng tôi chúng tôi to Unzip a Linux Folder With Zip

                                      While unzip will normally extract folders located within a ZIP archive, it can be pretty hard to make it extract only certain folders. But that does not mean it’s impossible.


                                      chúng tôi my_folder




                                      That line of code extracts everything within a_subfolder.

                                      Also, when you unzip a folder, the unzip program creates a new folder within the current working directory and unpacks its folders there. If a folder exists with the same name (or a previous version of the folder is present), it ask if it’s okay to replace the file that’s currently in the folder.

                                      Frequently Asked Questions What does the gzip command in Linux do?

                                      The Linux gzip command is a tool that you can use to store and compress files into a GZ file.

                                      Is ZIP better than TAR?

                                      In a way, ZIP is better than TAR because ZIP files can compress, encrypt, and protect their contents. However, TAR files are meant to combine files into one file for faster file transfer while ZIP files (despite being used for the same purpose) come with those extra features in mind.

                                      Is TAR faster than ZIP?

                                      TAR files do not compress nor encrypt their contents. So if you are looking for a faster way to combine a large amount of files into a single easy-to-transfer archive, you’ll see some gains with TAR compared to ZIP. However, you might find it easier to transfer a ZIP file instead of a TAR file because ZIP files tend to be much smaller than TAR files.

                                      Image credit: Unsplash, Screenshots by Terenz Jomar Dela Cruz

                                      Terenz Jomar Dela Cruz

                                      Terenz is a hobbyist roboticist trying to build the most awesome robot the world has ever seen. He could have done that already if he wasn't so busy burning through LEDs as a second hobby.

                                      Subscribe to our newsletter!

                                      Our latest tutorials delivered straight to your inbox

                                      Sign up for all newsletters.

                                      By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.

                                      Update the detailed information about How To Access And Use Onedrive On Linux on the website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!