LogoLogo
  • Welcome
  • Explorers
    • Aptos Explorer
    • Cosmos Explorer
  • Blockchains
    • Aptos
      • Run a Validator and VFN
        • Operator
        • Node Requirements
        • Deploy Nodes
          • Using Source Code
        • Connect Nodes
          • Connect to a Network
          • Staking Pool Operations
          • Delegation Pool Operations
          • Staking Pool Voter
        • Verify Nodes
          • Node Health
          • Validator Leaderboard
        • Modify Nodes
          • Upgrade Nodes
          • Shutdown Nodes
      • Run a Public Fullnode
        • PFN Requirements
        • Deploy a PFN
          • Deploy a PFN using Source Code
        • Verify a PFN
        • Modify a PFN
          • Customize PFN Networks
          • Generate a PFN Identity
          • Upgrade your PFN
          • Run a PFN from Source Code
      • Bootstrap a Node with historical data
        • Bootstrap from a Backup
        • Bootstrap from a Snapshot
      • Configure a Node
        • State Synchronization
        • Data Pruning
        • Telemetry
        • Locating Node Files
          • Files For Mainnet
          • Files For Testnet
          • Files For Devnet
      • Monitor your Nodes
        • Important Node Metrics
        • Node Health Checker
        • Node Health Checker FAQ
        • Node Inspection Service
      • Building Aptos From Source
      • Aptos Networks
    • Berachain V2
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • gRPC Endpoint
      • Live Peers
      • Forest Staking Peer
      • Performance Optimizer Script
      • Discord & TG Alert System
      • RPC Load Balancer Setup
    • Casper
      • Explorer
    • Haqq
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • Live Peers
      • Forest Staking Peer
    • Mantra
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • Live Peers
      • Forest Staking Peer
    • Ika
    • Story Protocol
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • EVM Endpoint
      • Websocket
      • WSS
      • Discord & TG Alert System
      • RPC Load Balancer
      • Performance Optimizer Script
      • Live Peers
      • Forest Staking Peer
    • Supra
      • Explorer
      • Oracle data
    • Showdown
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • Live Peers
      • Forest Staking Peer
    • Soarchain
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • Live Peers
      • Forest Staking Peer
    • Zenrock
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • Live Peers
      • Forest Staking Peer
    • Zetachain
      • Node Snapshot
      • Explorer
      • AddrBook File
      • Genesis File
      • API Endpoint
      • RPC Endpoint
      • Live Peers
      • Forest Staking Peer
    • Airchains
      • Node Snapshot
      • Explorer
  • Gunzilla - Off The Grid
    • Vision and Foundation
    • Gunzilla Hacker Dashboard
      • Key Features of the Hackers Dashboard
        • Wallet Integration and Testnet Access
        • License System with Rarity Tiers
        • Decoding Stats and Hash Power Tracking
        • Marketplace for Trading Licenses and Assets
        • Scanner Tool for Blockchain Transparency
        • Social Media Integration and Community Engagement
      • Mastering the Hackers Dashboard
      • Benefits of the Hackers Dashboard
    • Gunzilla Token Page
  • Forest Esports Team
    • Forest Hexers
  • Crypto Tools & Analytics
    • Top 10 Crypto Exchanges
      • Binance
      • Coinbase
      • Kraken
      • Bybit
      • OKX
      • KuCoin
      • Bitfinex
      • Gemini
      • Crypto.com
      • Bitstamp
    • Top 10 Wallets
      • Ledger Nano X
      • Trezor Model T
      • Exodus
      • Coinbase Wallet
      • Trust Wallet
      • MetaMask
      • Crypto.com DeFi Wallet
      • ZenGo
      • Atomic Wallet
      • SafePal
  • Top 10 Crypto Data Platforms
    • CoinMarketCap
    • CoinGecko
    • CryptoCompare
    • CoinCodex
    • Live Coin Watch
    • CoinCheckup
    • Messari
    • CoinPaprika
    • Arkham Intelligence
  • DeFi Analytics and Tracking
    • DefiLlama
    • Dune Analytics
    • DeBank
    • Zapper
    • Token Terminal
    • DeepDAO
    • Revert Finance
    • L2BEAT
  • API's
    • What are APIs?
    • How APIs Work
    • Types of APIs
    • Real-World API Use Cases
    • Benefits of Using API's
    • Challenges and Considerations of using API's
  • Node Security
    • Physical Security
    • Network Security
    • System and Software Security
    • Access Control
    • Data Security
    • Monitoring and Logging
    • Backup and Disaster Recovery
    • Best Practices for Validator Nodes
    • Cloud Security
    • Incident Response and Recovery
  • Linux Bash
    • Bash 101
      • Getting Started with Bash
      • Navigating the File System
      • File Management Basics
      • Viewing and Editing Files
      • Managing Permissions
      • Working with Processes
      • Using Pipes and Redirection
      • Bash Scripting Basics
      • Essential Networking Commands
      • Installing Software with Package Managers
    • Advanced Linux for Validator Nodes
      • Advanced Bash Scripting for Node Automation and Maintenance
      • Monitoring and Logging Essentials
      • Networking and Security Best Practices
      • Backup and Disaster Recovery
  • Staking 101
    • Understand What Staking Is and How It Works
    • Choose a Blockchain Network to Stake On
    • Set Up a Compatible Wallet for Staking
    • Purchase or Transfer Funds for Staking
    • Choose a Staking Pool
    • Connect Your Wallet to a Staking Platform
    • Confirm and Stake Your Funds
    • Monitor Staking Rewards and Performance
    • Withdraw or Re-Stake Rewards
  • Optimizing Your Infrastructure Choices
    • Infrastructure Comparison: VPS vs. Bare Metal
