dot-files

SSHing into system with ZSH as default shell doesn't run /etc/profile

SSHing into system with ZSH as default shell doesn't run /etc/profile I’m experiencing a strange behavior on some of our machines atm. At least, it seems strange to me and my colleagues and we didn’t find any explanation for it 🙂 [edit 1] Next paragraph seems to be wrong. See edit 2 at end. We’re …

Total answers: 2

How do I apply the changes to the .zshrc file after editing it?

How do I apply the changes to the .zshrc file after editing it? I just edited the .zshrc file to configure Z shell on FreeBSD, for example to update the PATH system variable. path+=/usr/local/openjdk12/bin How do I make the changes take effect? Must I log out and log in again? Is there a way to …

Total answers: 4

How do configure ZSH commands substition to not use backticks (`)?

How do configure ZSH commands substition to not use backticks (`)? I only want echo $(date) to return the date not the backticked version. echo $(date) # should return Wed Mar 6 09:50:41 EST 2019 echo `date` # should return `date` Asked By: Josh Beauregard || Source Wrap the backticks in strong quotes to divest …

Total answers: 1

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

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 comments as to why …

Total answers: 2

rm wildcard not working

rm wildcard not working I want to delete all .swp files recursively. However: rm -r *.swp Gives: rm: cannot remove ‘*.swp’: No such file or directory Just to be sure, ls -all gives: total 628 drwxr–r–. 8 przecze przecze 4096 Aug 3 18:16 . drwxr–r–. 31 przecze przecze 4096 Aug 3 18:14 .. -rwxrwxr-x. 1 …

Total answers: 2

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

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 I went to …

Total answers: 4

How to show only hidden directories, and then find hidden files separately

How to show only hidden directories, and then find hidden files separately I’m trying to list all the hidden files in a directory, but not other directories, and I am trying to do this using only ls and grep. ls -a | egrep “^.” This is what I have so far, but the problem is …

Total answers: 7

How can I stop seeing hidden files in the Midnight Commander?

How can I stop seeing hidden files in the Midnight Commander? The Midnight Commander is a very helpful tool when we’re using only the text mode. But sometimes it bothers me that I have to see all the hidden files inside a folder (files that begin with “.”). I’ve tried to find how to do …

Total answers: 3

`command .*` acts on the parent directory

`command .*` acts on the parent directory 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 username:groupname .* We were pretty surprised when we realized, that he actually recursively changed the permissions …

Total answers: 7

How to match * with hidden files inside a directory

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 simple using a single command instead of using du -b maybehere*/.* …

Total answers: 5

proper way to iterate through contents in a directory

proper way to iterate through contents in a directory 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 (files that begin with a “.”). The other …

Total answers: 1

How to rename file to .. (dot dot)?

How to rename file to .. (dot dot)? Apparently you can rename file to …. If I were insane, how would I rename file to .. or .? Is such a filename even allowed? Backslash doesn’t seem to disable dot’s special meaning: $ mv test . mv: `test’ and `./test’ are the same file Asked …

Total answers: 3

Why are some files and folders hidden?

Why are some files and folders hidden? I can understand the rationale of hiding files and folders in the /home/user directory to prevent users from messing around with things. However, I do not see how the same rationale can be applied to files in the /etc, /boot and /var directories which is the domain of …

Total answers: 4

how to copy or backup files ignoring dot files

how to copy or backup files ignoring dot files I want to back-up all files from my laptop partitions to external HDD. I ran, for example cp -a /med*/ravb*/*00 /med*/ravb*/M*L*/7.3GB_CP && echo “7.3GB BACKED UP PROPERLY” || echo “7.3GB FAILED TO BACK UP” The issue is that dot files are also getting included which I …

Total answers: 1

display only files starting with . (hidden)

display only files starting with . (hidden) I tried to display only hidden files but don’t know how to do it. That is working (but matching also dots in other places) ls -la | grep ‘.’ Was trying adding ^ but didn’t find the solution. Asked By: user3014282 || Source ls -ld .* will do …

Total answers: 10

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

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 .* Naturally, the .* …

Total answers: 2

Copy all dotfiles except for `.git` and `..`

Copy all dotfiles except for `.git` and `..` I am aware of using .[!.]* to refer to all dotfiles in a directory with the exception of .., but how might one refer to all dotfiles except for .. and .git? I have tried several variations on .[!.||.git]* and .[!.][!.git]* and the like, but none refer …

Total answers: 4

How to keep dotfiles system-agnostic?

How to keep dotfiles system-agnostic? Due to work I have recently started using OS X and have set it up using homebrew in order to get a similar experience as with Linux. However, there are quite a few differences in their settings. Some only need to be in place on one system. As my dotfiles …

Total answers: 2

How do I specify arguments to return all dot files, but not . and ..?

How do I specify arguments to return all dot files, but not . and ..? Normally dot files are not included for wildcard expansion: % echo * Applications Desktop Documents Downloads Library Movies Music Pictures Public bin If I explicitly ask for dot files, I get them: % echo * .* Applications Desktop Documents Downloads …

Total answers: 6