Rogue Security Wiki

Study notes covering Implementing File Management.

Author: Dylan Barrett

Date: 02/08/2026


📖 Useful Vocabulary / Acronyms

Terminology Definition
Distro's One of several fully functional operating systems and members of the Linux family that run on the Linux kernel, GNU software, and additional components
File System Hierarchy Standard (FHS) A set of guidelines for the names of files and directories and their locations on Linux systems
Path A Reference to a specific location on a file system
Absolute Path A reference to a specific location on a file system irrespective of the current working directory or combined paths
Relative Path A Reference to a specific location on a file system that is relative to the current working directory
Current Working Directory The Directory that the user is currently, accessing
inodes An object that stores metadata about a file or directory on a file system.
ext2 A non-journaled Linux Filesystem introduced in 1993, and now the filesystem on some flash storage media
ext3 Standard Linux file system that includes journaling and has since been replaced with ext4
ext4 One of the default file systems in modern Linux versions that supports journaling and large volumes
XFS One of the default file systems in modern Linux versions that supports journaling and efficiency in handling large files
Hard Link A reference to a file that enables a file's data to have multiple names on the same file system.
Symbolic Line A reference to a file or directory that can span multiple file systems
Present Working Direcotry The directory that the user is currently accessing

Introduction

Even though there are so many different Linux distros, they all usually share a common file structure. Such are the /etc, /home, /var/log, and more.

Standard Subdirectories

File Metadata

When you examine files, it is usually important to review the file's metadata, such as permissions, using stat and file.

File Naming Conventions

Absolute and Relative Paths

A path defines the series of directories to be traversed to find a specific file or subdirectory

Absolute Path

The Absolute Path defines all directories to traverse, starting from the root of the filesystem. The Files system root is depicted using the forward slash character

Relative Path

The Relative Path Depends on the user's current location in the Filesystem. If you were calling the file /home/yourusr/Documents/test.txt and you were already in your home direcotry you could just call the file with Documents/test.txt

File links can be used for files that are commonly accessed, to provide the user with a much easier way to call the file.

Index Nodes

File links rely on the inodes markers. An Index Node is an object that stores metadata about a file or directory on a file system.

# Create a Hard Link
ln /usr/share/wordlist/rockyou.txt /home/jsmith/rockyoulink.txt

# Create a Symbolic Link
ln -s /usr/share/wordlist/rockyou.txt /home/jsmith/rockyoulink.txt

Search Commands

Even though things are pretty well organized in Linux due to the FHS, users have plenty of file management options like mkdir, mv, grep, find, locate, and which

The Find Command

The locate and updateb command

The which command

File Manipulation Commands

echo

printf

tr

wc

sort

cut

paste

diff

sdiff

uniq

awk

sed

Apply File Management Commands

Directory Navigation

One of the most important things about Directory Navigation is understanding where you currently are, and you can achieve this with the pwd command.

Change Directories

Directory Modification

Identify Existing Directories

Create a directory structure

File relocation and Display

Copy Files

Move Files

Display file contents

Directory and File removal

There is no concept of a trash can in CLI; do not use these commands unless you are sure that you need to delete that file.

File Content Display Commands

The less and more commands

If you use cat to display the contents of a file, then there is a possibility that not all of the contents will fit on the page. You can get around this by using the less and more commands

The head and tail commands

String Display and searching

The grep command

While the head and tail commands allow you to see a particular part of a file, sometimes you need something more granular than this, and this is where the grep command comes in.

Redirectores

Text Streams

Redirection Operators

Command Modifiers

Background a command

Chain commands- Instead of just running one command at a time, you can run multiple

The tee command

The xargs command