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.

saji89
  • 12,007
black
  • 546
  • 4
  • 15
  • 27
  • Try with opening a simple text file with vim. vim [FILENAME] –  Dec 21 '13 at 08: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 08:14

2 Answers2

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

Maythux
  • 84,289
  • 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 08:22
  • @black use the command whereis vim to locate the binary, source, and manual page files for a command – Maythux Dec 21 '13 at 08: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.