Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Thanks in advance for reading my topic.Sorry for asking help again.
i'm having problem with gedit editor.The problem which i face is that when i type something inside the gedit editor by using command such as opening a existing file:
Code:
$ vi linux
or
vi linux
After typing these, it doesn't open the file and doesn't show any error message.Its first time i'm using these gedit editor by using command because i need to do my project.I tried by opening the file using GUI by moving the mouse and selecting, the file can be opened and it shows the content inside the file.Plz correct me if i'm wrong and plz guide me too and thanks alot for all your help.
This is my project question:
1. Open the file named “linux” in the vi editor
2. Append the following text at the new line:
Hello World!
Hello Good Morning
Hello Good Afternoon
Hello Good Evening
Hello Good Night
3.Delete 2 lines starting from the statement “Hello Good Morning”
4.Search for the entire file for the string named “Hello” and replace
each occurrence with the string, namely “Hi”
5.Save and quit the vi editor
It isn't really clear to me what exactly you're doing. Are you trying to type commands into gedit? If so, that's wrong. All you're doing by typing stuff in gedit is, well, typing stuff. If you want to run vi, then you open a terminal window and run "vi file", where file is the name of the file you want to create.
Thanks in advance for reading my topic.Sorry for asking help again.
There's on old (Chinese?) proverb: He who asks a question is a fool for a moment, but he who does not ask is a fool for the rest of his life.
As fm_hyudin says, gedit is a text editor, in the same way that vi or emacs is. It sounds like you want to use vi, so you want to start with a terminal program, like gnome-terminal (usually under "Terminal" in the accessories menu).
It is also just possible that, when you start vi, you get a window opening labelled "gedit"? If so, then you have an alias set to run gedit instead of vi. You can run
Code:
alias
to see what aliases are in place. In this case, you may want to make sure that vi is installed and turn off the alias by running:
Thanks alot mate for clearing my doubt.No wonder i don't get any reply or error when typing those commands.I really understand now that i did a big and careless mistake.I'm really new to this text editors.So i thought gedit can be used.Sorry for giving problem.
@ rjlee
Yeap.I'm agree with u mate.If i didn't ask this question now, i will be fool for the rest of my life because this thing was confusing and just like u said. Gedit also is a text editor like emacs and vi.So i thought gedit can be used,Thanks alot mate for clearing my doubt and helping me.I really understand now and i really appreciate your help.
@ chrism01
Wow.Thanks alot mate.You really made my day.Thanks alot again.I really appreciate your help.I will be using your answer as my guide mate.By referring to this, it shall help me to make me learn from mistakes and my foundation stronger.Thanks alot again and i really appreciate your help.
@ Nylex & rjlee & chrism01
Thanks alot everyone for your kindful help.I really appreciate it.Thanks alot again.Its really glad to see all of you helping me.Sorry for giving problems and for any inconvenience.I learnt alot from this forum due to my mistakes and it had made my foundation in linux become stronger a bit now.God bless you all.
so i just ignored the error because i don't understand what it is exactly and start pressing enter button.after that, my file opened itself.so then i got stucked again.
my question:
Append the following text at the new line:
Hello World!
Hello Good Morning
Hello Good Afternoon
Hello Good Evening
Hello Good Night
Your press "i" to insert any text
Your press "esc" key to finish the insertion
Your press :w to write the file thereby saving it
Your press :q to quit
Also you seem to edit a swap file as warned by the kernel. What you should have done is to create a text file first, like "vi anyfile", opted to save it, quited and then do the project work.
A swap file or a binary file is in machine code and has unprintable characters. They should never be edited.
swp are temporary files created by vim just like ~files in other applications. Most likely vim was exited abruptly and changes were not saved. Close vim and delete the file using the rm command.
You can search the web for vim tutorials, documentation and command cheat sheets which will answer your questions and provide additional help to what has already been provided.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.