Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [dot-files]

A dotfile is a file or directory whose name begins with a dot. These files are typically found in user home directories, contain configuration information and hidden from view on Unix systems.

Filter by
Sorted by
Tagged with
135
votes
11answers
135k views

How do you move all files (including hidden) from one directory to another?

How do I move all files in a directory (including the hidden ones) to another directory? For example, if I have a folder "Foo" with the files ".hidden" and "notHidden" inside, how do I move both ...
6
votes
3answers
3k views

When you type “ls -a”, what is the significance of “.” and “..”?

Whenever you type ls -a into the command prompt, you usually get all of your folders, files, and then you see that the first two entries are . and .. Just curious, but what is the significance of ...
15
votes
3answers
15k views

Why are filenames that start with a dot hidden? Can I hide files without using a dot as their first character?

Initially I thought it was a coincidence, but now I see there's even a tag for it: all hidden file names start with a dot. Is this a convention? Why was it chosen? Can it be changed? Or in other words ...
21
votes
5answers
16k views

How to match * with hidden files inside a directory

How to match the hidden files inside the given directories for example If I give the below command it's not giving the result of the hidden files, du -b maybehere*/* how to achieve this ...
37
votes
3answers
6k views

Why do some applications use ~/.config/appname for their config data while others use ~/.appname?

I've noticed that some applications put their configuration files to ~/.config/appname while others use ~/.appname (the classic way, AFAIK) for this. What's the sense in this distinction and what ...
13
votes
5answers
8k views

cp hidden files with glob patterns

Situation : $ mkdir foo && touch foo/.test $ cp foo/* . zsh: no matches found: foo/* (or bash : cp: cannot stat ‘foo/*’: No such file or directory) I have a directory full of hidden folders ...
8
votes
4answers
354 views

Is the behaviour of .* to include . and .. defined in LSB or POSIX or some other specification?

Is the behavior of .* to include . and .. defined in LSB or POSIX or some other specification?
2
votes
7answers
3k views

grep ignores files starting with dot [duplicate]

Let me give an example: $ echo Hello > file1 $ echo Hello > file2 $ echo Hello > .file3 $ grep Hello * 2>/dev/null file1:Hello file2:Hello Here you can see the grep ignored .file3 which ...
14
votes
1answer
65k views

proper way to iterate through contents in a directory [duplicate]

I need to iterate through every file inside a directory. One common way I saw was using the for loop that begins with for file in *; do. However, I realized that it does not include hidden files (...
13
votes
2answers
2k views

Shell filename pattern that expands to dot files but not to `..`?

Recently I had a little mishap caused by a shell pattern that expanded in an unexpected way. I wanted to change the owner of a bunch of dot files in the /root directory, so I did chown -R root .* ...
6
votes
2answers
956 views

How can I make bash not match `.` and `..` with `.*`

When I try to match all dot files in a directory with .* it seems to have a nasty side-effect: besides matching all (real) files and directories, it matches . and ... bash-3.2$ mv test/.* dest/ mv: ...
3
votes
1answer
4k views

Elegant Way To Store Dotfiles on GitHub

I need an elegant solution to store my dotfiles on GitHub for easy access. I tried to create a dotfiles directory and symlink all the dotfiles into there. Then I tried adding the symlinks to git and ...
5
votes
4answers
8k views

How to delete all files in a current directory starting with a dot?

I use Ubuntu 14.04 and in a terminal I became root with sudo su and I wanted to delete root's trash manually. It deleted everything except for a few files that start with a dot. Like .htaccess etc. So ...
38
votes
8answers
8k views

Are there pitfalls to putting $HOME in git instead of symlinking dotfiles?

I have for many years had my entire $HOME directory checked into subversion. This has included all my dotfiles and application profiles, many scripts, tools and hacks, my preferred basic home ...
15
votes
2answers
3k views

cp behaves weirdly when . (dot) or .. (dot dot) are the source directory

This answer reveals that one can copy all files - including hidden ones - from directory src into directory dest like so: mkdir dest cp -r src/. dest There is no explanation in the answer or its ...
25
votes
5answers
22k views

What's so special about directories whose names begin with a dot?

I was wondering what the difference between these two were: ~/somedirectory/file.txt and ~/.somedirectory/file.txt It's really difficult to ask this on Google since I didn't know how to explain ...
22
votes
7answers
1k views

`command .*` acts on the parent directory [duplicate]

Someone of our team wanted to recursively change the user permissions on all hidden directories in a users home directory. To do so he executed the following command: cd /home/username chown -R ...
4
votes
1answer
953 views

Is there a more elegant way to unlink two tmux clients sharing a session from inside tmux?

This is almost a code-review question, but very *nixy and more about configuration than code. For years since I switched to tmux from screen I've had a couple of nagging issues that I could not make ...
6
votes
1answer
489 views

Alphabetizing names in `ls` alias with .files not intermingled

I am currently using the following ls alias: alias ls='ls -alhGkpsq --color=auto'. This results in following directory listing. [03:35] bryson@brys ~ :$ ls total 48K 4.0K drwx------ 4 bryson 4.0K ...
4
votes
1answer
607 views

Dot in front of file [duplicate]

If there is a file and the filename starts with a dot in front of it. Does that mean that you created the file and you are hiding stuff in it or can the files get created on their own without you ...
1
vote
1answer
524 views

restricting pushes to selected Mercurial repositories using `ssh` forced commands and `hg-ssh`

The context of this question is the hg-ssh script. It is helpful but not critical to know something about Mercurial. This script sets up a forced command using public keys so the given public key ...