github/gitignore · Global/Linux.gitignore
Linux .gitignore Template Explained
Why Linux.gitignore ignores editor backups (*~), FUSE and NFS temporary files, KDE .directory, Trash folders and nohup.out.
Linux.gitignore is a short 6-line template that deals only with by-products of the Linux desktop and file systems. It is also the kind of template that fits well in a personal global gitignore.
Each rule targets files that appear only in specific situations. For example, .nfs* appears only on NFS mounts and .fuse_hidden* only on FUSE file systems.
Rules explained
| Pattern | What it ignores and why |
|---|---|
*~ | Editor backupsfilename~ backups that Emacs, gedit, nano and others leave when saving. It ignores every file whose name ends with a tilde. |
.fuse_hidden*.nfs* | FUSE and NFS temporary filesFiles the file system renames to postpone actual deletion when an open file is deleted. They disappear when the process closes the file. |
.directory | KDE folder settingsA file in which the KDE Dolphin file manager stores folder view settings. |
.Trash-* | TrashPer-user Trash folders (.Trash-1000) created when files are deleted from removable media or another partition. |
nohup.out | Background run logsThe file where output accumulates by default when a command is run with nohup. |
Practical notes
- The
*~rule is also in the Vim template. If you pick both templates, the duplicate-removal option collapses it into one line. - If you intentionally keep
nohuplogs on a server, redirect them to a different name (nohup cmd > run.log 2>&1 &). - If you use JetBrains or VS Code on a Linux desktop, also select the template for that editor.
Original template
Linux.gitignore
*~# temporary files which can be created if a process still has a handle open of a deleted file.fuse_hidden*# Metadata left by Dolphin file manager, which comes with KDE Plasma.directory# Linux trash folder which might appear on any partition or disk.Trash-*# .nfs files are created when an open file is removed but is still being accessed.nfs*# Log files created by default by the nohup commandnohup.out
Templates from github/gitignore/Global/Linux.gitignore @356fd7b (2026-09-11) · CC0-1.0