Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi, is there any way to manipulate files and anything on a USB stick or drive from command line, rather than from the usual desktop file managers like Nautilus, Dolphin , Krusader etc .
You can mount the usb drive with the standard mount utility, once that's done you can manipulate the files like any other file. Do you need to know how to mount the device?
The USB is automatically mounted, if it wasn't , it would not show up in the File Manger,
Mounting was preformed in the era of floppy etc, now Linux has caught up and mounts it fast!
In the DOS there was a command that was C:, or D: would mount the disk etc, Linux hasn't got that, like /dev/sda: or sda:
Which cause the head ache.
Linux is a little more powerful and flexible than DOS; that inevitably means it is more complex too.
Here's mounting a file system on USB at the command line, as root
Code:
root@CW8:~# blkid
[snip]
/dev/sdc1: LABEL="USBSLACKINS" UUID="8666-680D" TYPE="vfat"
root@CW8:~# mount /dev/sdc1 /mnt
root@CW8:~# mount
[snip]
/dev/sdc1 on /mnt type vfat (rw)
To be able to do that, I had to be familiar with the block devices on the system and recognise that /dev/sdc1 was the USB stick.
Last edited by catkin; 10-29-2011 at 01:58 AM.
Reason: typos
Now it will be mounted under a specific directory, say for example /media/stuff
Now, as root, set the permissions of that directory by issuing the following commands.
cd /media
chmod -R 777 stuff/
You can also do
cd /media/stuff/
chmod -R 777 .
Same thing really..
this will give read write access for all users to the whole partition. This command operates on the root filesystem of the partition mounted there. You can also use chown to change the owner if you want. 'Nobody' is a good option if you dont want access control.
Your second option is to (as root) make a directory on your new filesystem and give the directory write permissions to all. This option confines 'free for all' permissions to just one directory. Either way, it works the same.
still I cannot access from the command line and manipulate the files etc .
Hi Nylex:
Some of the file need to be accessed only "root", and I use Debian, in Debian you cannot log in as root , from the start, or use the Desktop as root, you can get access to everything as root only from console/terminal etc.
Catkin, Thanks for you post, I don't have any command to access the usb stick and disk, from command line, if I did, I would not come and post here!
Nylex, thanks again, for the reply, I just do the usual thing with a file , copy, paste, alter few lines here and there, I usually do on fedora as root, on friend's computer!
But doing it on Debian is not possible, I believe KDE's Krusader has root access capability, but I use Gnome, and KDE does not do well on Debian, so I don't install KDE specific software.
Thanking you all for your replies, much appreciated!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.