Sign in with
Sign up | Sign in
Your question

Help on linux file transfer

Last response: in Linux/Free BSD
Share
March 6, 2011 1:39:24 PM

Hello, how can i detect a usb in linux command line? please list all the possible scrips to detect it or command to see. and how to mount it? I need it for the project that compresses a file and at the same time saving it on a usb. i can't use sudo because it is restricted by our root account, so she advices me to use ftp to transfer the file compressed.

More about : linux file transfer

a b 5 Linux
March 6, 2011 5:22:57 PM

866952,1,842764 said:
Hello, how can i detect a usb in linux command line? please list all the possible scrips to detect it or command to see. and how to mount it? I need it for the project that compresses a file and at the same time saving it on a usb. i can't use sudo because it is restricted by our root account, so she advices me to use ftp to transfer the file compressed.[/quotemsg

ls -l /dev/disk/by-id/*usb*

EDIT: sorry, didn't look thoroughly a your post. Command sees how usb is recognized. Without root, I think i would just disconnect all USB devices, plug in the one to save to and hope it is /dev/sdb. You may want to look in /media/ to see if the device has been labeled.
March 7, 2011 2:16:49 PM

Thank you for the answer! I have done that already looking in dev directory. Even checked it with the command df. I typed df and it shows the connected devices and then I plug in the USB and typed df again. but nothing changes. BTW, access the linux command line with the use of telnet or PuTTy with a server. I really can figure it how to detect the device. And I can't test it here in my home because I can't access the server that we are using.

Sorry for my english, please bear with it. Thank you again!
Related resources
March 7, 2011 3:26:31 PM

df shows you useage of mounted filesystems. After you plug in your device type the command dmesg as root and the last few lines will tell you how the device has been detected and named /dev/sd?

Then you need to mount the drive to a point in your filesystem - ie:

mount /dev/sd? /mnt/usb

you'll need to see the output of dmesg (its huge, but if you issue the command 15-30 seconds after plugging in the last handful of lines are all we're interested in) You will also have to create the directory /mnt/usb (or whatever other directory you want to mount the drive to).
March 7, 2011 4:38:10 PM

someone19 said:
df shows you useage of mounted filesystems. After you plug in your device type the command dmesg as root and the last few lines will tell you how the device has been detected and named /dev/sd?

Then you need to mount the drive to a point in your filesystem - ie:

mount /dev/sd? /mnt/usb

you'll need to see the output of dmesg (its huge, but if you issue the command 15-30 seconds after plugging in the last handful of lines are all we're interested in) You will also have to create the directory /mnt/usb (or whatever other directory you want to mount the drive to).


Thank you!

But in our class we are restricted to log in as root or even use sudo. :( 
and I can't mount the usb because of two reasons; I don't have the permission to mount and I can't detect the USB. sorry, im still a noob at this things.

Thank you for the advice!
March 7, 2011 4:57:41 PM

If your a member of the plugdev group than you will be able to run the mount command, if not then I think we're stuck.

Fortunately, linux is a very secure system, unfortunately its a very secure system.

To be able to access the USB, it needs to be mounted.
March 8, 2011 11:24:40 AM

someone19 said:
If your a member of the plugdev group than you will be able to run the mount command, if not then I think we're stuck.

Fortunately, linux is a very secure system, unfortunately its a very secure system.

To be able to access the USB, it needs to be mounted.


Thank you for the reply!

How can i know if I am a member of the plugdev group? any commands to check it? sorry, im a noob. :??: 

Supposed I'm a member of the plugdev group. how can I run the mound command without being an superuser or root. Thank you ! :wahoo: 
March 8, 2011 1:11:33 PM

The command line command 'groups' lists the groups your account is a member of. To mount a USB drive I think you need to be a member of usb, plugdev, and disk.

Then you just need to issue the proper mount command as I listed above.
March 8, 2011 3:38:24 PM

someone19 said:
The command line command 'groups' lists the groups your account is a member of. To mount a USB drive I think you need to be a member of usb, plugdev, and disk.

Then you just need to issue the proper mount command as I listed above.


so, if I'm a member of usb, plugdev and disk. I can issue the command to mount the USB even if I'm not a superuser or root?

Thank you for the reply! :) 
a b 5 Linux
March 8, 2011 3:57:42 PM

yes but you will need write permissions to where you are mounting to. (ie home folder)
March 9, 2011 10:17:52 AM

panicmoment said:
so, if I'm a member of usb, plugdev and disk. I can issue the command to mount the USB even if I'm not a superuser or root?

Thank you for the reply! :) 

That's the idea.
March 10, 2011 1:33:46 PM

The command is "lsusb". Shows all usb connected devices. And there is "lspci" for internal devices. Most of the user-friendly distros auto-mount usb's. What distro are you using?

1-)Plug your usb device.
2-)Run "lsusb". Look for your device.
2-)Run "dmesg | tail"
3-)It shows last kernel messages. You can see what happened to the device here.

And also run "fdisk -l" to list your hard drives. You can see usb flash drive or hdd there. (like /dev/sdb1, /dev/sdc1)
March 10, 2011 5:20:55 PM

OP doesn't have root to be able to run those commands.
March 10, 2011 9:38:29 PM

Sorry didn't see that.
March 11, 2011 1:10:18 PM

Thank you for all the replies! But our deadline on the project have already passed. I passed my project saving on a directory and not on a USB drive. Thank you again!
!