November 21, 2024, 05:38:25 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: Access files on other parititions and networked drives on command line  (Read 8378 times)

Offline healer

  • Linux Noob !
  • *
  • Posts: 10
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.

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
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)


Offline healer

  • Linux Noob !
  • *
  • Posts: 10
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?

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
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.

Offline healer

  • Linux Noob !
  • *
  • Posts: 10
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.