Get a free website with any plan

See how
LINUX AND SSH

Listing files and folders with ls

Last updated

IN SHORT

The Linux ls command lists files and folders inside your current directory over SSH on Flashcloud servers. Running ls alone shows file names, while adding flags like ls -la reveals permissions, file sizes, and hidden dotfiles like .htaccess. Use it across VPS environments or shared hosting terminal sessions to inspect your site files.

Run ls to see what's inside the current directory over SSH. On its own it prints just the names. Add flags to get permissions, sizes, hidden files, and human-readable output: ls -la is the one you'll type most often, since it shows hidden dotfiles (like .htaccess) alongside everything else.

This is plain Linux, not a Flashcloud-specific tool, so everything here applies whether you're in an SSH session on a VPS or in a terminal app connected to shared hosting (where available). The same ideas carry over to the portal's File Manager, which is really a graphical view of the same directory tree.

The flags worth knowing

  • ls - bare listing, names only, alphabetical.
  • ls -l - "long" format: permissions, owner, group, size, modification date, name. This is the format you need when you're chasing down a permissions problem.
  • ls -a - includes hidden files (anything starting with a dot), which ls alone skips.
  • ls -la - combines both. This is the everyday default.
  • ls -lh - long format with sizes in human-readable units (K, M, G) instead of raw bytes.
  • ls -lt - sorts by modification time, newest first. Useful for finding a recently edited file or one a script recently wrote.
  • ls -R - recurses into subdirectories, listing everything below the current one.

Flags can be combined in any order: ls -lhtR works the same as typing them separately.

Reading the long format

A line from ls -l looks like this:

-rw-r--r-- 1 user user 4096 Sep 28 14:03 index.php

The first character tells you the type: - for a regular file, d for a directory, l for a symbolic link. The next nine characters are the permission bits in three groups of three (owner, group, everyone), each group being read/write/execute. After that: link count, owner, group, size, last-modified date, and name.

Where to point it on Flashcloud

On shared and WordPress hosting, your site's files live under your account's home directory, typically with a web root folder as the entry point. ls -la after logging in is a common first move, to confirm you're looking at the right document root before editing anything. If you'd rather browse visually, the portal's File Manager tile on your service's Manage Account section does the same job. See The portal vs cPanel, what goes where for which interface to reach for.

On a VPS, you have full root access, so ls works anywhere on the filesystem, not just inside your account's directory. That's the core trade-off of VPS hosting: more visibility and control, but also more responsibility for what you're looking at. See VPS overview, what's included and where to find it for how SSH access fits into the bigger picture.

Useful combinations

  • ls -la | grep .htaccess - confirm a hidden config file exists before you try to edit it.
  • ls -lhS - sort by size, largest first. Good for hunting down what's eating your disk quota; see Checking your hosting resource usage if you're trying to track down what's filling up your storage cap.
  • ls -ld */ - list only directories in the current folder, with their own permission lines rather than descending into them.

When to open a ticket

If ls shows files owned by an unexpected user, or permissions that look wrong across a whole directory tree, that's worth a second pair of eyes before you start running chmod commands to fix it. Open a ticket from the portal's Support section and a real person will look at it with you.

Common questions

How do I see hidden files like .htaccess over SSH?

Run ls -a or ls -la. The -a flag forces the terminal to display dotfiles that standard listings hide.

How can I see which files are taking up my storage space?

Run ls -lhS in your directory. This displays file sizes in readable units like megabytes and gigabytes, sorted with the largest files at the top.

Can I view my site files without using the command line?

Yes. Open the File Manager tile in your service's Manage Account section in the portal to browse the same files visually.

What should I do if my file permissions or owners look wrong?

Open a support ticket from the portal before running chmod commands. A support agent will look at the directory tree with you to help sort it out.

CAN'T FIND IT?

Real humans answer fast.

Hosting with us? Open a ticket and a real person replies - no scripts, no upsells. Still choosing a host? The same team is included with every plan, from day one.