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
Linux Articles
Page 58 of 134
How to Repeat Your Last Command in Linux?
Linux terminal allows us to execute a variety of commands, and often we need to repeat a previously executed command. There are several efficient methods to recall and re-execute the last command without retyping it completely. For demonstration purposes, let's assume we previously ran the command ls -ltr and now want to repeat it using various methods available in Linux. Using Arrow Keys The most basic approach is to press the UP arrow key on your keyboard. This retrieves the last command from your command history, allowing you to press Enter to execute it again or modify ...
Read MoreHow to Find Out File Types in Linux
In Linux operating systems, everything is treated as a file. Understanding file types is crucial for system administration and file management. In UNIX systems, there are seven standard file types − Regular files − Contains data, text, or program instructions Directory files − Contains lists of other files and directories Symbolic link files − Points to another file or directory Character special files − Represents devices that transfer data character by character Block special files − Represents devices that transfer data in blocks Socket files − Used for inter-process communication FIFO (Named Pipe) files − Used for communication ...
Read MoreDifference between GNU and Unix
Even though the majority of us are accustomed to using Windows as our primary operating system, it is important for us to at least be familiar with other operating systems such as Unix, Linux, and others. This does not imply that Windows is the only operating system that has been used globally; rather, it indicates that other systems also take a larger proportion in terms of utilisation. The end functionality, which is using the computers to make our tasks easier, is the same regardless of the operating system that we might choose. Read through this article to find out ...
Read MoreGuide to Generate Random Numbers in Linux
In Linux, you can generate random numbers using several built-in methods and special files. Linux provides both pseudorandom and cryptographically secure random number generation through various commands and system interfaces. Understanding the differences between these methods helps you choose the right approach for your specific use case. $RANDOM in Bash The $RANDOM variable is a built-in Bash variable that generates pseudorandom numbers between 0 and 32767. This is the simplest method for basic random number generation in shell scripts. Basic Usage # Generate random number between 0-32767 echo $RANDOM # Generate random number in ...
Read MoreHow to Append Contents of Multiple Files Into One File on Linux?
There are many situations where you may need to combine the contents of multiple files into one file. For example, you may have a number of log files that need to be analyzed or you may want to merge multiple text documents into one document for easy editing. On Linux, there are several ways to append the contents of multiple files into a single file, and in this article, we'll explore some of the most popular and effective methods. Method 1: Using the cat Command The cat command is the most common and straightforward tool for concatenating files. ...
Read MoreGet the Contents of a Web Page in a Shell Variable on Linux
One of the most useful and powerful features of the Linux command line is the ability to manipulate text. This can be especially useful when working with web pages, as web page content can often be saved as plain text and then manipulated with command-line tools. In this article, we will explore how to store the content of a web page into a shell variable in Linux. What is a Shell Variable? A Shell variable is a value stored in memory that can be used by the shell (command-line interface) and other programs. Shell variables are usually defined ...
Read Morefd An Alternative to the Linux find Command
The fd command is a popular alternative to the find command in Linux. It is a faster and more user-friendly version of find, written in Rust for performance. Key features of fd include the ability to search using regular expressions, a more natural syntax for specifying search parameters, and the ability to search using specific file extensions or names. Installation The fd command can be installed on Linux and macOS using the package manager of your distribution. On Debian based distributions − sudo apt-get install fd-find On Fedora and CentOS − ...
Read MoreDisplaying Files Side by Side in Linux
Working with files on Linux often involves comparing or analyzing multiple files at once. A useful way to do this is to view the files side by side in the terminal, allowing for easy comparison and analysis. This article explores various methods to view files side-by-side on Linux, including the diff and sdiff commands, as well as text editors like vim and emacs. Using the diff Command The diff command is a standard Linux utility that compares two files and displays the differences between them. By default, it shows a unified diff format, but can display files side ...
Read MoreExtracting a WAR File in Linux
WAR (Web ARchive) files are compressed archives used to package Java web applications for deployment. Since WAR files are essentially ZIP archives with a .war extension, they can be extracted using standard Linux command-line tools. This article demonstrates how to extract WAR files on Linux using two primary methods. A WAR file contains all components needed for a web application, including HTML pages, CSS stylesheets, JavaScript files, Java classes, configuration files, and libraries. Extracting these files allows developers to inspect, modify, or troubleshoot web applications. Prerequisites Before extracting WAR files, ensure you have the following tools installed ...
Read MoreRemove the Last N Lines of a File in Linux
There may be times when you need to remove the last few lines of a file on Linux. For example, you may have a log file that is constantly being added and you want to keep only the most recent entries. In this tutorial, we'll explore different methods to remove the last N lines of a file on Linux. Use the head Command The head command can display the beginning of a file. By using the -n option with a negative number, we can exclude the last N lines from the output. To remove the last N ...
Read More