man > csh(1)

```html

🐚 TCSH(1) - General Commands Manual

📖 NAME

tcsh - C shell with file name completion and command line editing

🚀 Quick Reference

📌 Use Case🖥️ Command📝 Description
Start interactive shelltcshLaunch enhanced C shell
Execute scripttcsh script.cshRun commands from file
Login shelltcsh -lStart as login shell
Read commands from stdintcsh -sInteractive reading from stdin
Single command executiontcsh -c "command"Execute one command and exit
Debug script (parse only)tcsh -nParse without executing
Echo commands before executiontcsh -xSet echo variable
Verbose mode (echo after history)tcsh -vSet verbose variable
Fast startup (no resource files)tcsh -fSkip ~/.tcshrc etc.
Force fork instead of vforktcsh -FUse fork() for processes
List active jobsjobsShow background/suspended jobs
Bring job to foregroundfg %1Resume job 1 in foreground
Send job to backgroundbg %1Resume job 1 in background
Change directorycd /pathChange working directory
Push directory onto stackpushd /pathChange dir and push old one
Pop directory stackpopdReturn to previous directory
Show directory stackdirsList directory stack
Set environment variablesetenv VAR valueSet env var
Set shell variableset var=valueSet shell variable
Unset variableunset varRemove shell variable
Define aliasalias name 'command'Create command alias
Remove aliasunalias nameDelete alias
History listhistoryDisplay command history
Repeat last command!!Re-execute previous command
Use last argument!$Insert last argument of previous command
Spelling correctionspell-word (M-s)Correct current word
Complete wordTabAuto-complete filename/command/variable
List completion choices^DList possible completions
Edit command lineEmacs/Vi keysInline editing
Exit shellexit or ^DTerminate shell

📋 SYNOPSIS

tcsh [-bcdefFimnqstvVxX] [-Dname[=value]] [arg ...]
tcsh -l

🐚 DESCRIPTION

tcsh is an enhanced but completely compatible version of the Berkeley UNIX C shell, csh(1). It includes a command-line editor, programmable word completion, spelling correction, history mechanism, job control, and a C-like syntax. Features marked with (+) are not in most csh implementations; features marked with (u) are undocumented in csh.

🔹 Argument list processing

If the first argument is -, it's a login shell. A login shell can also be specified with -l as the only argument. The rest of the flag arguments are interpreted as follows:

After flag processing, if arguments remain and no -c, -i, -s, or -t was given, the first argument is taken as a script file. Remaining arguments are placed in argv.

🔹 Startup and shutdown

Login shells execute system files /etc/csh.cshrc and /etc/csh.login, then user files: ~/.tcshrc (or ~/.cshrc), ~/.history, ~/.login, and ~/.cshdirs. Non-login shells read only /etc/csh.cshrc and ~/.tcshrc/~/.cshrc. At logout, /etc/csh.logout and ~/.logout are executed.

🔹 Editing

The command-line editor is active when edit is set (default in interactive shells). bindkey displays/configures key bindings. Emacs-style bindings are default. Arrow keys are bound to down-history, up-history, backward-char, forward-char.

🔹 Completion and listing

Type part of a word and press Tab to complete. ^D lists possible completions. Completion works for filenames, commands, and variables. The complete builtin allows custom completions. Variables like autolist, recexact, fignore, autocorrect, autoexpand, recognize_only_executables affect behavior.

🔹 Spelling correction

Use M-s (spell-word) or M-$ (spell-line). Set correct to cmd or all for automatic correction. The shell prompts with corrected line; answer y/n/e/a.

🔹 Editor commands

Key bindings are listed by bindkey -l. Notable commands: complete-word (Tab), delete-char-or-list-or-eof (^D), expand-history (M-space), history-search-backward (M-p), i-search-back, vi-search-back, spell-word (M-s), run-help (M-h), which-command (M-?), yank-pop (M-y).

🔹 Lexical structure

Input lines are split at blanks, tabs, and special characters (&, |, ;, <, >, (, ), &&, ||, <<, >>). # starts a comment when input is not a terminal. Quoting with \, ', ", ` prevents special meaning.

🔹 Substitutions

📜 History substitution

History substitutions begin with !. Event specification: n (event number), -n (offset), # (current), ! (previous), s (beginning with string), ?s? (containing string). Word designators: 0 (command), n (argument), ^ (first), $ (last), * (all). Modifiers: h (head), t (tail), r (root), e (extension), u/l (case), s/l/r/ (substitute), & (repeat), g (global), a (apply to single word), p (print), q (quote), x (break into words).

📜 Alias substitution

After parsing, the first word of each command is checked for alias. Aliases can contain history references. Alias substitution is repeated until no change.

📜 Variable substitution

Variables are referenced with $name or ${name}. Subscripting: $name[selector]. Special variables: $0 (script name), $number (argv), $* (all args), $?name (set test), $#name (word count), $%name (character count), $$ (PID), $! (last background PID), $_ (last command line), $< (read from stdin). Modifiers from history can be applied.

📜 Command, filename and directory stack substitution

Command substitution: `command`. Filename substitution (globbing): *, ?, [...], {...}, ~ (home), ^ (negation). Directory stack substitution: =n expands to stack entry.

🔹 Commands

Simple commands, pipelines (|), sequences (;, ||, &&), and background execution (&). Parenthesized commands run in subshell.

