The Baeldung logo
  • The Baeldung LogoLinux Sublogo
  • Start Here
  • Write for Baeldung
  • About ▼▲
    • Full Archive

      The high level overview of all the articles on the site.

    • About Baeldung

      About Baeldung.

Files

Files are the basic building block for everything in Linux. Learn about some basics of working with files including viewing, searching, and editing.

  • find (61)
  • awk (60)
  • sed (53)
  • grep (44)
  • vim (33)
  • ls (24)
  • cat (22)
  • rsync (19)
  • file (14)
  • vi (14)
  • head (13)
  • tr (13)
  • sort (11)
  • tar (11)
  • echo (11)
  • tail (11)
  • bash (10)
  • mv (10)
  • chmod (10)
  • diff (10)
  • xargs (10)
  • cp (9)
  • rm (9)
  • tree (9)
  • ffmpeg (8)
  • readlink (7)
  • touch (7)
  • perl (7)
  • less (7)
  • wc (7)
  • cut (7)
  • copy-edit (7)
  • uniq (6)
  • tee (6)
  • stat (5)
  • gzip (5)
  • rename (5)
  • comm (5)
  • printf (5)
  • paste (5)
  • chown (4)
  • pdf (4)
  • du (4)
  • unzip (4)
  • lsof (4)
  • Docker (4)
  • truncate (4)
  • mkdir (4)
  • reference (4)
  • curl (3)
  • scp (3)
  • ln (3)
  • basename (3)
  • Shell (3)
  • Globbing (3)
  • realpath (3)
  • convert (3)
  • xml (3)
  • xmllint (3)
  • split (3)
  • dd (3)
  • ImageMagick (3)

>> How to Find the “n” Most Frequent Words in a File

>> Downloading All Files From an FTP Server

>> Is It Safe to Clear the /tmp Temporary Directory?

>> How to Find Lines Exceeding a Certain Length in a File

>> Finding Strings From Binary Files in Linux

>> The Differences Between BRE, ERE, and PCRE Syntax in Linux

>> Guide to Passing Bash Variables to jq

>> Transposing a File From the Command Line

>> How to Get Octal File Permissions From the Command Line

>> How to Check Whether a File Is Compressed in Linux

>> How to Transfer a File From Windows to Linux

>> Flattening a Nested Directory in Linux

>> Symbolic and Hard Link Modification and Ownership Changes

>> Absolute and Relative Symlinks and Moving a Relative Symbolic Link

>> Do File Extensions Have a Meaning in Linux?

>> Appending Text to a File Without Using I/O Redirection

>> How to Rename Multiple Files in Linux by Removing the Extension

>> Fine-Tuning and Parameterization of FFmpeg Render Process

>> How to Make a File Unmodifiable in Linux

>> Finding Unique Text Between Two Files

>> Separate Home Partition – Pros and Cons

>> Show Surrounding Lines Using Grep Command in Linux

>> Insert Newline without Leaving Normal Mode in Vim

>> How to Extract the Base Filename From a URL in Shell

>> What’s the Purpose of the -f Option in the rm Command

>> Insert Text at the End of a Group of Lines Using Vim

>> How to Safely Move /tmp to a Different Partition

>> How to Find Files by the Length of the Filename

>> Limiting the Output of grep

>> Extracting Album Covers from Audio Files in Linux using EyeD3

>> How to Setup Search Indexing for an Entire Linux System

>> Enable Confirmation Alert When Removing Files and Directories

>> Breadth-First Search in a Directory

>> How to Find All Files Containing a Specific Text Pattern

>> Placing Files in RAM in Linux

>> Finding my.cnf From the Command Line

>> Resolving the “Clock skew detected” Warning When Using make

>> Encrypted Remote Backups via rsync

>> Deleting Files Based on Their Sizes

>> How to grep Without Leading Whitespaces

>> Opening PDF Files From the Command Line

>> Guide to Removing Trailing Newline From grep Output

>> How to Embed Subtitles into a Video Using FFmpeg

>> Copying Files Based on Modification Date in Linux

>> Exclusion of a Specific Directory While Using ls Command