Powered by GitBook
On this page

Was this helpful?

  1. Linux Bash
  2. Bash 101

Navigating the File System

Navigating the Linux file system is one of the first essential skills to learn in Bash. It lets you move between directories, list files, and understand where you are within the system hierarchy. The Linux file system is organized in a tree-like structure, with directories nested within one another starting from the root directory /. Using commands like pwd, ls, and cd allows you to explore and manage this structure efficiently.


1. pwd – Print Working Directory

The pwd (Print Working Directory) command displays your current directory location in the file system. This is particularly helpful when working in multiple directories or deep within nested folders. When you type pwd and press Enter, the terminal will output the full path to your current location, for example:

$ pwd
/home/username/Documents

This command confirms precisely where you are, which helps ensure you’re in the right place before executing commands that could impact files or directories. It’s a simple but essential way to maintain orientation within the file system.


2. ls – List Files and Directories

The ls command lists the contents of the current directory, showing files and subdirectories. By default, ls only displays the names of visible files and directories in a single, concise format. However, it has numerous options to modify the output, allowing you to get detailed information or include hidden files.

  • Basic Usage:

    $ ls
    file1.txt  file2.txt  folder1  folder2

    This basic output lists all visible files and directories in the current location.

  • Detailed Listing with -l Option:

    $ ls -l
    -rw-r--r--  1 username  users  1024 Jan 1 10:00 file1.txt
    drwxr-xr-x  2 username  users  4096 Jan 1 10:00 folder1

    The -l option provides detailed information for each item, including permissions, owner, group, size, and modification date. This is invaluable for managing files, as it helps you quickly check file sizes, permissions, and dates.

  • Show Hidden Files with -a Option:

    $ ls -a
    .  ..  .hiddenfile  file1.txt  folder1

    In Linux, files starting with a dot (.) are hidden by default. The -a option lists all files, including hidden ones. This is useful when working with configuration files, often hidden by default.


3. cd – Change Directory

The cd (Change Directory) command navigates between directories in the Linux file system. By typing cd followed by the directory's path, you move from your current location to the specified location. Here’s how to use it:

  • Basic Navigation:

    $ cd /home/username/Documents

    This command takes you directly to the /home/username/Documents directory. Using absolute paths (starting from /) lets you move to any directory, regardless of your current location.

  • Relative Navigation:

    • cd folder1 – Moves to a subdirectory folder1 within the current directory.

    • cd .. – Moves up one level to the parent directory.

    • cd ../folder2 – Moves up one level to the parent directory, then into folder2.

Relative paths let you navigate quickly without typing full directory paths, which is especially useful when working in nested directories.

  • Returning to the Home Directory:

    $ cd ~

    Typing cd alone or cd ~ returns you to your home directory, where personal files and configurations are usually stored. You can also use ~ to refer to the home directory in other commands, like ls ~/Documents to list files in the Documents folder.

  • Returning to the Previous Directory:

    $ cd -

    Using cd - switches back to the last directory you were in, which is useful when you need to alternate between two locations quickly.


PreviousGetting Started with BashNextFile Management Basics

Last updated 6 months ago

Was this helpful?

Page cover image