File seen by "ls", but not found by "more"

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
chau
Level 1
Level 1
Posts: 3
Joined: Tue Jun 15, 2021 4:16 pm

File seen by "ls", but not found by "more"

Post by chau »

Hi all,

I recently install Mint and overall quite like it (I migrate from Ubuntu). There is a very strange issue that is annoying, though. As indicated in the title, I can find certain files by "ls" but not with more (or vim even create the same a new file with the same name). Have a look at the outcome below:

Code: Select all

chau@X1-Carbon:~$ ls /home/chau/.slinks/gap 
/home/chau/.slinks/gap
chau@X1-Carbon:~$ more /home/chau/.slinks/gap 
more: stat für /home/chau/.slinks/gap ist fehlgeschlagen: Datei oder Verzeichnis nicht gefunden
chau@X1-Carbon:~$ vim /home/chau/.slinks/gap 

(the last command creates a new file)
I also experience a similar problem with Goldendict: I cannot find the folder in Goldendict search window, but also see it with the system Folder Viewer.

This is for me completely strange. The only reason I can think of is that I install Mint as dual boot to Windows and Ubuntu. Maybe the format of the later can influence that indexing files.

Any suggestion for fixing is highly appreciated. Thanks!


Cheers,
Chau
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
karlchen
Level 23
Level 23
Posts: 18238
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: File seen by "ls", but not found by "more"

Post by karlchen »

Hello, chau.

Like a lot of users you use the ls command without any options. Pure ls will only list the names of files and folders.
Try the command with the "minus lowercase L" option like follows, please:

Code: Select all

ls -l /home/chau/.slinks/gap 
In this form ls -l will display the name plus more details.
Specifically
+ the object owner,
+ the object owner's group,
+ the access permissions for owner - owner's group - others
should explain, why you are not permitted to view the file with more or to edit it with vim.
more requires read permissions for your account on the object named gap.
vim requires read+write permissions for your account on the object named gap.

HTH,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 792 days now.
Lifeline
chau
Level 1
Level 1
Posts: 3
Joined: Tue Jun 15, 2021 4:16 pm

Re: File seen by "ls", but not found by "more"

Post by chau »

Thank you! Here is the output:

Code: Select all

chau@X1-Carbon:~$ ls -l /home/chau/.slinks/gap 
lrwxrwxrwx 1 chau chau 30 Jun 15 22:10 /home/chau/.slinks/gap -> Programs/gap-4.11.1/bin/gap.sh
I think this may be not the reason. Notice that

Code: Select all

vim
creates a completely new file, instead of prompting that I do not have the right to read or edit. (OK, it is a symbolic link, so trying to edit it is a bit strange but I was really trying to test. Also call

Code: Select all

 gap 
in the promt, or using tab when constructing directory, both do not work.)

PS: slinks is in the PATH already
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: File seen by "ls", but not found by "more"

Post by rene »

That seems to behave as expected. You have in directory /home/chau/.slinks a symbolic link gap to Programs/gap-4.11.1/bin/gap.sh. Put differently, you have a symbolic link /home/chau/.slinks/gap to /home/chau/.slinks/Programs/gap-4.11.1/bin/gap.sh. I however expect that "Programs" does not in fact live under /home/chau/.slinks but for example directly under /home/chau?

If so you are going to want e.g.

Code: Select all

ln -sf ../Programs/gap-4.11.1/bin/gap.sh ~/.slinks/gap
or if you prefer

Code: Select all

ln -sf ~/Programs/gap-4.11.1/bin/gap.sh ~/.slinks/gap
chau
Level 1
Level 1
Posts: 3
Joined: Tue Jun 15, 2021 4:16 pm

Re: File seen by "ls", but not found by "more"

Post by chau »

rene wrote: Tue Jun 15, 2021 7:07 pm That seems to behave as expected. You have in directory /home/chau/.slinks a symbolic link gap to Programs/gap-4.11.1/bin/gap.sh. Put differently, you have a symbolic link /home/chau/.slinks/gap to /home/chau/.slinks/Programs/gap-4.11.1/bin/gap.sh. I however expect that "Programs" does not in fact live under /home/chau/.slinks but for example directly under /home/chau?

If so you are going to want e.g.

Code: Select all

ln -sf ../Programs/gap-4.11.1/bin/gap.sh ~/.slinks/gap
or if you prefer

Code: Select all

ln -sf ~/Programs/gap-4.11.1/bin/gap.sh ~/.slinks/gap
Oh yes, that was idiot from me! Thanks, that resolves it. I still have problem with Goldendict search folder, but that is probably a problem with Goldendict, I probably should try to ask them first.

Thank you!
Locked

Return to “Other topics”