Why mv --backup does not work on CentOS 7? [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I tried doing something like
mv --backup=numbered KeyStoreAll.jks .old/KeyStoreAll.jks
which works flawlessly on Ubuntu 18.04.
But when I'm trying the same on CentOS 7 it asks me
mv: overwrite ‘.old/KeyStoreAll.jks’?
Why it does not work for CentOS 7?
mv help/syntax looks the same.

Check your aliases definition:
$ touch source
$ touch target
$ mv source target
$ alias mv='mv -i'
$ touch source
$ mv source target
mv: overwrite ‘target’?

Related

Unix directory deletion: [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
There was a directory structure on my linux server like this A/$b/
From my home directory executed a command
rm -rf A/$b.
After executing this command, The directory A itself was deleted.
Any idea what would have happened in the background?
A $ sign indicates the start of a variable in most shell languages.
If $b is not defined then your command would resolve as:
rm -rf A/
… which would delete the A directory.
To include the $ in the path you need to escape it:
rm -rf A/\$B

Trying to move a file from Documents directory into /etc/bind Linux Ubuntu [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I want to move/copy a file from the Documents directory into /etc/bind I tried:
sudo mv ~/Documents/Config_Files/db.example.lan /path/to/etc/bind/
I also tried:
sudo mv ~/Documents/Config_Files/db.example.lan /path/to/~//etc/bind/
But also got the error: "No such file or directory"
I am probably being dumb but I double checked spelling capitilisation and everything is correct but still won't come up as a directory.
I can't guide you much but, as you can see we use 'sudo mv' and this means we tell root to move it and you type '~' which means home directory...
So if you type:
sudo mv ~/Documents
this means
sudo mv /root/Documents
instead of
sudo mv /home/<xyz>/Documents
Try to give proper path and let me know if it works.!
example:
sudo mv /home/<username>/Documents/Config_Files/db.example.lan /etc/bind/

linux cp file at the same directory but do not want cd to that directory [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
what i do
$ cp /etc/libvirt/qemu/centos7.8.xml{,123.xml}
what happend
$ ls /etc/libvirt/qemu/
centos7.8.xml centos7.8.xml123.xml
but what i want is
$ ls /etc/libvirt/qemu/
centos7.8.xml 123.xml
i don't want to use the follow , write /etc/libvirt/qemu twice:
$ cp /etc/libvirt/qemu/centos7.8.xml /etc/libvirt/qemu/123.xml
and i know what {,_backup} mean.
any way?
like follow ? no such format
cp /etc/libvirt/qemu/centos7.8.xml{123.xml}
Using bash extension brace expansion you can do the following:
cp /etc/libvirt/qemu/{centos7.8.xml,123.xml}
or even:
cp /etc/libvirt/qemu/{centos7.8,123}.xml

How to quickly move to a real directory using a soft link directory in linux? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I have a dir /var/real-dir
I've created a soft link to it like this
ln -s /var/realdir /var/virtual-dir
Having that my working directory is /var/virtual-dir, I'm searching for a way to cd to real-dir with as less typing as possible.
You can use cd -P .
Note that this only updates the PWD and OLDPWD environment variables; the kernel-level current directory remains unchanged.
Alternatively, you can use the -P option with the initial cd like cd -P /var/virtual-dir.
You can:
cd "$(readlink -f .)"
If this is too much typing, you can create a helper function in your .bashrc, like this:
function cdlink() {
cd "$(readlink -f .)"
}
source ~/.bashrc or start a new shell and can simply type:
cdlink

Shuf - To Shuffle the contents of a file in linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I am using some tcsh code that uses a command called shuf:
shuf $file_name > out.txt
http://tuxthink.blogspot.ca/2012/06/shuf-to-shuffle-contents-of-file.html
but seems my linux/bash version does not have it. Does anyone knows a way to install it?
My linux/tcsh is:
$ echo $version
tcsh 6.14.00 (Astron) 2005-03-25 (x86_64-unknown-linux) options wide,nls,dl,al,kan,sm,rh,color,filec
$ uname -mrs
Linux 2.6.18-194.8.1.el5 x86_64
Also, I am a user of the server but I do not have super user permission, can only perform local installations in my user folder.
Thanks!
Try your package manager or sudo apt-get install shuf

Resources