0

In terminal, I need to do cd desktop then cd data then ls data. Data is a folder that connects windows partition of the computer to ubuntu.

cd Desktop was initially giving me an error (bash: cd: no such file or directory). I instead typed cd ~/Desktop, which worked. However, I cannot use cd data and I get the same error as before. I even tried cd ~/data. It does not work. Any help would be immensely appreciated.

Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497
  • 4
    Linux filesystems are (generally) case sensitive - so Desktop is not the same thing as desktop. Is the folder called data or Data? – steeldriver Jul 06 '18 at 15:06
  • I was able to do ls for the desktop. The data folder comes up red with black background which means the link is broken. Our computer savvy professor is away and he set up the link. If anyone knows how to reset up the linked folder (connects Windows partition to Ubuntu partition) please let me know. – Christa Frodella Jul 06 '18 at 15:44
  • 1
    Depends on where the NTFS (Windows) folder is; on the same PC or a network share? Sounds like a possible duplicate of https://askubuntu.com/questions/72471/correct-way-of-mounting-a-windows-share or https://askubuntu.com/questions/271516/is-there-a-program-to-mount-all-of-my-drives-automatically/300426#300426 – K7AAY Jul 06 '18 at 16:08
  • 2
  • 3
    The tilde (~) is short for your home folder ($HOME), so ~/data is not what you want. You could use ~/Desktop/data instead. – wjandrea Jul 06 '18 at 17:15
  • Regarding the linked folder, please post the output of readlink ~/Desktop/data (get the symlink's destination) and the contents of /etc/fstab (the filesystem table). – wjandrea Jul 06 '18 at 17:20
  • readlink ~/Desktop/data yields /media/cyprianna/1A48F1D148F/data and /etc/fstab yields bash: /etc/fstab: Permission denied. – Christa Frodella Jul 06 '18 at 17:24
  • if the first word of the command you enter is a filename (to be accurate, if it contains a /), the shell tries to execute the file as a program. /etc/fstab is just a text file; it doesn't have execute permission and that's why you got that error. To read it you need to call a program to display the contents, such as cat (ie cat /etc/fstab) or less or open the file in a text editor (double click in file browser should do that by default) Please [edit] your question to add the contents of the file (and any other updates), formatting it as code with the {} button to make it readable. – Zanna Jul 06 '18 at 20:23
  • @wjandrea Christa Frodella has replied to your comment giving the location pointed to by the symlink. The output of lsblk may also be useful in determining which device to mount if it is connected, I guess? – Zanna Jul 06 '18 at 20:27

2 Answers2

2

That's the difference between command line and GUI. The icon you see isn't actually there. Under Ubuntu, typically USB disks and partitions are automatically mounted at /media/username folder.

The GUI icon you see on the desktop is just a "shortcut" in a sense, but the actual folder to which the partition is mounted is elsewhere. When you open it in GUI file manager, and press Ctrl+L you should see the real path to the mountpoint.

As for the part where you need to ls Data please note two things:

  1. File and directory names are case sensitive.
  2. If you cd Data you're telling the shell to enter the Data directory that should be located relative to where your shell is right now, i.e. the current working directory. Doing cd ~/Desktop works because you told it the full path, not relative. When you cd ~/Desktop; ls Desktop it won't work - there's no Desktop within ~/Desktop. If you just run ls with no arguments, then it will work, because it lists items in the current directory by default
dessert
  • 39,982
Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497
  • I inputted ls because I need to verify that the data from Windows has been successfully shared with Ubuntu. Ultimately, I need data from folder so I can unzip and concatenate it. – Christa Frodella Jul 06 '18 at 17:27
  • @ChristaFrodella Ok. Just remember that command line and GUI work through different rules. So if you understand difference between relative and full path in command line, your experience will be so much easier – Sergiy Kolodyazhnyy Jul 06 '18 at 18:03
-1

If I understand you right, you are looking to access data folder on your desktop.

Try cd ~/desktop/data then ls to get the contents of this directory.

If you want to create a shortcut use ln -s <actual path>. It says create a shortcut (in linux terms softlink to the actual path) in the current location.