• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / How To / How To Open A Text File From Terminal On Ubuntu Linux

How To Open A Text File From Terminal On Ubuntu Linux

By Sourabh / December 9, 2025 Category: How To, Ubuntu

Want to view file in Linux command? Yes! Here’s how to open a text file in a directory in Linux terminal. You can easily open file in text editor from terminal on Ubuntu Linux Systems.

How To Open A Text File From Terminal On Ubuntu Linux

Here is how to open file from terminal Ubuntu or open folder from terminal Ubuntu.

Open folder/directory from Ubuntu Terminal

You can open the folder/directory from Ubuntu terminal using cd command. The cd or change directory command allows you to change your directory, or in other words, open a new folder.

Note that when you open the Terminal, you are in your home directory. The following command will help you in opening the folder of your choice:

cd /path/to/file

To open a directory in a terminal, you use the cd command to change your current directory. This essentially opens that folder and places you in it.

Using cd command alone with no arguments, takes you back home (it takes you out from the folder).

It must be known to all that the tilde symbol (~) represents our home directory. You can use this symbol in the cd command to move to a folder in your /home/[user]/ directory.

You must note that the pwd command can be used to know the current directory. The pwd command stands for print working directory. If you want to know the exact directory path where you are currently. Simply run the pwd command to do so.

Using cd Command

  • The / symbol with the cd command helps you in directly opening the root folder.
  • The ‘..’ symbol with the cd command helps you in navigating up one directory level:
  • The ‘-’ symbol with the cd command takes you in back to the previous folder you were in.

How To Open A File In Ubuntu Terminal

Once you have located the desired file to to open; to open a file in a directory in Linux terminal command, you can use any of the following commands:

  1. Using cat command.
  2. Using less command.
  3. Using more command.
  4. Open File Using cat Command

To open the file in terminal using cat command, execute the cat command as follows:

cat Filename
  1. Open File Using less Command

The less command also shows you the content of the file, but it allows you to view one page at a time. You can execute the less command as:

less Test.txt

It must be noted that when you execute the above command it will display the file content as a page at a time. To exit from the less command, press the ‘q’ key.

  1. Open File Using more Command

To display the display the file content as the width of the terminal, you can use the more command.The command can be executed in the following manner:

more Test.txt

Similarly, there are various other commands which can be used to display file content. For example, the nl command displays the file content with the line number.

Primary Sidebar

Latest Posts

How To Run Fsck Manually In Linux To Fix Unexpected Inconsistency

How To Fix Broken Packages On Ubuntu From Terminal

Re Execute The Previous Command In Linux Ubuntu Command Line

How Much RAM Is Needed For Ubuntu PC

How To Find Large Files And Directories In Linux Command Line

How To Use Clear Command History In Linux Terminal

Linux Command To Check RAM Size In Ubuntu Terminal In GB

How To Install Proprietary Drivers In Linux Ubuntu Using Terminal

How To Shutdown Linux With A 15 Minute Delay And Message

Free AI Courses With Certificate For Beginners In India

© 2026 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap