Linux Forums - Linux Help,Advice & support community:LinuxSolved.com

Others => Miscellaneous => Topic started by: healer on July 26, 2009, 09:41:37 AM

Title: Access files on other parititions and networked drives on command line
Post by: healer on July 26, 2009, 09:41:37 AM
I would like to know how we can do a "ls" or "cp" on other partitions of the same computer or of the networked drives.  I am not too sure how to.
Title: Re: Access files on other parititions and networked drives on command line
Post by: Ricky on July 27, 2009, 07:27:08 PM
I don't get it ?

hmm..

Actually in linux all drives or partitions are under some mount point.
eg. Root partition is mounted under "\"
Var under \var
And home is at \home
So if you cant to copy a file from \var to \home then simply.
Code: [Select]
cp \var\filename.abc \home
Same goes for network drive, network drive are usually mounted under some mountpoint or you can use directly remote pointpoint (if you have proper access)

Title: Re: Access files on other parititions and networked drives on command line
Post by: healer on July 28, 2009, 03:28:34 AM
I can see all local drives and networked drives from Places so they should have been mounted.  For your information I have set up samba to read Windows files too, no problem at all from Places - > Network or Computer either.

I looked into /mnt but nothing was found.  Could you please tell me where the mount information should be located so that I can check?
Title: Re: Access files on other parititions and networked drives on command line
Post by: Ricky on July 28, 2009, 10:42:18 AM
It goes like this..
first you have to create a mountpoint ie. a directory then attach filesystem to that directory ie. mount it. Then you can access as if you are accessing local file.

If it is windows share then do this:(Say you want to mount it under /mnt/Shared
Code: [Select]
# mount -t cifs //windows-server/anydirectory -o username=<username here>,password=<Password here>  /mnt/Shared
Hope that helps.
Title: Re: Access files on other parititions and networked drives on command line
Post by: healer on July 29, 2009, 06:56:51 AM
I have tried your command "sudo mount -t cifs //windowsOSname/anydirectory -o username=username,password=Password /mnt/Shared" However it came back with the manual page of "mount".

Anyway I can access the files in the shared directory of my networked Windows systems without any problem through Nautilus by going to Places - > Network.  However the "/mnt" directory is still empty.  If it hasn't been mounted how can Nautilus display the files.  Anyway the above "mount" command failed.

What about the Windows partitions in the same computer?  Nautilus can display the files too.