>> Line Endings and Resolving the configure: /bin/sh: bad interpreter Error

>> Replacing Specific Line With a String Variable in Shell

>> Matching Multiple Strings Using Only One grep

>> List Files in Linux With the Full Path

>> Displaying Tabs as Characters in Vim

>> Saving and Restoring Vim Sessions

>> Returning Filenames Without Extension Using find

>> Parallel Archiving Files in Linux

>> How to Sum Up the Size of Files Listed

>> Path of Bash Script From Symbolic Link

>> How to Check PDF Metadata in the Linux Terminal

>> How to Clear Word Highlighting in Vim

>> Character Navigation or How to Jump to a Specific Character in Vi

>> PDF Tools and How to View and Edit the Code of a PDF File in Linux

>> How to Split a Text File Based on a Regular Expression

>> Add Indentation and Guides to Vim’s Edit View

>> Idling and Dummy Executable Files that Do Nothing in Linux

>> Find Statistics on File Types Recursively in a Directory

>> What Is an ELF File?

>> Convert INI File Into a Bash Array

>> Force Edit and Save of Opened File Without Permissions in Vi

>> Changing Indentation Size in Vi

>> Comparing Directory Structure Without Comparing Files

>> Make Git Ignore File Mode Change

>> Fixing File Permissions in a Directory Recursively

>> How to Delete Files With Names That Contain Non-printable Characters

>> Navigating in a File in Vim

>> Vi Automatic Commands and Reloading the Current File Contents

>> What Is the /dev/mem File?

>> Listing Symbolic Link Chains

>> Unzip Files Bigger Than 4GB

>> Command-Line Tools for Printing a Blank Line Between Lines of a Text File

>> Determine if a File Write Is in Progress

>> Editing MP3 Tags on Linux

>> Setup a Ruler on a Specific Column in Vim

>> Output a List of Changed Files From rsync

>> Continuously Sync Files One-Way on Linux

>> Configuration of Temporary Files with systemd-tmpfiles

>> Portable Ways to Get File Size in Bytes

>> Stripping Leading and Trailing Whitespaces From All Lines in a File in Vim

>> Use grep to Show Only Filenames on Linux

>> Displaying the Full Path of the Current File in Vim

>> Efficiently Editing HTML/XML Files in Vim

>> How to View .HEIC Photos on Linux

>> Indenting and Turning Off Auto Indent When Pasting Text Into Vi

>> Autocompletion Support in Vim

>> How to Count Words in a File

>> How to Find a User That Deleted a File on Linux

>> Installing Vim/NeoVim Plugins

>> How to Work With Multipart Zip Archives and Split Files?

>> Editing Multiple Files in Vim

>> Integrate GDB With Vim

>> Select All Contents in a File Inside Vim

>> How to Create a Random Human-Readable Text File in Linux

>> Explanation of the Archive Mode in rsync

>> Find and Remove Large Files That Are Open but Have Been Deleted

>> How to Replace the Nth Occurrence of a String Using sed

>> Show Special Characters in Linux with less

>> List Only Non-Empty Files in Linux

>> Share Config Between Vim and Neovim

>> How to Find File Encoding in Linux

>> Override CMD When Running a Docker Image

>> Create a GIF Animation From PNG Files

>> How to Automate HTML-to-PDF Conversions

>> Why Should Text Files End With a Newline in Linux?

>> Decompressing a BZ2 Compressed Archive on Linux

>> Purpose of Swap Files in Vim

>> Playing Audio Files From the Linux Command Line

>> How is NeoVim Different From Vim?

>> Wipe Free Space in Linux

>> Merging .csv Files in Linux

>> Using Vim as a Diff Tool

>> How to Password Protect a TAR File

>> Limits on the Number of Linux File Descriptors

>> Waiting for a File in a Shell Script

>> How to Read Corresponding Lines From Two Input Files

>> Execute a Command Whenever File or Directory Changes

>> How to Ignore File Properties When Using rsync

>> Convert Binary Data to Hexadecimal

>> Remove Duplicate Lines from a File Without Sorting

>> Using rsync to Transfer Files

>> Processing YAML Content With yq

>> Why Looping Over find’s Output Is a Bad Practice

