Solved

Absolute Linux newbie...user command current directory?

Posted on 2007-03-18
7
260 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
Comment Utility
pwd
0
 
LVL 20

Assisted Solution

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

Author Comment

by:progtw
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 48

Expert Comment

by:Tintin
Comment Utility
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
Comment Utility
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
Comment Utility
Tintin, I really, like you tips!
0
 
LVL 48

Expert Comment

by:Tintin
Comment Utility
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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now