Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [linux]

NOTICE: All Linux questions must be related to programming; those that aren't will be closed. Use this tag only if your question relates to programming using Linux APIs or Linux-specific behavior, not just because you happen to run your code on Linux. If you need Linux support, you can try https://unix.stackexchange.com or the specific Linux distribution's Stack Exchange site like https://askubuntu.com or https://elementaryos.stackexchange.com/

7541 votes
56 answers
11.2m views

Find all files containing a specific text (string) on Linux?

How do I find all files containing a specific string of text within their file contents? The following doesn't work. It seems to display every single file in the system. find / -type f -exec grep -H '...
Nathan's user avatar
  • 77k
3034 votes
19 answers
4.7m views

How can I recursively find all files in current and subfolders based on wildcard matching?

How can I recursively find all files in current and subfolders based on wildcard matching?
john's user avatar
  • 34.8k
2783 votes
33 answers
2.0m 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 can I do that?
satheesh.droid's user avatar
2432 votes
7 answers
1.7m 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 the installation, something went wrong. I want to remove the GNUPLOT_DRIVER_DIR ...
A. K.'s user avatar
  • 36.9k
2235 votes
18 answers
2.3m views

How can I symlink a file in Linux? [closed]

I want to create a symbolic link in Linux. I have written this Bash command where the first path is the folder I want to link, and the second path is the compiled source. ln -s '+basebuild+'/IpDome-...
chrisg's user avatar
  • 41.2k
2223 votes
49 answers
1.8m views

How do I exclude a directory when using `find`?

How do I exclude a specific directory when searching for *.js files using find? find . -name '*.js'
helion3's user avatar
  • 36.7k
2193 votes
27 answers
2.3m views

How do I recursively grep all directories and subdirectories?

How do I recursively grep all directories and subdirectories? find . | xargs grep "texthere" *
wpiri's user avatar
  • 22.1k
2177 votes
19 answers
5.2m views

How do I change permissions for a folder and its subfolders/files? [closed]

How do I change the permissions of a folder and all its subfolders and files? This only applies to the /opt/lampp/htdocs folder, not its contents: chmod 775 /opt/lampp/htdocs How do I set chmod 755 ...
Adam Halasz's user avatar
  • 58.1k
2155 votes
20 answers
724k views

How do I profile C++ code running on Linux?

How do I find areas of my code that run slowly in a C++ application running on Linux?
Gabriel Isenberg's user avatar
2132 votes
16 answers
2.8m 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 (peptides.txt) do echo "${p}" done I get this output on the screen: Start! ./runPep.sh: ...
Peter Mortensen's user avatar
1889 votes
39 answers
1.4m views

How do I prompt for Yes/No/Cancel input in a Linux shell script?

I want to pause input in a shell script, and prompt the user for choices. The standard Yes, No, or Cancel type question. How do I accomplish this in a typical bash prompt?
Myrddin Emrys's user avatar
1809 votes
5 answers
203k views

What is ':-!!' in C?

I bumped into this strange macro code in /usr/include/linux/kernel.h: /* Force a compilation error if condition is true, but also produce a result (of value 0 and type size_t), so the expression ...
chmurli's user avatar
  • 15.1k
1619 votes
12 answers
1.1m 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 redirect any output from that command to the file specified (in this case 'output'). Is ...
SCdF's user avatar
  • 58.7k
1571 votes
23 answers
1.2m views

Merge / convert multiple PDF files into one PDF [closed]

How could I merge / convert multiple PDF files into one large PDF file? I tried the following, but the content of the target file was not as expected: convert file1.pdf file2.pdf merged.pdf I need ...
alcohol's user avatar
  • 23.5k
1495 votes
3 answers
1.1m views

How can I use grep to show just filenames on Linux? [closed]

How can I use grep to show just file-names (no in-line matches) on Linux? I am usually using something like: find . -iname "*php" -exec grep -H myString {} \; How can I just get the file-...
cwd's user avatar
  • 54.2k

15 30 50 per page
1
2 3 4 5
15192