>> Concatenating Videos Using FFmpeg

>> Working With Vim Windows

>> Write to a Text File in Bash

>> How Do Permissions Apply to Symbolic Links?

>> Comparing Binary Files Under Linux

>> Adding a Column of Values in a Tab Delimited File in Linux

>> Count Occurrences of Character per Line/Field on Linux

>> Delete All Files in a Directory Except Some

>> What Is /dev/sda in Linux?

>> Monitoring Linux File Access With auditd

>> Reading a File Line by Line in Bash Script

>> Copying Symbolic Links With rsync

>> Search and Replace in Vim

>> Resume Copying Files in Linux

>> Convert Tab-Delimited File to CSV

>> Rotating Videos Using FFmpeg

>> Checking if a File is Executable in Bash

>> Running a Script That’s Not Executable

>> Differences Between vi and vim Editors

>> How to Convert Videos to GIFs Using FFmpeg

>> Using grep While Excluding Binary Files

>> Extracting Audio From Video Files Using FFmpeg

>> Where Do Files Go When the rm Command Is Issued?

>> Batch Converting Image Formats on Linux

>> Quickly Clear the Contents of a File in Linux

>> Script That Counts Files Then Removes the Oldest Ones

>> Save a File in Vim

>> How to Extract IPv4 Addresses from Files in Linux

>> Put an Item at the End of an Alphabetic List in Linux

>> How to grep Hidden Files and Directories

>> Using the tail Command with Colored Output

>> Add Leading Zeros to File Names

>> Find Matching Text and Replace the Next Line

>> Difference Between awk, nawk, gawk and mawk

>> Using Iconv to Convert From UTF-16LE to UTF-8

>> Comparing Words in Two Files in Linux

>> Extract Duration From Video File in Linux

>> How to Exclude Files and Directories When Creating a tar.gz File

>> Using grep After a Specified Line Number

>> Find Files Lacking Certain Permissions

>> How to Specify More Spaces as the Delimiter Using cut

>> How Do I Use mktemp?

>> Suppress Echo of Command Invocation in a Makefile

>> List Files in a Zip Archive Without Decompressing

>> Removing a Trailing Newline From a File

>> Delete Selected Text in the Vi Editor

>> Why Is \d Not Supported by grep’s Regex

>> Using “/” in a Filename in Linux

>> Moving Files in Linux While Showing Progress

>> Get the Most Recent File in a Directory

>> Efficiently Delete a Large Directory in Linux

>> Search Contents of Multiple PDF Files

>> Concatenate Files With a Separator

>> Use grep to Find Content in Files and Move Matched Files

>> Link All Files from One Directory to Another in Linux

>> Compress Files Using Data from stdin

>> How to Encrypt a Large File with OpenSSL

>> grep in a tar.gz Archive

>> How to Swap Two Files in the Linux Command Line

>> How to Write Stdout to a File with Colors

>> Renaming All Folders and Files to Lowercase in Linux

>> Synchronize Linux Directories in Both Directions

>> How to Find Non-ASCII Characters in Text Files in Linux

>> Recover Lost and Deleted Data in Linux

>> Convert Symlink To Regular File On Linux

>> xmllint in Linux

>> Merge PDF Files in Bash

>> Creating a Hex Dump of a File

>> How to Write Bash Variable Contents to a File

>> File Ownership Inside Docker Container

>> Text Objects in Vim

>> Pasting Text in Vim

>> Search for a Multi-Line Pattern in a File in Linux

>> Delete Zero-Byte Files in Linux

>> Create a Directory and Set Permissions in a Single Command

>> Show Only the N-th Line After the Match

>> Linux tar Command – Archiving Files Without the Directory Structure

>> Get File Creation Date/Time In Bash

>> Configuration Files in Linux

>> How to Redirect Command Output in Docker

>> Solving The “Cannot Open Shared Object File: No Such File Or Directory” Error In Linux

>> How to Edit Binary Files on Linux

>> How to Add a String After Each Line in a File in Linux

>> tar Files of Certain Types

>> Linux Find Command With Regular Expressions

>> How to Run Bash Commands From a Text File

