how to connect an android phone with linux to transfer files

the post i am going to present is for connecting your android phone with slackware or any linux distribution and secondly, transfer files to it….

here is the link that send me in the correct path!!! cheers to him!!!

first of all make sure you have the mtpfs library in your system…(slackers can fetch it from

we need to make a mount point for our phone….

i made it in /mnt as in /mnt/phone

once we got mtpfs installed run the below commands as i have typed them…

mtpfs /mnt/phone

mtpfs -o allow_other /mnt/phone

now the final step is to transfer files to phone…but wait….a normal mtpfs-sendfile wont work here…weird…..whats weirder is that android phone has all its folders mapped to a number….you need to use this number to transfer files to it…..

not to worry….mtpfs has the solution for it….

so to get the list of numbers for our folders in the android phone just type


now you get a mapping of key value pairs where each file in your android is mapped to which number…..i wanted to copy an mp3 file and it was 172

so am all set to transfer and i enter the below command:

mtp-connect –sendfile /path/to/file/nightcrawler.mp3 172

voila! and guess what the file was successfully transferred…..


Well that’s one way of doing it without a network around to help you.

Note: am editing this post and updating the content

If you got a wifi network where you use your laptop or desktop you do not have to go through all these hassles like above.

Just download any of the following apps from google play store:




I prefer Xender to Airdroid. its a much better interface.

So now once you got your phone and laptop/desktop connected to the same wifi network all you got to do is open any of the app in your phone.

It gives you an IP as well as a url.

Type it in your favourite browser on your laptop/desktop.

It will ask you “whether you want to accept or reject the connection in your phone”

Click on accept and you are good to go….


NOTE: Its a direct connection and hence it would not consume your ISP(Internet Service Provider) bandwidth or ISP data which is in layman terms as unlimited download and uploads from phone to laptop and vice-versa…

so as always happy slacking folks….


2 thoughts on “how to connect an android phone with linux to transfer files

    • well, i havent gone full depth into mtp except getting the solution using mtpfs….adb is sure a good solution…used it for rooting i remember….thanks for the same….come back soon if i get something over mtp….


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s