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 61 of 171
Linux last Command
The last command is a powerful Linux utility used to display a list of users who have previously logged in to the system. This command is especially useful for system administrators who need to track user activity and monitor login sessions on servers. The last command can display various information including login dates, session duration, and the terminal or device used to access the system. Syntax and Options The basic syntax of the last command is as follows − last [options] [username] Common options available with the last command include − ...
Read MoreWhat is a .pid File in Linux?
On Linux, a .pid file is a process identification (PID) file that stores the process ID of a running process. The PID is a unique number assigned to each process when it starts and serves as the process identifier within the operating system. These files are typically located in /var/run or /var/run/ directories and are named after the process they represent. What is a PID File? A PID file is a simple text file containing the process ID of a running process. It gets created when the process starts and is deleted when the process terminates. System administrators, ...
Read MoreHow to List All Connected SSH Sessions on Linux
Secure Shell (SSH) is a commonly used protocol for secure remote access to Linux servers. When multiple users are connected to a Linux server via SSH, it can be useful to list all connected SSH sessions for administrative or monitoring purposes. In this article, we will discuss how to list all connected SSH sessions on Linux using various command-line tools. Using the who Command The who command is a simple and widely available command-line tool for listing logged-in users on a Linux system. To list all connected SSH sessions, you can use the who -a command. The -a ...
Read MoreFind and Convert Files Ending With CRLF on Linux
You can use the find command in Linux to search for files ending with CRLF, and the dos2unix command to convert those files to use LF line endings. CRLF (Carriage Return + Line Feed) line endings are commonly used in Windows systems, while LF (Line Feed) endings are standard on Linux systems. Searching for Files With CRLF Endings The most efficient way to find files with CRLF line endings is using grep with the -r (recursive) and -l (list filenames only) options − grep -rl $'\r' /path/to/search This command searches recursively through the specified ...
Read MoreIntroduction to Bash Globbing on Linux
Bash globbing is the process of using wildcard characters to match multiple filenames or paths in the shell. Bash provides several special characters that can be used for globbing, such as *, ?, and []. This feature allows you to perform operations on multiple files without having to specify each filename individually. The * character is a wildcard that can match zero or more characters in a filename or path. For example, the command ls * would list all files in the current directory, while the command ls *.txt would list all files with the .txt extension in the ...
Read MoreExclude grep From ps Results on Linux
The ps command in Linux displays information about running processes on a system. It provides a snapshot of current processes, including process ID (PID), user ownership, CPU and memory usage, and the command that started the process. When using ps with grep to filter processes, the grep command itself often appears in the results, which can be unwanted. Common Problem with ps and grep When searching for specific processes using ps | grep, the grep command itself appears in the output because it's also a running process at that moment: $ ps aux | grep ssh ...
Read MoreHow to Check Logs Using journalctl in Linux
Logs are a crucial component of any Linux system, as they provide a record of system activity, including system events, user actions, and system processes. journalctl is a command-line utility for viewing and managing logs on Linux systems using the systemd initialization system. It provides powerful filtering and formatting capabilities to help administrators monitor system health and troubleshoot issues effectively. Basic journalctl Commands The journalctl command can view and filter system logs for all system services, the kernel, and specific services or users. It can display the entire journal, view logs from a specific boot, or filter logs ...
Read MoreHow to Calculate Optimal Blocksize to Use With dd in Linux
The optimal block size to use with the dd command in Linux depends on the specific use case and the hardware you are working with. However, as a general rule of thumb, it is best to use a block size that is a multiple of the disk's physical block size, as this can lead to better performance. Determining Physical Block Size To determine the physical block size of a disk, you can use several methods. The fdisk command with the -l option will list all partitions on the disk, along with the start and end cylinders, and the ...
Read MoreShowing a GUI Notification From a Shell Script in Linux
GUI notifications from shell scripts in Linux allow you to display visual alerts and messages to users. Two primary tools accomplish this: notify-send for desktop notifications and zenity for interactive dialog boxes. Using the notify-send Command The notify-send command is part of the libnotify library and comes pre-installed on most Linux distributions. It displays brief desktop notifications that appear in the system notification area. Basic Syntax notify-send [options] Simple example displaying a notification − notify-send "Hello" "World" Common Options Option Description Example Values ...
Read MoreRun a Java Application as a Service on Linux
Running a Java application as a service on Linux allows your application to start automatically at boot time, run in the background, and be managed using standard system commands. This approach ensures your Java applications remain running even after terminal sessions are closed and can be controlled through the system service manager. Understanding Linux Services A service (or daemon) in Linux is a background process that performs specific functions without direct user interaction. Services can be started automatically at boot time and controlled using command-line tools or system service managers like systemd or Upstart. To create a ...
Read More