Linux

LINUX QUESTIONS MUST BE PROGRAMMING RELATED. 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 https://askubuntu.com

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
498 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
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
489 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
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
729 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