Category: Linux
Change permissions for Directory & Sub-directories in Linux
In this article we will discuss different ways to change the permissions of a folder and all files or subdirectories inside it in Linux. Table Of Contents Introduction Permission Types Change permissions of a Directory & all files/sub-directories in it using chmod command: Example:1 Example:2 Find and Change Permissions of selected files/sub-directories inside a diretory …
Change permissions for Directory & Sub-directories in LinuxRead More
Recursively Count Files in a directory in Linux
In this article, we will learn to count files in a directory and in its sub directories recursively in Linux. Table Of Contents Introduction Using tree command Using the find and wc command Using locate command: Using rsync command Summary: Introduction Sometimes we come across a requirement to find the count of all files in …
Linux – Replace String in Files
We often come across a requirement to replace a string in a set of files. If we are using a windows environment, then doing it would be easy. Linux also provides some commands to search for a string in a file and replace all of them at once. We will look at multiple options that …
Compare two folders in Linux and find differences
In this article, we will learn how to compare two folders in Linux and find differences. Table Of Contents Using the diff command Using the meld tool Summary Using the diff command The diff is one of the most widely used Linux command to compare contents of two files. It compares the contents of the …
Exclude a directory when using “find” command in Linux
While managing the linux servers we need to use the find command for finding files and directories based on our use case. In this article we want to learn about how to exclude a directory or multiple directories while using find command. Table Of Contents Using the prune option in find command Using “! -path” …
Exclude a directory when using “find” command in LinuxRead More
Find files in directory by wildcard matching in Linux
In this article, we will learn how to find all files in a directory based on wildcard matching in Linux. Table Of Contents Introduction Finding files based on wildcard matching Example 1: Search for a file with specific Filename Example 2: Search for a file with specific pattern Example 3: Search for a file with …
Find files in directory by wildcard matching in LinuxRead More
When to wrap quotes around a shell variable in Linux?
Most of the programmers who are new to shell scripting and dealing with string variables, have a doubt regarding when they have to wrapquotes around a shell variable. In this article, we are going to perform some tests and try to understand when and where quotes around ashell variable are required. Table of Contents List …
When to wrap quotes around a shell variable in Linux?Read More
How to run Bash commands in Python?
Bash commands in Python can be a powerful tool for automating tasks such as setting up development environment and or deploying code to server, and also integrating different tools and languages. So, In this Python article, we will learn to run Bash commands in Python Programming language. But before that a quick introduction about bash …
Find Files by Extension in Linux
In this article, we will learn how to find files by extension in Linux. Table of Contents Find files by Extension recursively in Linux Examples of searching files by extension in Linux Find all “pdf” files in a specific folder Find Files by Extension in Current folder Summary Find files by Extension recursively in Linux …
Find Files by Name in Linux
In this article, we will discuss ways to find file by name recursively in Linux. Table of Contents Find file by name in a specified directory in Linux Find files by name in the current folder in Linux Summary Suppose you are using a Linux terminal and you need to search for a file you …