Tag: linux

66 votes
14 answers
983 views
What is the meaning of "POSIX"?

What is POSIX? I have read the Wikipedia article and I read it every time I encounter the term. The fact is th

avatar
Freida
0 1 0 9
asked 07 September, 2021
66 votes
21 answers
2.8K views
git replacing LF with CRLF

Running git on a Windows XP machine, using bash. I exported my project from SVN, and then cloned a bare reposi

avatar
Daniel
0 1 0 9
asked 07 September, 2021
59 votes
30 answers
1.6K views
How to kill a process running on particular port in Linux?

I tried to close the tomcat using ./shutdown.sh from tomcat /bin directory. But found that the server was not

avatar
Venice
0 1 0 9
asked 07 September, 2021
62 votes
5 answers
1.4K views
Why does the C preprocessor interpret the word "linux" as the constant "1"?

Why does the C preprocessor in GCC interpret the word linux (small letters) as the constant 1? test.c: #incl

avatar
Kurtis
0 1 0 9
asked 07 September, 2021
50 votes
30 answers
2.1K views
Pipe to/from the clipboard in a Bash script

Is it possible to pipe to/from the clipboard in Bash? Whether it is piping to/from a device handle or using an

avatar
Suzan
0 1 0 9
asked 07 September, 2021
65 votes
11 answers
2.6K views
Remove a symlink to a directory

I have a symlink to an important directory. I want to get rid of that symlink, while keeping the directory beh

avatar
Wei
0 1 0 9
asked 07 September, 2021
60 votes
10 answers
1.8K views
How to redirect output to a file and stdout

In bash, calling foo would display any output from that command on the stdout. Calling foo > output would

avatar
Kurtis
0 1 0 9
asked 07 September, 2021
56 votes
4 answers
1.1K views
How can I use grep to show just filenames on Linux?

How can I use grep to show just file-names (no in-line matches) on Linux? I am usually using something like: f

avatar
Keila
0 1 0 9
asked 07 September, 2021
56 votes
27 answers
503 views
How to count lines in a document?

I have lines like these, and I want to know how many lines I actually have... 09:16:39 AM all 2.00 0.0

avatar
Luis
0 1 0 9
asked 07 September, 2021
65 votes
15 answers
1.2K views
Looping through the content of a file in Bash

How do I iterate through each line of a text file with Bash? With this script: echo "Start!" for p in (pepti

avatar
Eddie
0 1 0 9
asked 07 September, 2021
61 votes
5 answers
2.9K views
What is ":-!!" in C code?

I bumped into this strange macro code in /usr/include/linux/kernel.h: /* Force a compilation error if conditi

avatar
Fabian
0 1 0 9
asked 07 September, 2021
51 votes
5 answers
2.4K views
How do I delete an exported environment variable?

Before installing gnuplot, I set the environment variable GNUPLOT_DRIVER_DIR = /home/gnuplot/build/src. During

avatar
Bryant
0 1 0 9
asked 07 September, 2021
49 votes
26 answers
495 views
How do I grep recursively?

How do I recursively grep all directories and subdirectories? find . | xargs grep "texthere" *

avatar
Chaya
0 1 0 9
asked 07 September, 2021
59 votes
20 answers
1.3K views
How can I profile C++ code running on Linux?

I have a C++ application, running on Linux, which I'm in the process of optimizing. How can I pinpoint wh

avatar
Roger
0 1 0 9
asked 07 September, 2021
58 votes
20 answers
2K views
How to change permissions for a folder and its subfolders/files in one step

I would like to change the permissions of a folder and all its subfolders and files in one step (command) in L

avatar
Tana
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
735 views
How to change the output color of echo in Linux

I am trying to print a text in the terminal using echo command. I want to print the text in a red color. How

avatar
Dusty
0 1 0 9
asked 07 September, 2021
56 votes
30 answers
1.1K views
58 votes
30 answers
1.5K views
How do I test if a variable is a number in Bash?

I just can't figure out how do I make sure an argument passed to my script is a number or not. All I wan

avatar
Nidia
0 1 0 9
asked 07 September, 2021
56 votes
12 answers
850 views
How to 'grep' a continuous stream?

Is that possible to use grep on a continuous stream? What I mean is sort of a tail -f <file> command, b

avatar
Lorenzo
0 1 0 9
asked 07 September, 2021
57 votes
8 answers
1.9K views
What does set -e mean in a bash script?

I'm studying the content of this preinst file that the script executes before that package is unpacked fr

avatar
Lorenzo
0 1 0 9
asked 07 September, 2021