Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I've often seen tech tutorials in which I'm supposed to open a terminal per program/process where actually I feel no need for doing so (no output on terminals, no termination via terminal etc.), and instead I can run all programs background with & at the end. Is there still advantages / technical reasons for using multiple terminals?
(not versatile at all but an example is this tutorial)
It is probably largely because it's easier to explain that than it is to explain how to start a program in the background. A part may also be that instructions use something like "export X=something" and they don't want to cause problems for another process later on, that may not behave as expected from this.
But generally, you can just use one terminal window, or one terminal with several tabs, if you prefer that solution. Different people have different ideas of "the right way to do things" - as long as it works as expected and every time, it's not a huge issue which way you do it.
Aside from envirnonment variables, I don't see any technical reason to have multiple terminals.
commands that you run on the terminal will use the same terminal (stdout) to flush info/warning or error messages. You can run all those commands in background if you want, like you said using & but then it gets difficult to keep track of any messages that those programs may produce. everything will be displayed on same console.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I have program that I need to run and then see how much resources it uses in unix by using top command. But I don't know how to do it because if i run it from command line I cant use top command till program is finished and vice versa. How can I do it. I tried doing:
sleep 10s
top
./myProgram
But its not working
Open two terminals; run your program in one terminal and top in another.
If you're in a graphical environment, you can just start the terminal a second time.
If you're on the text-only console, you can switch between terminals using Ctrl-Alt-F1..F6 (possibly more) or Alt-Left/Right.
If you connect via SSH, just open multiple terminal sessions in your SSH client.
(Also, I'd hint to use htop instead of top, but you may need to install it first.)
In case your program is too short-lived to show up on top/htop, you might need to run it using Valgrind.
Open two terminals one for running top, and run your program in the other.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
How do I go about figuring out the manual commands being run by things like nmap and aircrack? In other words, I want to figure out exactly what commands are being run in the background that we can't see, the commands that are being automated by these programs information. A google search of "manually portscan without nmap" only leads to links about automating nmap scans.
So for example, if I ran the command: nmap -sS 192.168.1.*, what is actually happening behind the scenes? How would I do the same thing manually? Thanks.
For open source tools like nmap, your best bet is to download the source code yourself,
then step through it (conceptually, or with the aid of a debugger) to see exactly what the program is doing. If you're lucky, there will be helpful comments in the source.
If you don't have access to the source code, you can use system call tracing tools
(for example, strace on Linux), which can give you some hints about what is going on "under the hood" (e.g. which files or sockets are being opened).
More likely these are issuing operating system calls, not things easily invoked manually.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to write a Linux command line chat room client.
I want to split the command window to different parts: input, chat, rooms, status like this one.
How can I print the new message from the server to the chat part of the window while keeping the other parts of the window?
Right now, the client that I have written is quite simple, it print all message to stdout, so it will ruin the words that you typed.
By using ncurses. It's a standard component in virtually all Linux distros and well documented (it even comes with a full set of man pages for all routines; for example, the man 3 printw command shows the documentation of the printw() function). It's also easy to use. You create several "windows" on the screen and can write text anywhere you like using x/y coordinates. They're not real windows, of course, since this is a text terminal; an ncurses window is just an area of the terminal.
For a nice introduction, see the NCURSES Programming HOWTO.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
For example, Impulse Tracker for DOS was a nice music production app that was among the first to create a smooth mouse using glyphs generated on the fly in the characters located near the current position of the mouse. (Read here for a better description of what I mean).
So, I'm just wondering if that can be done in Linux terminals (e.g. the tty1-6 terminals or Gnome Terminal). Is it possible?
(EDIT: Should I post this on unix.stackexchange.com instead?)
Seeing as the terminal itself (and not the application) usually sets the font being used, I don't think this is possible. For the tty1-6 terminals, you could use a framebuffer to accomplish this, if you were that dedicated to the idea. With a terminal emulator on a desktop environment, I do not believe this is possible.
Would GPM accomplish what you're looking for, with a lot less hassle?
GPM Link 1
GPM Link 2
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm looking for a tool that will tell me what my keyboard is sending to the operating system when i push different keys.
This is to help me answer this question How to get Cmd-left/right working with iTerm2 and Vim (without requiring .vimrc changes)? which has me trying to figure out why Vim treats my iTerm2 mapping of Cmd-left to Escape-[H differently from Home.
I tried unix's read, and it says that Home and Cmd-left both produce "^[[H". I'm hoping that read is misleading me, and that some other tool will show how Home and Cmd-left are different (note: when I say, Cmd-left in this paragraph, it is when iTerm2's mapping is turned on).
Thanks!
You're doing all this in a terminal, right?
I'm afraid you're not going to do much better than read (my preferred approach is to do cat > file, type, press ^D, and then look at the file in a hex editor).
With regard to the underlying question, it's worth hunting for options in your terminal emulator. Right now it's emulating a terminal which doesn't distinguish between HOME and CMD+LEFT. It may be possible to tell it to emulate a different terminal, which does.