[SOLVED]using text editor with terminal

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
sgull
Level 3
Level 3
Posts: 155
Joined: Wed Dec 21, 2011 6:37 pm

[SOLVED]using text editor with terminal

Post by sgull »

Hopefully my inquiry here makes sense and can be understood what I'm asking.
Generally what is the reason for utilizing a text editor program (gedit for example) for transferring/entering commands, scripts, etc into the terminal? Specifically I ask because often on a web page there might be somebody posting a script or string of commands to help somebody else do something, and the sudo line they suggest includes such as sudo gedit and then the commands following that (whereupon then the gedit program will then open ready for text entry). Is it the idea/expectation that the person wanting to use the posted script (or string of commands etc) will then copy and paste, from the web page, that posted info into gedit, and then again copy and paste that same info into the terminal? Why not just copy directly from the web page and paste into the terminal? I'm confused about that. Any comment/advice that might help to clarify this for me would be appreciated.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
remoulder
Level 17
Level 17
Posts: 7621
Joined: Fri May 09, 2008 1:14 pm

Re: using text editor with terminal

Post by remoulder »

Not sure if I understand you correctly, but if someone is suggesting running gedit in a series of instructions it is generally to edit or create a particular file. The correct syntax btw would be gksudo gedit NOT sudo gedit. It is however not necessary to use gedit to copy/paste as you say, you can do this directly (using the mouse) into the terminal.
[Edit] your original post and add [SOLVED] once your question is resolved.

“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.
User avatar
sgull
Level 3
Level 3
Posts: 155
Joined: Wed Dec 21, 2011 6:37 pm

Re: using text editor with terminal

Post by sgull »

[quote="remoulder"] The correct syntax btw would be gksudo gedit NOT sudo gedit.

Thanks remoulder for your answer to my inquiry. In regard to your statement as quoted above, I googled about it because it seems I've often come across cautions against using sudo all the time, that it can be dangerous and is bad practice, etc., although I couldn't quite grasp the explained reasoning about it. Anyway, so I came up with this webpage, talking about it: http://www.psychocats.net/ubuntu/graphicalsudo
The article recommends "good practice is to use gksudo for graphical applications, but sudo for command-line applications". However, that in itself is unclear to me (as a newbie), as actually at this point I don't have an understanding of how I'd determine the difference between a graphical application and a command-line application. Comment please?
remoulder
Level 17
Level 17
Posts: 7621
Joined: Fri May 09, 2008 1:14 pm

Re: using text editor with terminal

Post by remoulder »

sgull wrote:the difference between a graphical application and a command-line application
Basically a graphical application is one that runs on the X desktop in it's own interface window and is run from the menu, e.g. gedit, whereas a command line app has to be entered an a terminal prompt and runs (usually) invisibly, with any text output appearing there. Not the most exact description but I hope you get the idea.
[Edit] your original post and add [SOLVED] once your question is resolved.

“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.
DrHu

Re: [SOLVED]using text editor with terminal

Post by DrHu »

sgull wrote:Why not just copy directly from the web page and paste into the terminal?
One reason you might not want to make use of (copy into somewhere?) web page content that looks like plain text is that it might not be plain text but have included some odd web graphics, parts of a frame or just not be exactly what it looks like
--other than that, copying any part of a web page's data is A-OK, provided you know what you intend to do with it..
  • Except of course to avoid copyright infringements
User avatar
Roken
Level 5
Level 5
Posts: 737
Joined: Fri Nov 19, 2010 4:55 pm
Location: Newport, S Wales

Re: [SOLVED]using text editor with terminal

Post by Roken »

I would add to this more a word of caution than anything. If you are simply copying and pasting commands without an understanding of what they are doing, then wait some time for others to at least have an opportunity to look at the commands before using them. Most Linux forum users will be genuinely helpful, but it's possible for someone unscrupulous to post a set of commands that, if followed blindly, can trash your system. This is especially true of the more cryptic commands that you may be asked to enter. By waiting a little time (an hour or so should be enough on a busy forum) then others will vet the commands and will shout if anything looks wrong.

If someone responds for you to input some cryptic looking commands and no-one else has commented after an hour or so, then they are likely to be safe. Don't just blindly follow instructions as soon as they are posted, though.
Kernel Linux Tex 5.12.14-zen1-1-zen, XFCE
Arch
Dual GTX1070 8Gb
AMD Ryzen 1800X
32Gb RAM
User avatar
sgull
Level 3
Level 3
Posts: 155
Joined: Wed Dec 21, 2011 6:37 pm

Re: [SOLVED]using text editor with terminal

Post by sgull »

Roken wrote:I would add to this more a word of caution than anything. If you are simply copying and pasting commands without an understanding of what they are doing, then wait some time for others to at least have an opportunity to look at the commands before using them.
Roken I do appreciate your providing that caution and the suggestion. I won't be shy about asking when uncertain/unclear then. I have a lot to learn yet, and the expertise freely shared by those more knowledgeable here is a great resource. Thanks.
Locked

Return to “Beginner Questions”