Questions tagged [tilde]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
0answers
23 views

Multiple files with the same name and a tilde are written while editing a file with gvim

I am under fedora 29. I edit my files with gvim and since a few days, one of them appears multiple times, renamed with an additional letter and tilde. The directory looks like this : sf1.pdf sf1....
-1
votes
4answers
84 views

Where is cd ~ located on Ubuntu?

What is the absolute path of cd ~ on Ubuntu? Trying to find out where this dir is located? For example: /home
2
votes
1answer
108 views

The tilde ~ key combination doesn´t show up in bash

I am using an acer swift one laptop with Windows 10, the keyboard setting is on standard German. I downloaded bash today from git-scm.com/download/win and tried some commands. Starting of with the ...
0
votes
0answers
33 views

Tilde expansion keeps changing in xterm, $HOME seems to be OK

My cygwin terminals have been screwing up tilde(~) vs $HOME when I restart them after (yet another) Windows 10 reboot. It seems to replace characters in the home directory with some unicode crap. ...
9
votes
1answer
851 views

Why tilde (~) doesn't expand when used with CLI argument starting with dash?

I lost a couple of hours trying to run VNC server (x0vncserver) and the client refused to connect with weird message that No password configured for VNC Auth The server also prints this error ...
-1
votes
2answers
177 views

What kind of language construct is the swung dash (tilde, ~)?

The swung dash can be used in place of the home directory. Depending on the current user it has a different value. In this sense it works like a variable. Yet it is not a variable. I can't do echo $~...
0
votes
2answers
161 views

Why do tilde prefixes expand prior to assignment, but braces don't

tl;dir In bash, brace expansion occurs before tilde expansion. However, tilde prefixes seem to expand prior to variable assignment and brace expansion doesn't. Why? Details and examples Brace ...
3
votes
1answer
679 views

What's the different between with a ~ and without a ~ in a string variable in Bash? [duplicate]

I'm using a dotfile manage software, named dotdrop. Using a config file named .env, contents like: git_folder="~/code/Git". Also use a script to setup this dotfile tool before the first use of it, as ...
3
votes
2answers
4k views

Why do you have to put ~/ before .bashrc when opening the .bashrc file? [duplicate]

I'm wondering why it is required to put ~/ before .bashrc when opening the bashrc file. To illustrate: I normally open files on my system as follows: vim filename.extension But while in the /...
3
votes
4answers
977 views

Bash script copy file to user's (wildcard) home dir

I need to copy /root/nbu/file1.sh to every user's home directory if user's id is even number. Trying to execute following script: #!/bin/bash cat /etc/passwd | while read LINE do username=$(awk -...
1
vote
1answer
1k views

How to save a path with ~ into a variable?

I have these variables in my script: TARGET=username TARGET_DIR="~${TARGET}/.ssh" I want the TARGET_DIR var to hold this path: /home/username/.ssh but to use ~ instead of /home/. But when I run the ...
0
votes
3answers
709 views

using tilde in variable from the user

I saw a lot of posts about it all over the internet but i couldn't make it run as i wanted. I have an input from the user of a path. If the user will type ~/Desktop/ for example i can't use $ans in ...
0
votes
2answers
100 views

I accidentally exited vim with :x!~ and now my ~ shows up in a different path

When exiting a file as root, I typed :x!~ and hit enter. Now I have the following: root@host:/etc/shinken/services$ ll total 64K -rw-r--r-- 1 0 0 515 Sep 1 18:24 ~ drwxr-xr-x 2 10003 ...
10
votes
1answer
2k views

Expansion of tilde in zsh

I stumbled upon this behavior of zsh when using FreeBSD: % dd if=/dev/zero bs=1M count=1 of=~/test2 dd: failed to open '~/test2': No such file or directory This really confused me because the same ...
0
votes
1answer
8k views

chmod 400 command returning “No such file or directory” error. Trying to launch an instance through AWS

CODE: root@crane-linux:/home/crane/Downloads# sudo chmod 400 ~/home/crane/Downloads/mykey.pem chmod: cannot access '/root/home/crane/Downloads/mykey.pem': No such file or directory root@crane-linux:/...
4
votes
1answer
627 views

readlink literal vs variable

Using BASH: the answer is probably obvious but, not for me. > echo $PWD /root/fcm > readlink -f ~ /root > # but then with a variable or literal > a='~' > readlink -f $a /root/fcm/~ >...
1
vote
4answers
866 views

Why is `mkdir ~root/.ssh` the same thing as `mkdir /root/.ssh`?

This is fairly trivial and I'm just curious as to why mkdir ~root/.ssh is the same thing as mkdir /root/.ssh? I'm reviewing the following docker file and the creator uses mkdir ~root/.ssh to create ...
2
votes
2answers
784 views

how to set tilde + alias style?

I noticed there's default tilde + alias exist: [root@xiaobai ~]# cd ~[press Tab] ~abrt/ ~dbus/ ~lp/ ~openvpn/ ~root/ ~systemd-...
10
votes
4answers
5k views

Create another shortcut `~~` like `~` (home directory)

I want ~~ to point to a different directory so I can use it as a shortcut. I want it to have exactly same functionalities as ~. How can I do this?
3
votes
3answers
923 views

What is the difference of defining a variable with or without quotation marks? [duplicate]

If I define a variable with the quotation mark: TEMP="~/Dropbox" then ls $TEMP would not work, instead echo $TEMP | ls works. And to get the same result, I can also define the variable without ...