Skip to content

Programming Articles

  • HOME
  • Python
  • JavaScript
  • C/C++
  • Java
  • Terms & Conditions and Privacy Policy
  • About US
Main Menu

Linux

Bash / Linux

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

The simplest and most widely available method to get user input at a shell prompt is the read command. The best way to illustrate its use is a simple demonstration: Another method …

How to prompt for Yes/No/Cancel input in a Linux shell script? Learn More
Bash / Linux

How to loop through the content of a file in Bash?

One way to do it is: As pointed out in the comments, this has the side effects of trimming leading whitespace, interpreting backslash sequences, and skipping the last line if …

How to loop through the content of a file in Bash? Learn More
Command Line Interface- CLI / Linux

How to exclude a directory in find . command in Linux?

Use the -prune primary. For example, if you want to exclude ./misc: To exclude multiple directories, OR them between parentheses. And, to exclude directories with a specific name at any level, use the -name primary …

How to exclude a directory in find . command in Linux? Learn More
Linux

How to delete an exported environment variable in Linux?

Short answer: unset is the command you’re looking for. How to delete an exported environment variable in Linux? Walkthrough of creating and deleting an environment variable in Bash: Test if the …

How to delete an exported environment variable in Linux? Learn More
C/C++ / Linux

How to profile C++ code running on Linux?

If your goal is to use a profiler, use one of the suggested ones. However, if you’re in a hurry and you can manually interrupt your program under the debugger …

How to profile C++ code running on Linux? Learn More
Linux

How to change permissions for a folder and file in Linux?

Check the -R option chmod -R <permissionsettings> <dirname> In the future, you can save a lot of time by checking the man page first: So in this case: How to …

How to change permissions for a folder and file in Linux? Learn More
Linux

How to create a symlink in Linux?

A symlink (symbolic link) is a type of file that points to other files or directories (folders) in Linux. To create a new symlink (will fail if symlink exists already): …

How to create a symlink in Linux? Learn More
Bash / Linux

How to change the output color of echo in Linux?

You can use these ANSI escape codes: And then use them like this in your script: which prints love in red. From @james-lim’s comment, if you are using the echo command, be sure to use the …

How to change the output color of echo in Linux? Learn More
Linux / UNIX

How to recursively grep all directories and subdirectories?

The first parameter represents the regular expression to search for, while the second one represents the directory that should be searched. In this case, . means the current directory. Note: This works …

How to recursively grep all directories and subdirectories? Learn More
Linux

How to recursively grep all directories and subdirectories?

The first parameter represents the regular expression to search for, while the second one represents the directory that should be searched. In this case, . means the current directory. Note: This works …

How to recursively grep all directories and subdirectories? Learn More
How To / Linux

How to find all files containing specific text on Linux? [Answered]

Query explained: I’m trying to find a way to scan my entire Linux system for all files containing a specific string of text. Just to clarify, I’m looking for text …

How to find all files containing specific text on Linux? [Answered] Learn More
C/C++ / Linux

How to profile C++ code running on Linux? [Answered]

Query: I have a C++ application, running on Linux, which I’m in the process of optimizing. How can I pinpoint which areas of my code are running slowly? How to …

How to profile C++ code running on Linux? [Answered] Learn More
Linux

When should I wrap quotes around a shell variable? [Answered]

Sample problem: Should or should I not wrap quotes around variables in a shell script? For example, is the following correct: or And if so, why? Answer #1: General rule: …

When should I wrap quotes around a shell variable? [Answered] Learn More
Latest / Linux

Is Linux an Operating System?

This article answers one of the most asked questions, “Is Linux an operating system?”. Most of it is discussed in the history of Linux and UNIX, where I explained how …

Is Linux an Operating System? Learn More
Latest / Linux

Most useful examples of the touch command – Linux

You can change the modification time of a file without actually modifying anything in the file using the touch command. Use the -m option to set the modification time of the file to the current time. Also, if the file does not exist, it will create a new file with that name. And if you don’t want to create a new file, use

Most useful examples of the touch command – Linux Learn More
FEATURED / Latest / Linux

From UNIX to Linux – History of Linux

You’ve probably heard about Linux or at least the word Linux. You might even know it’s an operating system, in fact, it’s the kernel used at the heart of the …

From UNIX to Linux – History of Linux Learn More
How To / Linux

Install Ant Theme on Ubuntu: Create a beautiful Ubuntu desktop

Ant Theme is a flat GTK theme which comes with three beautiful variants: 1. Ant – light, with red highlight. 2. Ant Dracula – dark, with pink highlight and green …

Install Ant Theme on Ubuntu: Create a beautiful Ubuntu desktop Learn More

Posts navigation

Previous 1 2 3 Next

Featured Posts

From UNIX to Linux – History of Linux

21st November 202010th September 2022

Best themes for Ubuntu: Make Ubuntu Beautiful

20th October 202010th September 2022

Strings in Python

12th September 202010th September 2022

Is Python hard to learn? Top best learning resources

18th April 202010th September 2022

Recent posts

  • How to pad a string with zeroes to the left?
  • What is the difference between process and thread?
  • How to generate a random alpha-numeric string in Java?
  • How to auto-resize an image to fit a ‘div’ container?
  • How to get a Docker container’s IP address from the host?
  • How to display a JavaScript object?
Copyright © 2023 Programming Articles.
Powered by WordPress and HitMag.