Solved

is there a shortcut on the copy command  in linux ?

Posted on 2014-10-05
4
208 Views
Last Modified: 2014-10-20
As we know people have been know to make mistakes in VI.  

Before you edit a file it is advisable to back the file up.

I can type cp /etc/vsftpd/vsftpd.conf  /etc/vsftpd/vsftpd.conf.bk

Is there a faster way to do this to not have to type out the target path ( if I an not always in the target directory ? )

Regards;

timfox123

Redhat 5+
0
Comment
Question by:TIMFOX123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 40362271
cp /etc/vsftpd/vsftpd.conf{,.bk}
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 40362298
Since you're using RedHat Linux I'm rather sure that your "vi" is in fact "vim".

Under "vim" you can do this:

Create a file called ".exrc" or ".vimrc" in your $HOME directory and add these two lines:

set backup
set backupext=.bk

From now on vim will create a backup file in the same directory as the original file with a name composed of the original name plus the desired extension (here: .bk) before saving any changes to the original file.
0
 

Author Comment

by:TIMFOX123
ID: 40362512
Thank you both.

Ozo hit this one perfectly

One last question before I close this ozo ?  How did you know this ( web link ?)

this sure can speed up the process and make typo errors on this command very infrequent
0
 
LVL 84

Expert Comment

by:ozo
ID: 40362600
man bash
(or whatever shell you are using)
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ignore other .htaccess 2 71
number in printf 13 42
LogmeIn using Linux Ubuntu 16.04 6 116
postfix start error! 9 56
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question