5

This is probably trivial, but I'm quite new to Linux and I was unable to find any info online.

In a folder, I can execute the command find . -regex '.*py' and get the following result:

./.#netMHC3.2.py

Is this a file in the current directory? What can I do to display its contents?

8

Files which start with a '.' are hidden files. I don't know of a standard to use the '#' on certain kind of files. I've seen it on "backup" files generated by text editors.

To display the contents of a file use the "cat" command:

cat .#netMHC3.2.py

'.' and './' are the current directory in which you are working (use pwd to know where you are).

3
  • 5
    You might be better off using less, or piping it to less if you absolutely need to use cat. That way it's readable id it's more than a page. – MDMarra Jun 9 '10 at 16:32
  • Thanks - that makes sense. When I am in the same directory and use the cat command or try to download over SFTP, I get "no such file or directory". Could this be a permissions issue? – Martin Wiboe Jun 9 '10 at 16:34
  • try escaping the #, less /path/to/.\#netMHC3.2.py – Rob Jul 11 '12 at 19:07
4

Old question, but first hit on Google and no correct answer.

Those files are "lock"-files, usually created by an editor. Lock files come in many different shapes, but both emacs and joe creates symlinks named like in your example - as .#[original-filename].

Lock files are used to prevent multiple instances from editing the same file, simultaneous (eg. 2 different users wanting to edit the same file).

If you run

$ joe netMHC3.2.py

a lock-file will be created named

.#netMHC3.2.py

When the editor closes, the file gets deleted. If the editor crashes, its left behind and becomes a "stale lock". You can delete the file manually at this point, but most editors give you that option automatically when editing the file next time.

0

As Fernando said, the '.' before the file name means it's hidden. Hidden means that by using the ls command, the hidden file won't be part of the output. You can see them by using ls -a however.

This also applies to file managers. By default most graphical file managers won't display hidden files unless you tell them to.

Hidden files in your home directory are typically used to store configuration data for your applications. ~/.bashrc would contain any configuration data for your Bash shell, and it would only apply to your account.

0

This file is created by cvs

I think this is created when a cvs update fails and cvs backs up original file.

./.#netMHC3.2.py means that there is a hidden file ".#netMHC3.2.py" under current directory(./)

you can view this file from command line (while with in the same directory as the file) cat ".#netMHC3.2.py"

0

Well, a very old question, but the correct answer is not here so...

#filename# is a working file that emacs uses. Like an autosave file or something, I guess. If your regular file, filename, without the fore and aft hashtags is up-to-date, then you can delete the #filename# file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.