File System
| Command | Description |
|---|---|
ls [dir] | List files with colored output, attributes, and sizes |
cd [dir] | Change directory (cd - for previous, cd for home) |
pwd | Print working directory |
mkdir [-cd] dir | Create directory (-cd to enter it immediately) |
touch [-d/-t] file | Create file or update timestamp |
rm [-r] path | Remove file or directory |
mv src dst | Move or rename file/directory |
cp [-r] src dst | Copy file or directory |
ln [-s] target link | Create hard or symbolic link |
stat file | Display file metadata |
chmod +/-r file | Toggle file attributes (r/h/s) |
find path [opts] | Recursive file search |
du [-sh] [dir] | Disk usage of files/directories |
df | Show disk space of mounted drives |
mktemp [-d] | Create temporary file or directory |
basename path [suffix] | Strip directory and optional suffix |
dirname path | Strip last component from path |
ls
On Windows, ls is a builtin that shows file attributes, sizes, timestamps, and color-coded names by file type. On other platforms it falls through to the system ls.
Shell
> ls
d----- - Jan 15 09:44 src/
d----- - Jan 10 11:20 tests/
-a-r-- 2.5K Jan 15 14:23 Program.cs
-a-r-- 1.8K Jan 12 10:05 README.mdfind
Recursive file search with filtering by name pattern, type, and extension:
Shell
> find src -ext cs
src/Parser.cs
src/Lexer.cs
src/Interpreter.cs
> find . -name "*.json" -type f
./config.json
./package.json