Skip to Content
Using csh & tcsh
book

Using csh & tcsh

by Paul DuBois
July 1995
Beginner to intermediate
244 pages
5h 58m
English
O'Reilly Media, Inc.
Content preview from Using csh & tcsh

Directory Naming Shorthand

Both csh and tcsh provide a shorthand notation for referring to user account home directories, and tcsh provides a shorthand for referring to entries in your directory stack.

Referring to Home Directories Using ˜name

The shell interprets ˜ or ˜name at the beginning of pathnames to mean your home directory, or the home directory for user name. These shortcuts give you a quick way to refer to any user's home directory, without typing (or even knowing) the actual pathname. Thus, if I want to see what files carl has in his home directory, I don't have to know where that directory is; I just type the following command:

% ls ˜carl

I can edit my calendar file, no matter where I am, with the following command:

% vi ˜/calendar

Suppose I'm located deep in my directory hierarchy, and I want to copy a file intro.ms.new from my Thesis directory to my current directory. I want to avoid specifying long absolute or relative paths to the file like those shown below:

% cp /usr/staff/dubois/Thesis/intro.ms.new .      (or)
% cp ../../../../Thesis/intro.ms.new .

Neither of these alternatives is attractive. The absolute path is long, and when typing a relative path it's easy to go up too few or too many levels by mistake. It's a lot simpler to type this, instead:

% cp ˜/Thesis/intro.ms.new .

If intro.ms.new is located under someone else's account, I can easily get a copy of the file by using the following command:

% cp ˜colleen/Thesis/intro.ms.new .

Referring to Directory Stack Entries Using ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Linux Shells by Example

Linux Shells by Example

Ellie Quigley

Publisher Resources

ISBN: 9781449377526Errata Page