How to find port number for a particular process id in unix? [closed] - pid

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 1 year ago.
Improve this question
In UNIX OS, how can I find the port number when i know the process name or pid ?

netstat -pl | grep NAME_OR_PID

ss -plnt | grep PID | gawk '{print $4}' | sed -e 's/[^0-9]//g'

Related

UTF-8 Character edit is not OK in output window [closed]

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 4 years ago.
Improve this question
I have configured My putty to accept UTF-8 Character
I have set the linux environmental variable as UTF-8.
export LANG="en_GB.UTF-8"
How ever when I run my program, edit my use input the I have 2 press backspace key twice to delete the single character even though if the environmental values in active state.
Also I tried and I could not able to set the environmental value through my c code .
if (setlocale(LC_ALL, "en_US.UTF-8") == NULL) {
abort();
}
what I have to do to get this problem solved?

Use array variable in as argument to command [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I have to use an array in a command that is stored in a variable:
# Array
DOMAIN="${DOMAIN:-example.com}";
GETIP=$( dig +short "${DOMAIN}" ) # No output
The following command is working:
dig +short example.com
I can not reproduce your problem:
DOMAIN="${DOMAIN:-example.com}";
GETIP=$( dig +short "${DOMAIN}" )
echo "$GETIP"
Output:
93.184.216.34
The problem was that I used the Variable outside of the scope.

How to change/fake the 'file size' [closed]

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 7 years ago.
Improve this question
I have a file named "abc.mp4" its of 2 GB, i want a program that will conver it size to 6GB keeping the original video, Is there any method to do this like adding useless bytes at end of video?
try this
RandomAccessFile r = new RandomAccessFile(path, "rw");
r.setLength(6L * 1024 * 1024 * 1024);
r.close();
The Answer above is Good, But this Tool did my job very easily and perfectly!
https://sourceforge.net/projects/filesizefaker/

Cut a file whose name contains a space [closed]

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
There is a file /home/tiger/Desktop/shell practice. I want to cut 9 blank spaces from it:
cut -c 10- '/home/tiger/Desktop/shell practice'
cut: /home/tiger/Desktop/shell practice: No such file or directory
How can I do this?
cut -c 10- '/home/tiger/Desktop/shell\ practice'
A friend told me how to solve it.

Linux system call table or cheatsheet for Assembly [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Does anyone know where to find a summary table or cheatsheet for the Linux system call in Assembly?
I am invoking Linux system calls through the int 0x80 instruction and I need a quick reference to determine which register contains which value from time to time.
Here's an archive of a really good online reference with links to documentation and kernel source code.
The system calls can also be found in /usr/include/asm/unistd.h, which will point you to unistd32.h or unistd64.h
And here's one more that's more easily navigable:
http://docs.cs.up.ac.za/programming/asm/derick_tut/syscalls.html
A scripting way to find out for your current machine:
ls /usr/share/man/man2 | sed -e s/.2.gz//g | xargs man -s 2 -k | sort | grep -v 'unimplemented system calls'
Credit - http://www.cs.fsu.edu/~langley/current-system-calls.html

Resources