Linux Basics – Listing and Navigating Directories (ls, cd, pwd, mkdir)

Introduction

Before you start working on RTL design or simulation tools like Synopsys VCS, Cadence Xcelium, or Mentor Questa, it’s essential to understand how to navigate Linux directories. Almost all EDA tools are command-line driven, and knowing these commands helps you manage design files efficiently.


1. Listing Files and Directories – ls

When you log in, you start in your home directory, typically named after your username.
To see what’s inside, use:

ls

This lists all visible files and folders in your current directory.

To view hidden files (those starting with a .), use:

ls -a

To show more details like permissions, size, and timestamp:

ls -l

To list files sorted by time (latest first):

ls -lt

To view the oldest first:

ls -lrt

2. Creating Directories – mkdir

You’ll often create directories for projects or testbenches.
For example, create one named unixstuff:

mkdir unixstuff

To confirm:

ls

Exercise: Create another directory inside it called backups.

cd unixstuff
mkdir backups

3. Changing Directories – cd

Move between directories using:

cd directory_name

Example:

cd unixstuff

To go back to the parent directory:

cd ..

To return to your home directory anytime:

cd ~

4. Displaying Pathname – pwd

To know your current location in the filesystem:

pwd

Example output:

/home/chetan/unixstuff

This is helpful when writing scripts or Makefiles for simulations.


5. Useful Shortcuts


6. Keyboard Shortcuts for Bash


Summary Table


Real-World Example

In a UVM verification project, you may have directories like:

Using cd and ls, you can quickly navigate between env and seq folders while debugging simulations.


Practice Task

  1. Create directories project, src, and tb inside your home folder.
  2. Use pwd to verify your path.
  3. Use ls -lrt to check creation order.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top