Tag: r

60 votes
17 answers
3.1K views
open() in Python does not create a file if it doesn't exist

What is the best way to open a file as read/write if it exists, or if it does not, then create it and open it

avatar
Benton
0 1 0 9
asked 07 September, 2021
52 votes
30 answers
798 views
How can I measure the actual memory usage of an application or process?

How do you measure the memory usage of an application or process in Linux? From the blog article of Understand

avatar
Tana
0 1 0 9
asked 07 September, 2021
56 votes
9 answers
2K views
Redirect all output to file in Bash

I know that in Linux, to redirect output from the screen to a file, I can either use the > or tee. How

avatar
Cortez
0 1 0 9
asked 07 September, 2021
56 votes
28 answers
2.4K views
Exploring Docker container's file system

I've noticed with docker that I need to understand what's happening inside a container or what files

avatar
Suzan
0 1 0 9
asked 07 September, 2021
55 votes
14 answers
553 views
How can I exclude directories from grep -R?

I want to traverse all subdirectories, except the "node_modules" directory.

avatar
Keila
0 1 0 9
asked 07 September, 2021
66 votes
14 answers
981 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
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.3K 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
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
502 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
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
493 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
733 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
59 votes
30 answers
1.1K views
How to change the author and committer name and e-mail of multiple commits in Git?

I was writing a simple script in the school computer, and committing the changes to Git (in a repo that was in

avatar
Adolfo
0 1 0 9
asked 07 September, 2021
67 votes
30 answers
2.7K views
Git fetch remote branch

My colleague and I are working on the same repository. We've branched it into two branches, each technica

avatar
Brianne
0 1 0 9
asked 07 September, 2021