🔹 Builtin and non-builtin command execution

Builtins execute within the shell. Non-builtins are searched via path and hashed. The shell emulates #! if compiled.

🔹 Input/output

Redirection: < file, << word, > file, >& file, >> file, >>& file. noclobber prevents overwriting. Diagnostic output can be piped with |&.

🔹 Features

📜 Control flow

foreach, switch, while, if-then-else. Keywords must appear on single input lines.

📜 Expressions

Logical, arithmetic, comparison operators: ||, &&, |, ^, &, ==, !=, =~, !~, <=, >=, <, >, <<, >>, +, -, *, /, %, !, ~, (, ). =~ and !~ match glob patterns.

📜 Command exit status

Commands in expressions return true (1) if exit status 0, false (0) otherwise.

📜 File inquiry operators

Test operators: -r, -w, -x, -X, -e, -o, -z, -s, -f, -d, -l, -b, -c, -p, -S, -u, -g, -k, -t, -R, -L. Information operators: -A, -A:, -M, -M:, -C, -C:, -D, -I, -F, -L (link target), -N, -P, -P:, -Pmode, -U, -U:, -G, -G:, -Z. Multiple operators can be combined.

📜 Jobs

Job control: bg, fg, stop, notify. Jobs referred by %job. Current job marked with +, previous with -.

📜 Status reporting

Shell notifies of job status changes before prompt. notify variable gives immediate notification.

📜 Automatic, periodic and timed events

sched for scheduled commands, beepcmd, cwdcmd, periodic, precmd, postcmd, jobcmd special aliases. autologout, mail, printexitvalue, rmstar, time, watch.

📜 Native Language System support

8-bit clean, supports character sets via LANG/LC_CTYPE. Printable characters in range \200-\377 are rebound to self-insert-command unless NOREBIND is set.

📜 OS variant support

Builtins for TCF, BS2000, Domain/OS, Mach, Masscomp/RTU, Harris CX/UX, Convex/OS. VENDOR, OSTYPE, MACHTYPE environment variables.

📜 Signal handling

Login shells ignore interrupts when reading ~/.logout. Quit ignored unless -q. Terminate caught by login shells. onintr, hup, nohup control handling.

📜 Terminal management

Three tty mode sets: edit, quote, execute. setty manages fixed modes. echotc, settc, telltc manipulate termcap. Window resizing adjusts LINES/COLUMNS.

📑 REFERENCE

🔹 Builtin commands

List of builtin commands with descriptions. Key entries:

🔹 Special aliases

🔹 Special shell variables

Essential variables:

🌍 ENVIRONMENT

Environment variables: AFSUSER, COLUMNS, DISPLAY, EDITOR, GROUP, HOME, HOST, HOSTTYPE, HPATH, LANG, LC_CTYPE, LINES, LS_COLORS, MACHTYPE, NOREBIND, OSTYPE, PATH, PWD, REMOTEHOST, SHLVL, SYSTYPE, TERM, TERMCAP, USER, VENDOR, VISUAL. See descriptions in the manual for details.

📁 FILES

✨ NEW FEATURES

🐛 BUGS

🔤 THE T IN TCSH

tcsh is inspired by the TENEX/TOPS-20 command completion feature. The 't' stands for 'TENEX'.

⚠️ LIMITATIONS

📚 SEE ALSO

csh(1), emacs(1), ls(1), newgrp(1), sh(1), setpath(1), stty(1), su(1), tset(1), vi(1), x(1), access(2), execve(2), fork(2), killpg(2), pipe(2), setrlimit(2), sigvec(2), stat(2), umask(2), vfork(2), wait(2), malloc(3), setlocale(3), tty(4), a.out(5), termcap(5), ron(7), termio(7), Introduction to the C Shell

📌 VERSION

This manual documents tcsh 6.21.00 (Astron) 2019-05-08.

👤 AUTHORS

🙏 THANKS TO

Bryan Dunlap, Clayton Elwell, Karl Kleinpaste, Bob Manson, Steve Romig, Diana Smetters, Bob Sutterfield, Mark Verber, Elizabeth Zwicky and all the other people at Ohio State for suggestions and encouragement. All the people on the net for bug reports and suggestions. Richard M. Alderson III for writing the 'T in tcsh' section.

```
csh(1)
🐚 TCSH(1) - General Commands Manual 📖 NAME 🚀 Quick Reference 📋 SYNOPSIS 🐚 DESCRIPTION
🔹 Argument list processing 🔹 Startup and shutdown 🔹 Editing 🔹 Completion and listing 🔹 Spelling correction 🔹 Editor commands 🔹 Lexical structure 🔹 Substitutions 🔹 Commands 🔹 Builtin and non-builtin command execution 🔹 Input/output 🔹 Features
📑 REFERENCE
🔹 Builtin commands 🔹 Special aliases 🔹 Special shell variables
🌍 ENVIRONMENT 📁 FILES ✨ NEW FEATURES 🐛 BUGS 🔤 THE T IN TCSH ⚠️ LIMITATIONS 📚 SEE ALSO 📌 VERSION 👤 AUTHORS 🙏 THANKS TO

Generated by phpman v4.9.29 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-22 04:29 @2600:1f28:365:80b0:8802:8bb4:3873:328e
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^