Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Operating System Articles
Page 83 of 171
How to find all the distinct file extensions in a folder hierarchy (Linux)?
Finding all distinct file extensions in a folder hierarchy is a common task in Linux system administration and file management. This operation requires combining several powerful Linux utilities to recursively traverse directories and extract unique file extensions. Required Linux Commands The two essential Linux utility commands for this task are − find − Locates files and directories recursively based on specified criteria sed − Stream editor used for text manipulation, searching, and pattern replacement Finding Extensions in a Single Directory For a single directory, you can iterate through files without using the find ...
Read MoreHow to increase the scrollback buffer in a running screen session on Linux?
Screen (also known as GNU Screen) is a terminal multiplexer that allows you to start a screen session and open multiple windows within that session. Processes running in Screen continue to execute even when their windows are not visible, making it ideal for long-running tasks and remote sessions. When working with Screen sessions, you may need to increase the scrollback buffer to view more historical output. The scrollback buffer stores previous terminal output that you can scroll back to review. Installing Linux Screen If Screen is not already installed on your Linux distribution, use one of the ...
Read MoreHow to list one filename per output line in Linux?
There are several Linux commands available to list files and directories. By default, the ls command displays output in multiple columns across the terminal width. However, there are various methods to format the output so that each filename appears on a separate line, which is useful for scripting and better readability. Default ls Command Behavior The standard ls command displays files and directories in a multi-column format: ls api cluster docs LICENSE Makefile.generated_files pkg staging vendor build cmd ...
Read MoreHow to send a file as an email attachment using the Linux command line?
In order to send a file as an attachment to an email using Linux, we can use command line email clients or the standard Linux mail command. This is particularly useful for automation, scripting, and server environments where GUI email clients are not available. There are multiple command line email clients available to achieve the attachment task, but the most common and widely used is mutt. Using Mutt Email Client Mutt is a command line based email client that allows us to send and read emails from command line in Linux based systems. It also supports important ...
Read MoreHow should strace be used on Linux?
strace is a powerful Linux utility that traces system calls and signals made by a process. It provides detailed insights into how programs interact with the kernel, making it essential for debugging, performance analysis, and understanding program behavior. The strace command intercepts and records all system calls made by a process, including file operations, memory allocation, network communication, and signal handling. This makes it invaluable for diagnosing issues, monitoring system activity, and learning how programs work internally. Installation Before using strace, install it on your system using the appropriate package manager − Ubuntu/Debian − ...
Read MoreHow to activate virtualenv on Linux?
A virtual environment is a tool that helps keep dependencies required by different projects in separate places. In Python, we commonly use the term venv to refer to virtual environments. This isolation prevents conflicts between different project dependencies and keeps your system Python installation clean. Python's venv module creates lightweight virtual environments with their own site directories, isolated from the system's site directories. Each virtual environment has its own Python binaries and can maintain its own set of installed packages independently. Creating a Virtual Environment To create a virtual environment, use the following command structure − ...
Read MoreHow to change the root directory of an Apache server on Linux?
Apache web server is one of the most widely used HTTP servers across all platforms, including Linux distributions and Windows. As an open-source server, Apache efficiently delivers web content and handles multiple concurrent requests. In this article, we'll explain how to change the DocumentRoot directory for your Apache web server on Linux systems. Understanding DocumentRoot The DocumentRoot is the directory from which Apache serves files to visitors accessing your website. By default, Apache typically uses one of these locations: /var/www/html Or alternatively: /var/www The exact default location depends on ...
Read MoreHow to check if a particular service is running on Ubuntu?
We know that we can make use of the top command to print all the processes that are running in the background. Though the top command is used to print the list of processes or threads that are currently managed by the Linux kernel, it is still not a convenient way to check if a particular service is running in the background or not. In order to understand how to check whether a particular service is running or not, we first must understand what a service actually means in Linux. A service is basically a process or group of ...
Read MoreHow to check the syntax of a Bash script without running it in Linux?
There are always chances that we will make some type of error whenever we are programming. Compilers and interpreters are always there to help us in these cases, but in order to use them we must run the program or some sort of an IDE that constantly checks for these errors and reminds us every time, so that we can correct them. What if we don't want to write our code in a fancy IDE and also don't want to run the program either, in that case we are left with very few options if any. In case you ...
Read MoreHow to compare the files available in two directories using diff command in Linux?
The diff command in Linux is a powerful tool for comparing files and directories. When working with two directories containing multiple files, diff helps identify which files are unique to each directory, which files are common, and what differences exist between files with the same name. Understanding the diff Command The diff command (short for difference) compares files line by line and can also compare entire directories. When comparing directories, it identifies files that exist in one directory but not the other, as well as files that differ in content. Example Setup Let's work with two ...
Read More