ls showing dot files by default

Status
Not open for further replies.

l3eastie

Dabbler
Joined
Jun 13, 2013
Messages
10
I'm increasingly using my FreeNAS server (rather than a very similar Ubuntu machine) at home.

I've noticed that in csh sessions the ls command is listing dot files by default (this is not consistent with the -a switch as described in the man page).

I can't find any way to switch this off.

There are some comments around the web relating to the fact that this is correct behaviour and ls was never specified to hide dot files in the first place, but I'd nonetheless be grateful for any pointer in how to get rid of this small irritation and will then be happy to use -a where needed.

Many thanks.
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
I don't didn't know where aliases are specified, but I note ls behaves the same way in my copy of FreeNAS. The command "alias ls" (without quotes and followed by return) reveals that the current alias is "ls -GFa". So that explains our findings. I know nothing about FreeBSD, but it turns out there is a .cshrc in the root directory of the filesystem, "/.cshrc" which contains this alias, as well as one in "/root/.cshrc" which doesn't contain an alias for "ls".
 

l3eastie

Dabbler
Joined
Jun 13, 2013
Messages
10
I don't didn't know where aliases are specified, but I note ls behaves the same way in my copy of FreeNAS. The command "alias ls" (without quotes and followed by return) reveals that the current alias is "ls -GFa". So that explains our findings. I know nothing about FreeBSD, but it turns out there is a .cshrc in the root directory of the filesystem, "/.cshrc" which contains this alias, as well as one in "/root/.cshrc" which doesn't contain an alias for "ls".

Thanks for your reply.

Actually this is not quite the case on my system.

alias ls

identified the alias being used e.g. "ls -GFa" and then

find / -xdev -type f -print0 | xargs -0 grep -H "ls -GF"

located the only causative alias in

/conf/base/etc/csh.cshrc

System required a reboot (or perhaps just restarting the csh service) before edits can take effect.
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
Which leaves me wondering why this alias is no longer in "/.cshrc". Either I made an error or they changed it in the update this morning. I also wonder why your command above does not reveal "/etc/csh.cshrc"? It seems to be something to do with "-xdev", but I can't find any evidence about why "/etc/" is not included.
 

l3eastie

Dabbler
Joined
Jun 13, 2013
Messages
10
Which leaves me wondering why this alias is no longer in "/.cshrc". Either I made an error or they changed it in the update this morning. I also wonder why your command above does not reveal "/etc/csh.cshrc"? It seems to be something to do with "-xdev", but I can't find any evidence about why "/etc/" is not included.
In FreeNAS /etc is a mountpoint for a RAM disk the contents of which are created at boot time from the /conf directory
The -xdev option in find prevents the command from crossing boundaries between volumes

Hence you cannot make persistent changes by editing the contents of the /etc folder and the -xdev switch will not search the /etc folder if the find command is executed from elsewhere in the file system.
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
In FreeNAS /etc is a mountpoint for a RAM disk the contents of which are created at boot time from the /conf directory
The -xdev option in find prevents the command from crossing boundaries between volumes

Hence you cannot make persistent changes by editing the contents of the /etc folder and the -xdev switch will not search the /etc folder if the find command is executed from elsewhere in the file system.
So it is: I looked at the output of "mount" and completely failed to see it. I should clearly carry on using FreeNAS precisely to avoid having to think about such things.
So the answer to your original question is that you need to edit the file in /conf/base/etc/ every time you reboot update FreeNAS to comment out that alias; I am sure you know that, but just for anyone else who is wondering.

Edited re next post.
 
Last edited:

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
No, everything in /conf/base/ is the files that are copied when you boot. For example the content of /conf/base/etc/ is copied to /etc/. So if you edit something in /etc/ then yes, it's maybe overwritten at each boot (not all files are overwritten) but if you edit the same file in /conf/base/etc/ it's permanent (unless an update changes it of course) ;)
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
No, everything in /conf/base/ is the files that are copied when you boot. For example the content of /conf/base/etc/ is copied to /etc/. So if you edit something in /etc/ then yes, it's maybe overwritten at each boot (not all files are overwritten) but if you edit the same file in /conf/base/etc/ it's permanent (unless an update changes it of course) ;)
OK, thanks, I'll re-edit my post!
 
Status
Not open for further replies.
Top