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.
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
should do the job.
if vim is installed, it shows you the version of vim, else it asks you to install it.