5

I have searched a lot about that & the only way I found is to create a file named .hidden & put the file names I want to hide in separated by a break. This method seems to be not working for some reason even for 1 file.

Here I add the Exams.txt file as the one I want to hide

enter image description here

then press Ctrl+H and f5 & that's what I get, only .hidden file disappears.

enter image description here

So, any ideas? am I doing something wrong? Does this method requires something to be installed first that is not installed by default ? Or this is deprecated method that no longer works?

n0krashy
  • 109
  • 4
    After doing this, did you remember press CTRL-H to actually hide all "hidden" files? – Enterprise May 14 '18 at 23:01
  • 1
    The feature works fine for me. Did you refresh the folder after creating or modifying the .hidden file? Nautilus doesn't automatically pick up changes to the file. – muru May 15 '18 at 04:42
  • Works for me too. What @PJSingh says is probably true. – Rinzwind May 15 '18 at 06:30
  • @PJSingh Of course I did, I would post pictures of how I do it and that only the .hidden file disappears after I uncheck "Show Hidden Files" (but not the other files that have their names in it) but I don't have the needed 10 reputation to do so :( for those who this way works with, are you on Ubuntu 18 ? Can anyone post pictures of exact steps with details ? thanks – n0krashy May 15 '18 at 08:51
  • 2
    @n0krashy I tested on Ubuntu 18.04. I simply created a .hidden file in the directory containing the files I wanted to hide, and put filenames, one per line, in the .hidden file. – muru May 15 '18 at 14:09
  • 1
    As a one final attempt, could you try changing the name (select, press f2, completely delete all the characters, and type) of the file Exams.txtto something else and making change to the .hidden file accordingly? – pomsky May 16 '18 at 06:58
  • I'd like to see the output of ls --quoting-style=shell-escape ~/Downloads – muru May 16 '18 at 07:30
  • 2
    And press return at least once after the file name in .hidden text, otherwise this one is really not reproducible, we have discussed that in chat and at least on my 18.04 it works like a charm. – Videonauth May 16 '18 at 08:57
  • @Videonauth gedit adds the final newline automatically I think (at least, when I tried to reproduce with gedit, I didn't need an Enter). – muru May 16 '18 at 09:20
  • @muru I even tested it here with echo piped into a file, using nano etc, there was never a final newline needed, and gedit does not produce a newline when you didn't enter one. – Videonauth May 16 '18 at 09:33
  • @muru the output of this command is nothing at all – n0krashy May 18 '18 at 12:20
  • Does the method requires something to be installed first that is not installed by default ? – n0krashy May 18 '18 at 12:37
  • @pomsky I did but I got nothing also – n0krashy May 18 '18 at 12:40
  • OK I have solved it guys thanks everybody. It seems like it doesn't work if I copied a file "instead of creating a new one" & renamed it to .hidden and put the file names in it. Seems like I must create a new file using the terminal touch .hidden command. – n0krashy May 18 '18 at 12:44

2 Answers2

2

OK I have solved it guys thanks everybody.

It seems like my problem was HOW I create the .hidden file.

it doesn't work if I copied any file (instead of creating a new one) & renamed it to .hidden and delete it's content & put the files names I want to hide in it.

I used to copy a .txt file & do that & that was my problem apparently.

Seems like I MUST create a new file using the terminal

touch .hidden

command to work.

Sorry for the disturbance.

n0krashy
  • 109
0

When you name your files simply put a . in front of the name to make it hidden. For example:

ThisFileIsNotHidden
.ThisFileIsHidden

In Ubuntu 18.04 controlling display of hidden files is no longer in the preferences menu as it was in Ubuntu 16.04. It's been moved to a drop down menu on the top right corner of the window:

Nautilus 18.04 hidden files.gif

This setting is "persistent" and will the same setting across reboots.


Besides the default Nautilus method you can use a Python extension called "Nautilus Hide". You can install it using:

sudo apt install nautilus-hide

As OP stated it's not working out of Ubuntu Repositories so you install it the old-fashioned way:

$ git clone https://github.com/brunonova/nautilus-hide.git
$ mkdir build
$ cd build
$ cmake {path to nautilus-hide}
$ make
$ sudo make install

Verify installation

Use this command to verify it's installed:

$ ll //usr/share/nautilus-python/extensions/
total 32
drwxr-xr-x 2 root root 4096 May 15 04:47 ./
drwxr-xr-x 3 root root 4096 Feb 20 18:36 ../
-rw-r--r-- 1 root root 5165 Dec 28  2015 nautilus-admin.py
-rw-r--r-- 1 root root 5479 Apr  6 17:21 nautilus-admin.pyc
-rw-r--r-- 1 root root 5007 Oct 24  2015 nautilus-hide.py
  • 3
    That actually changes the filename potentially breaking something. The same works by adding the filename to a file named .hidden as TS claims not working (it does work on my system :) ) – Rinzwind May 15 '18 at 06:29
  • @WinEunuuchs2Unix I know that way already but this force me to change the name of the files I want to hide, which I don't want to do. I already mentioned in the subject of the question that I want to avoid that. so this doesn't answer the question. but thanks anyway. – n0krashy May 15 '18 at 08:43
  • @Rinzwind are you on ubuntu 18 ? if you are, can you post a gif or pictures of how you did it ? with exact steps ? thanks in advance – n0krashy May 15 '18 at 08:46
  • 1
    @n0krashy yes (but not now) and works perfectly on 18.04. In chat also confirmed by 2 other users ;) – Rinzwind May 15 '18 at 14:00
  • @n0krashy I revised my answer so you can verify nautilus-hide is installed. Could you confirm it is? – WinEunuuchs2Unix May 15 '18 at 23:11
  • I don't understand, should I install it using sudo apt install nautilus-hide or with the commands starting with git clone ? – n0krashy May 18 '18 at 12:35
  • The git version is supposed to have new feature of automatically refreshing directory listing after hiding a file (you don't have to press F5). More is explained in this article: http://www.webupd8.org/2017/02/hide-files-and-folders-in-nemo-or.html – WinEunuuchs2Unix May 18 '18 at 12:46