Solved

Absolute Linux newbie...user command current directory?

Posted on 2007-03-18
7
269 Views
Last Modified: 2008-02-20
Absolute Linux newbie...

What is the user command for telling me what is my current directory?

tnx,

- avi
0
Comment
Question by:progtw
  • 3
  • 3
7 Comments
 
LVL 48

Accepted Solution

by:
Tintin earned 25 total points
ID: 18744710
pwd
0
 
LVL 20

Assisted Solution

by:nedvis
nedvis earned 25 total points
ID: 18744730
pwd  ( stands for printe working directory )
0
 

Author Comment

by:progtw
ID: 18744743
you are correct.
thanks.
that's a strange long mnemonic.

why doesn't it just use "cd", which is anyway also a command in Linux?
avi
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 48

Expert Comment

by:Tintin
ID: 18744754
cd is for changing directories, not printing them.

If you want the current directory to always be displayed in your prompt and assuming your default shell is bash, do:

export PS1='\w$ '

You can add that to your .bash_profile if you want it to be permanent.
0
 
LVL 20

Expert Comment

by:nedvis
ID: 18744966
There  are even more "strange  logic" ( at least to me)  in some Linux/Unix commands.
Command "which" , for instance, does not say anything about of what kind something is .
but rather  WHERE certain  executable file is located within file system.
type
which xterm
or
which oowriter
and "which"  will tell you where X terminal and OpenOffice wordprocessor module executable files sit
on your machine ( in my Vector Linux 5.8 it's  /usr/bin/xterm  and /opt/openoffice.org2.0/oowriter )
0
 
LVL 20

Expert Comment

by:nedvis
ID: 18744979
Tintin, I really, like you tips!
0
 
LVL 48

Expert Comment

by:Tintin
ID: 18745220
Think of 'which' as in "which portion of my PATH is the command located".  It's true, where would have been more logical, but there is the whereis command for that.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question