list
List the files in a directory (the current one by default) with octal permissions, owner, group, size, and modified time, sorted by name
- Command:
/go/list - Category: Files
- Required arguments: None
- Output: One line per file, with no header
- Log:
/var/log/go/list.log - Last updated: 2026-11-20
On this page: Overview · Quick start · Syntax · Arguments · Output · Examples · Troubleshooting · Details · See also
Overview
/go/list shows the files in one directory in a compact table. Unlike a plain ls -l, it shows the permissions as a number (such as 644 or 755), which is the form GoAdmio's fix command and most hosting guides use. It also:
- shows owner, group, a human-readable size, and the modified date and time
- includes hidden files (names starting with a dot)
- lists only regular files directly inside the directory, not subfolders
- sorts the result by file name
It only reads information. It never changes files.
Quick start
# List the files in the current directory
/go/list
# List the files in a site's web folder
/go/list /home/example.com/www
Syntax
/go/list [path]
| Form | Behavior |
|---|---|
/go/list |
Lists the files in the current directory. |
/go/list <directory> |
Lists the files directly inside that directory. |
/go/list <file> |
Shows that one file. |
Only the first argument is used. Extra arguments are ignored, so a wildcard such as /go/list /path/*.php lists only the first file the shell finds.
Arguments
| Position | Argument | Required | Default | Notes |
|---|---|---|---|---|
| 1 | <path> |
No | The current directory | A directory or a file. Relative paths are resolved from where you run the command. |
There are no --option value pairs.
Output
The command prints one line per file, with columns aligned and no header row:
644 1 example example 1.2K 2026-11-18 09:41 index.php
755 1 example example 35K 2026-11-02 14:05 wp-cron.php
600 1 example example 3.1K 2026-10-27 21:18 .htaccess
| Column | Meaning |
|---|---|
| 1 | Permissions in octal, such as 644 |
| 2 | Number of hard links to the file (normally 1) |
| 3 | Owner |
| 4 | Group |
| 5 | Size, in human-readable form (K, M, G; units of 1024) |
| 6 | Modified date (YYYY-MM-DD) |
| 7 | Modified time (HH:MM) |
| 8 | File name |
| Outcome | What you get |
|---|---|
| Directory has files | The table above. |
| Directory has no regular files | Nothing is printed, and the exit status is 0. |
| Path doesn't exist | Mo such file or directory, exit status 1. (The message has a typo in the script; it means "No such file or directory".) |
Examples
# What is in the current folder?
/go/list
# Check the permissions of a site's files
/go/list /home/example.com/www
# Look at a single file
/go/list /home/example.com/www/wp-config.php
# Show only the files that aren't 644 (for example, to find odd permissions)
/go/list /home/example.com/www | awk '$1 != 644'
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Mo such file or directory |
The path doesn't exist. | Check the spelling. The message itself is misspelled in the script. |
| Nothing is printed | The directory contains only subfolders, or it is empty. Subfolders and symbolic links are not listed. | Use ls -la <directory> to see everything. |
| Lines are missing, split, or show errors for some files | The file name contains spaces or special characters, which the command doesn't handle. See Known limitations. | Rename the file, or use ls -l. |
stat: cannot statx ... or ls: cannot access ... |
You don't have access to the directory. The file search runs with sudo, but the permission and detail lookups don't. |
Run the command as root. |
Permissions show as 644, but you want rw-r--r-- |
The command prints octal only. | Use ls -l. |
| Subfolders you expected are missing | The command lists regular files only, and isn't recursive. | List the subfolder separately, or use find. |
Details
How it works
flowchart TD
A["list [path]"] --> B{"Path given?"}
B -- "No" --> C["Use current directory"]
B -- "Yes" --> D{"File or directory exists?"}
D -- "No" --> E["Print error, exit 1"]
D -- "Yes" --> F["Use the path"]
C --> G["Find regular files, one level deep"]
F --> G
G --> H{"Any files?"}
H -- "No" --> I["Print nothing"]
H -- "Yes" --> J["Read permissions, owner, group, size, time for each file"]
J --> K["Align columns and sort by name"]
- Logs the call to
/var/log/go/list.log. - Uses the current directory if no path is given. Otherwise checks that the path is an existing file or directory, and exits with an error if it isn't.
- Finds the regular files directly inside the path (one level deep, with
sudo). Subfolders and symbolic links are skipped. Hidden files are included. - For each file, reads the octal permissions with
stat, and the link count, owner, group, size, and modified time withls. - Builds one line per file, aligns the columns, and sorts by file name.
What is and isn't shown
| Item | Shown? |
|---|---|
| Regular files in the directory | Yes |
Hidden files (names starting with .) |
Yes |
| Subdirectories | No |
| Symbolic links | No |
| Files inside subdirectories | No |
| A header row | No |
| A total count | No (the script counts the files but doesn't print the number) |
The sort follows the server's language settings, so upper and lower case may be ordered differently from one server to another.
Known limitations
- Spaces and special characters in names. The file name is used without quotes in the
statandlscalls, so a name with spaces is split into several names and produces errors or missing lines. Names containing\or*can also be changed when the table is printed. - Mixed privileges. The file search runs with
sudo, but the detail lookups don't, so for a directory you can't read as your own user the search finds files that the lookups then can't read. - Only the first argument is used.
See also
| Command | Description |
|---|---|
fix |
Reset ownership and permissions for one account or all accounts |
scan |
Scan newly modified PHP files for shells and the root password |
findbom |
Find PHP files that start with a UTF-8 byte order mark (BOM) |