>> How to Check if a File Type Exists in a Directory

>> Get the Full Path of a File in Linux

>> Diff a Directory for Only Files of a Specific Type

>> Limit on File Name Length in Bash

>> Fixing the “Too many open files” Error in Linux

>> Skip Hidden Files and Directories During Recursive Copy

>> Check if a Library is 32-Bit or 64-Bit

>> How to List Last Five Modified Files in Linux

>> Get Unique Values from an Array in Bash

>> Monitor a Directory Tree for Changes

>> List One Filename Per Line in Linux

>> Count the Number of Directories in a Specific Directory

>> Change Permissions for a Folder and All Its Content in Linux

>> Create Linux Folder Path and File in One Command

>> Insert a Line With Spaces Using sed

>> Finding Files by Name and Extension

>> Looping Through the Content of a File in Bash

>> Comparing Two Files in Linux

>> Adding an Extension to Files With Bash

>> Get the Last Word From Each Line

>> Removing the Last Character of a File

>> The Last Modification Time of a Directory

>> Merge Two Files Line By Line in Linux

>> Insert Multiple Lines Into a File After a Specified Pattern

>> Sorting a File in-Place in the Linux Terminal

>> Working With Large Files in Linux

>> Split a File With the Header Line

>> Concatenation of Multiple Gzip Files

>> How to Base64 Encode an Image in Linux

>> Remove All Whitespace Characters From a Text File

>> Display the First “n” Characters of a File in Linux

>> Replacing Spaces from Filenames in Linux

>> Guide to Desktop Entry Files in Linux

>> Exclude Certain Paths With the find Command

>> Find Out Image Dimensions from the Linux Terminal

>> When and How to Use the dd Command

>> Run vi Editor Inside Docker Container

>> Cutting Videos Based on Start and End Time using FFmpeg

>> View Images from the Terminal in Linux

>> Linux: Delete Files Listed in a File

>> How To Find Only Text Files in a Directory in Linux

>> Delete All Lines in a File Starting From a Specific Line

>> Count All The Lines of Code in Directory

>> Escape Double Quote In Grep

>> Downloading a Tarball from GitHub

>> Replace String in a Large One Line, Text File in Linux

>> Read a Specific Line From a File in Linux

>> Get the Last Directory or Filename From a File Path

>> Delete Empty Files and Directories in Linux

>> Zip: Avoiding Unwanted Directories

>> Linux Shell File Protection

>> Move All Files Except One

>> Count Occurrences of a Char in a Text File in Linux

>> Manipulating Images With ImageMagick Command-Line Tools

>> Count Lines in a File in Bash

>> Create a File of a Certain Size in Linux

>> What Happens to Open File Handle if File Is Moved or Deleted

>> How to Copy a Directory to an Existing Directory in Linux

>> Why Do We Use ./ (Dot Slash) To Execute a File in Linux

>> Redirect Output to Location With “Permission denied” Error

>> Working With Zip Command in Linux

>> Remove the Last Character From Each Line in Linux

>> How To Compare Two Directories on Linux

>> The “Argument List Too Long” Error in Linux Commands

>> Exclude Directories With grep

>> List the Size of Each File and Directory, and Sort by Size in Linux

>> Remote File Synchronization in Linux

>> Find and Delete Files and Directories

>> Using grep on Files That Match Specific Criteria

>> Iterate Over a List of Files With Spaces in Their Names in Linux

>> File Editing: Appending a Non-Existent Line to a File

>> Find Files Not Owned by a Specific User in Linux

>> Find and Convert Files Ending With CRLF

>> Introduction to Bash Globbing

>> sed Substitution With Variables

>> Evaluate XPath in the Linux Command Line

>> Remove the First Line of a Text File in Linux

>> Calculate an MD5 Checksum of a Directory in Linux

>> Filtering Files Copied When Using rsync

>> Using Vim Registers

>> Using the find -exec Command Option

>> How to Remove the Lines Which Appear in File B From Another File A in Linux

>> fd: An Alternative to the Linux find Command

>> Search Within Specific File Types Using grep

>> Displaying Files Side by Side in Linux

