Managing File Timestamps and Generating Fixed-Size Files in Linux
Setting File Modification Time
The stat command displays detailed timestamp information for a file:
stat /opt/test.conf
To create a file or update its modification time, use touch with the -m and -d options:
# Create or update modification time to July 7, 2020
touch -m -d "2020-07-07 00:00" /opt/abc.txt
If the file doesn’t exist, it ...
Posted on Mon, 14 Sep 2026 16:49:46 +0000 by ChetUbetcha
Redis Implementation Strategies for User Data and File Management in RAG Systems
Caching User Organizational Affiliations
User organization labels represent frequently accessed data, making them ideal candidates for Redis caching. The List data structure is preferred over Set for this use case due to its underlying implementation combining compressed lists with doubly-linked lists, which provides better memory efficiency a ...
Posted on Sat, 12 Sep 2026 16:53:47 +0000 by GetReady
Linux Command Line Fundamentals: A Comprehensive Reference
Linux Directory Structure
The root directory (/) is the top-level directory in Linux. Unlike some operating systems, Linux has only one top-level directory: the root directory. Path relationships are described using the / separator. For example, /home/user/file.txt indicates that there is a file named file.txt in the user directory within the h ...
Posted on Sat, 05 Sep 2026 16:15:08 +0000 by linkskywalker
Files and Directory Management in Linux
1. Linux File Attributes
In Linux systems, file and directory attributes include: inode, type, permission attributes, number of hard links, owner and group, and last modification time.
Execute ls -lhi command to view these attributes:
total 4.0K
24563 drwxr-xr-x 2 root root 4.0K Jun 28 21:30 123
6464 -rw-r--r-- ...
Posted on Sun, 19 Jul 2026 17:03:36 +0000 by amwd07
Essential Linux System Administration Commands
Disk Partition Analysis
To identify which partition a specific directory resides on, utilize the df command with the -h flag for human-readable output. For example, to determine the partition containing the /var directory:
[root@server ~]# df -h /var
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_system-lv_root 50G ...
Posted on Mon, 01 Jun 2026 17:47:32 +0000 by duelist
5 Methods to Clear File Contents in Linux
Using Standard Redirection
The most straightforward way to empty a file is by using the shell redirection operator > without a preceding command. This truncates the file to zero length immediately.
> server.log
Using the Colon or True Command
The : (colon) is a shell built-in command that does nothing and returns a success status ...
Posted on Sun, 17 May 2026 19:53:20 +0000 by TheMoose
Automating Duplicate File Management with Python
Automating Duplicate File Management with Python
When managing large collections of files, duplicates can accumulate and consume unnecessary storage space. This solution demonstrates how to use Python to automatically identify and relocate duplicate files to a designated directory.
Implementation Approach
The following Python script implemen ...
Posted on Sat, 16 May 2026 15:03:58 +0000 by lily
Essential Linux File Management Commands
Creating Files with touch
Syntax
touch [options] filename
Key Options
Option
Description
-m
Update modification timestamp
-d
Set specific datetime
Examples
# Create file in current directory
$ touch example.txt
# Create file with absolute path
$ touch /tmp/sample.txt
# Create multiple files
$ touch file1.txt file2.txt file3.txt
$ ...
Posted on Thu, 14 May 2026 23:14:51 +0000 by richinsc
Decoding PostgreSQL’s pg_filenode.map File Structure
Understanding OID to Filenode Mapping
In a standard PostgreSQL instance, each table and index corresponds to a physical file on disk. This relationship is primarily managed through the relfilenode identifier found in the pg_class catalog. For most user-defined tables, the Object Identifier (OID) aligns directly with this filenode value.
However ...
Posted on Sat, 09 May 2026 22:44:49 +0000 by hebisr
Linux File System Operations Reference
Data Replication, Transfer, and Removal
Replicating Data with cp
# Syntax
cp [options] source destination
cp [options] source... target_directory
# Options
-r, -R # Copy directories recursively
-i # Prompt before overwriting
-u # Copy only when the source is newer or destination is missing
-v # Verbose output
-p ...
Posted on Sat, 09 May 2026 15:00:52 +0000 by benjam