2

I am a newbie in linux,maybe it's a silly question but could not make it though.

I have ubuntu 12.04 installed without GNOME and now as i wanted to know more about linux am facing few queries.

I want to write a script which will automate few daily task.

Now I have opened terminal and selected BASH(default) by typing echo $SHELL to write a script I found that a editor is the choise like vi or vim.

Firstly can I do script in open terminal/BASH without installing vim. I have installed vim with the following cmd sudo apt-get install vim.

How to check from CLI whether vim is successfully installed and where can I find the files in the directories.

  • Try with opening a simple text file with vim. vim [FILENAME] – user224082 Dec 21 '13 at 8:11
  • this will check if its installed. but y use vim rather than just using BASH. and as vim is editor like notepad++ – black Dec 21 '13 at 8:14
2

First, you should know that vim or vi or gedit are just text editors....

You can write a script without using using the text editors, i.e you can just write your script directly in your bash shell.. but you have lastly to redirect it to a file in order to call the script later.

It's better to use a text editor to do such thing and to make easy to edit and maintain your script..

now to know if vim is installed in your system or whatever other application you can use the following command apt-cache policy <package-name>

Check the answer in the question for more details

| improve this answer | |
  • 1
    1 more thing,in which directory can i find the vim files like we find in c:program files – black Dec 21 '13 at 8:22
  • @black use the command whereis vim to locate the binary, source, and manual page files for a command – Maythux Dec 21 '13 at 8:25
2
vim -- version 

should do the job.
if vim is installed, it shows you the version of vim, else it asks you to install it.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.