>> Extracting a WAR File in Linux

>> Remove the Last N Lines of a File in Linux

>> How to Parse a CSV File in Bash

>> Move All Files Including Hidden Files Into Parent Directory

>> What is a .pid File?

>> Creating a Temporary File in Linux

>> Splitting a File at Given Line Numbers

>> How to Insert a Line at Specific Line Number

>> Remove Line Endings From a File

>> Count Duplicated Lines in a Text File

>> How to Append the Contents of Multiple Files Into One File

>> Recursive Search and Replace in Text Files

>> Recursively List All Files in a Directory Including Symlinks

>> Copy Directory Recursively, Excluding Some Subdirectories

>> Generating an SHA-256 Hash From the Command Line

>> Fastest Method to Check If Two Files Have the Same Contents

>> How to Print the Longest Line(s) in a File

>> Linux comm Command

>> Using sed to Replace a Multi-Line String

>> Linux Commands – Remove All Text After X

>> How to Pretty-Print XML From the Command Line

>> How to Delete a File Whose Name Begins With “-“

>> Using xz Compression in Linux

>> Difference between /dev/console, /dev/tty, and /dev/tty0

>> Empty the Contents of a File

>> Directory Navigation Using the pushd and popd Commands

>> Read Random Line From a File in Linux

>> How to Randomize Lines in a File in Linux

>> Delete Lines in a Text File That Contain a Specific String

>> How to Reverse the Order of Lines in a File in Linux

>> How Do so (Shared Object) Filenames Work?

>> Using gzip and gunzip in Linux

>> Introduction to the tee Command

>> Guide to the chgrp Command

>> Remove Blank Lines From a File

>> How to Count the Number of Files in Linux

>> Decompressing Files in Linux with Gunzip

>> Guide to the vi Editor

>> Print Linux Directory Structure as a Tree

>> Process Multiple Input Files Using Awk

>> The uniq Command in Linux

>> Linux Files Series

>> Linking to Files in Linux

>> diff Command in Linux

>> Linux tar Command

>> Transfer Files Between Linux Machines Over SSH

>> Guide to the Linux touch Command

>> The head and tail commands in LINUX

>> Soft-Delete Files from the Terminal

>> Guide to the Linux wc Command

>> Linux sort Command

>> How to Find and Replace Text in a File

>> Advanced File Permissions in Linux

>> Linux tr Command

>> Recursively Deleting Files With a Specific Extension

>> Introduction to File Locking in Linux

>> Finding Duplicate Files in Unix

>> Introduction to File MIME Types

>> Working with Hidden Files in Linux

>> How do I Zip/Unzip on the Unix Command Line?

>> Renaming Linux Files in Batches

>> Modify Files in Linux using vi, nano or emacs

>> Differences Between more, less, and most in Linux

>> Linux Commands for Appending Multiple Lines to a File

>> Viewing Files in Linux Using cat, more, and less

>> Guide to Useful File Manipulation Commands

>> Encrypting and Decrypting Files in Linux

>> Difference Between sort | uniq and sort -u

>> Guide to the Linux find Command

>> Setting Permissions with chown and chmod

>> Concatenating Files in Linux

>> Linux Commands – Find Broken Symlinks

>> Splitting Files in Unix Systems

>> Common Linux Text Search

>> Copying in Linux with Visual Progress

>> Manipulating Strings in Linux with tr

>> Copy a File to Multiple Directories on Linux

>> Getting the Absolute Directory of a File in Linux

>> Concatenating Text Files into a Single File in Linux

>> Append Lines to a File in Linux

>> Linux Commands – Delete Files Older Than X

>> Find Files That Have Been Modified Recently in Linux

  • ↑ Back to Top
The Baeldung logo

Categories

  • Administration
  • Files
  • Filesystems
  • Installation
  • Networking
  • Processes
  • Scripting
  • Search
  • Security
  • Web

Series

  • Linux Administration
  • Linux Files
  • Linux Processes

About

  • About Baeldung
  • The Full Archive
  • Write for Baeldung
  • Editors
  • Terms of Service
  • Privacy Policy
  • Company Info
  • Contact
The Baeldung Logo