GithubHelp home page GithubHelp logo

lawrencewangzi / eject_usb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gorantopic/eject_usb

0.0 0.0 0.0 414 KB

A brave attempt to make a terminal way to eject USB drive :floppy_disk: without having to know the device name such as /dev/sda

License: GNU General Public License v3.0

Shell 8.37% C++ 91.63%

eject_usb's Introduction

eject_usb

Kiaora,

This is a brave attempt to create a terminal command for ejecting usb drives without having to know the device name such as /dev/sda it read from intenal files such as ftabs to get a list of mounted file in the system.

Ususally the unix umount command need to take an device path such as /dev/sda or a mount point such as /media/USERNAME/useb-label. This can be rather tedious when you just want to eject a fash drive quicky.

Thus eject_usb is a command that does not take any input to unmount the flashdrive you just inserted.

Then if an agrument is passed, is searches the label or mountpoint and unmounts it.

If there is only one device mounted it unmouts it without need of an argument, or the need to prop the user.

If there are multiple mdevices mounted, eject_usb will ask you which one to eject.

Versions

I wrote two versions of the program, on ins C plus plus and an other in Shell.

Use

CPP

The cpp version can be run with the executable "USBunmount" such as: ./USBunmount

Bash

the Bash version can be run wit ./eject_usb.sh

Compile

To compile the program, you can run: g++ main.cpp -o USBunmount with the gcc.

Install

To install in a linux eviroment simply move the executable to your bin dir. Such as:

cp USBunmount ~/bin/

or

cp eject_usb.sh ~/bin/

TODO

  • make Bash version

  • make compatible on other linux distros

  • Needs an intaller bash script to intall the autocomplete file for eject_usb

  • Change the name to eject_usb.

  • Test to see if it works in all devices .

  • Find the way that in which file manajers, such as Nautilus and Caje eject usb drive and impemet it.

eject_usb's People

Contributors

gorantopic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.