Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 312
  • Last Modified:

Absolute Linux newbie...user command current directory?

Absolute Linux newbie...

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

tnx,

- avi
0
progtw
Asked:
progtw
  • 3
  • 3
2 Solutions
 
TintinCommented:
pwd
0
 
nedvisCommented:
pwd  ( stands for printe working directory )
0
 
progtwAuthor Commented:
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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
TintinCommented:
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
 
nedvisCommented:
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
 
nedvisCommented:
Tintin, I really, like you tips!
0
 
TintinCommented:
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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now