FG
💻 Software

Is it possible to override the command line's built in "cd" command?

Fresh5 days ago
Mar 15, 202617449 views
Confidence Score0%
0%

Problem

Just about every time I 'cd' to a different directory on my machine (in this case, running Mac OS X 10.6.7) via the command line (which is bash), I immediately type 'ls' to get the list of contents in that directory. I'm trying to figure out a way to override 'cd' so that it changes to the requeste…

Error Output

function cl() { cd "$@"; ls -l; }

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Is it possible to override the command line's built in "cd" command?

Low Risk

The following should work: Since the function is on a single line, ensure that it is terminated with as above in order to work correctly.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment