How To View & Create Hidden Files in Linux (2024)

Introduction

Linux, by default, hides many of the sensitive system files. Hidden files are usually system or application files, concealed to prevent accidental changes.

This guide will show you how to display and work with hidden files in Linux.

How To View & Create Hidden Files in Linux (1)

Prerequisites

  • A system running Linux
  • Access to a terminal window / command line (optional)

Note: Some directories require administrator, root, or sudo privileges to access. Depending on the files you want to access, you may need to switch users or use the sudo command.

How to Show Hidden Files

Show Hidden Files From the Command Line

To display all the files in a directory, including hidden files, enter the following command:

ls –a

The ls command lists the contents of the current directory. The –a switch lists all files – including hidden files.

How To View & Create Hidden Files in Linux (2)

To list regular and hidden files in a different directory than your current working location:

ls –a /etc

Replace /etc with any other directory.

Show Hidden Files in a Graphical Interface (GUI)

There’s a simple method to show hidden files if you’re more comfortable working in Gnome (or any other graphical interface).

1. First, browse to the directory you want to view.

2. Then, press Ctrl+h.

If Ctrl+h doesn’t work, click the View menu, then check the box to Show hidden files.

Note: Ctrl+h works in newer Ubuntu and CentOS environments. If you’re running an older or different version, it may not work.

How to Hide Files

Hide File or Directory Using the Linux Command Line

To mark a file as hidden, use the mv (move) command.

1. First, create a test file. Use the touch command to create an empty test.txt file:

touch test.txt
How To View & Create Hidden Files in Linux (3)

2. Then, hide the file by moving it under a new filename. The period (.) at the beginning of the new filename indicates that it’s hidden:

mv test.txt .test.txt

3. To verify the file is now hidden, display the contents of the current directory:

ls

4. Now, list the contents, including hidden files:

ls –a

You should see test.txt in the second listing.

How To View & Create Hidden Files in Linux (4)

Note: The process is entirely the same for directories. Use the mv command with a period (.) at the beginning of the new directory name.

Hide a File in a Graphical Interface (GUI)

You can also mark a file as hidden using a graphical interface.

1. Right-click the file you want to hide.

2. Then, select Rename.

3. Make the file hidden by placing a period at the beginning of the filename.

How To View & Create Hidden Files in Linux (5)

Use the same process to hide a directory.

How to Create Password-Protected Hidden Files

Create Password-Protected, Hidden File From the Command Line

1. To create a hidden and password-protected archive file from the command line, start by creating a new text file:

touch test2.txt

2. Next, compress and encrypt that file:

zip ––encrypt test2.zip test2.txt

3. You’ll be asked to enter and confirm a password for the file.

4. Then, use the ls command – you should see test2.zip in the file list.

How To View & Create Hidden Files in Linux (6)

5. Next, set the .zip file to hidden by entering:

mv test2.zip .test2.zip

6. Finally, use ls and ls –a to confirm and verify the file is hidden.

How To View & Create Hidden Files in Linux (7)

Create a Hidden, Password-Protected File From the Graphical Interface

Encrypting a file requires more steps in the graphical version of Linux.

1. Start by opening the File Manager to your home directory.

2. Right-click an empty area, then click New Folder (a folder and a directory are the same things).

3. Name the folder test3and click Create.

4. Next, click Activities > Search > type archive manager > launch the Archive Manager.

5. Drag and drop the new test3folder into the Archive Manager window.

How To View & Create Hidden Files in Linux (8)

6. The system will ask: Do you want to create an archive with these files? Click Create Archive.

7. In the Create Archive dialog box, the filename should be test3. Just to the right, click the drop-down and select the .zip format.

How To View & Create Hidden Files in Linux (9)

8. Click Other options near the bottom. Type a password to use for your archive, then click Save.

9. Close the Archive Manager. You should now see a test3.zip file in the home directory.

How To View & Create Hidden Files in Linux (10)

10. Right-click the test3.zip file, click Rename, and add a period at the beginning of the filename.

How To View & Create Hidden Files in Linux (11)

Conclusion

You should now be able to show and hide hidden files in Linux. These commands can be especially useful if you need to find configuration files.

Also, you can find web browser data, certain application caches, and logs stored in hidden files.

How To View & Create Hidden Files in Linux (2024)
Top Articles
Convert 20 USD to ETH - US Dollar to Ethereum Converter | CoinCodex
LTCG tax: How to save long-term capital gains tax
Evansville Craigslist Com
portland gigs "no experience" - craigslist
[PDF] (punctuation mark - used as punctuation in symbol sentences) YELLOW Character 8485 Fragezeichen 8485 vraagteken 8485 vraagteken - Free Download PDF
Google Alerts Login
Magic Seaweed Newport Ri
What Are The Hours Of Chase Bank Today
Abbytheedoll
Haktuts Free Spins Link 2020
Bengals Vs Bills Postponed Until When
Hac Saisd
It Tattoo Designs
Osu Hematology
Aes Salt Lake City Showdown
Serenity Nail Salon Brentwood Tn
Kevin Murphy: Current: Faculty: Jacobs School of Music: Indiana University Bloomington
8636643427
Thekat103.7
Citibank Branch Locations In Orlando Florida
855-409-4227
Cbs Straight Up Picks
Tierra De Esperanza Capítulo 46 Tokyvideo
Hwy 57 Nursery Michie Tn
O'reilly's Milford Ohio
Jps Occupational Health Clinic
Cavallo Terrace Rv Park
Lagrange Tn Police Officer
Saxies, Lantana
Loss Payee And Lienholder Addresses And Contact Information Updated Daily Free List Bank Of America
Craigslist Apartments For Rent In New Bedford Ma
Qeuter
Samantha Lyne Wikipedia
Magma Lozenge Location
Cash App Paid Screenshot
R/Sandiego
Обзор открытых наушников Sanag Z66 pro с высокой автономностью
Rhode Island Weather by Month – Btobers.com
18775035802
Uncovering The Mystery Behind Crazyjamjam Fanfix Leaked
Why Is 365 Market Troy Mi On My Bank Statement
Wheely 6 Abcya
Scholastic Toolkit Sign In
Honeybee: Classification, Morphology, Types, and Lifecycle
Noaa Weather Forecast Pittsburgh
Louise Ogborn Spanking
Austin’s Craigslist: Your Ultimate Guide to Buying, Selling, and Discovering
Ati Nurses Touch The Leader Case 4
Sarah Button Leaks
R. Kelly trial: A look at the key moments after star found guilty
A Goofy Movie | Rotten Tomatoes
Latest Posts
Article information

Author: Kerri Lueilwitz

Last Updated:

Views: 6035

Rating: 4.7 / 5 (47 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Kerri Lueilwitz

Birthday: 1992-10-31

Address: Suite 878 3699 Chantelle Roads, Colebury, NC 68599

Phone: +6111989609516

Job: Chief Farming Manager

Hobby: Mycology, Stone skipping, Dowsing, Whittling, Taxidermy, Sand art, Roller skating

Introduction: My name is Kerri Lueilwitz, I am a courageous, gentle, quaint, thankful, outstanding, brave, vast person who loves writing and wants to share my knowledge and understanding with you.