You are not logged in.
Pages: 1
Hi all,
Very stupid question for you all.
I've been using linux for a while now but wanted to ask, what exactly do the shorthand directories mean:
for example, create the file ~/.xinitrc
I know this means create a hidden file called xinitrc, but which directory?
If there are any other shorthands for directories can people let me know please.
Alexie
Offline
~ is the shorthand for /home/user/
Offline
"~" denotes user's home directory.
Offline
You can also specify another user with ~someuser ("cd ~bob" will bring you to bob's home dir).
Offline
Thanks guys.
Offline
Many directorys are stored in variables also
cd $HOME - takes you home
cd $OLDPWD - takes you to your previous directory
cd $PWD - takes you to your current directory (not sure what the point of that would be, more useful as `echo $PWD`)
There are probably more
Offline
cd $PWD - takes you to your current directory (not sure what the point of that would be, more useful as `echo $PWD`)
This is from the times where there were only primitive shell prompts.
Otherwise it has proven useful in several scripts of mine.
To know or not to know ...
... the questions remain forever.
Offline
gazj wrote:cd $PWD - takes you to your current directory (not sure what the point of that would be, more useful as `echo $PWD`)
This is from the times where there were only primitive shell prompts.
Otherwise it has proven useful in several scripts of mine.
Of course it would be handy in shell scripts, had thought of that
Offline
"-" is shorthand for $OLDPWD and "." for $PWD.
Last edited by lucke (2009-04-26 10:50:17)
Offline
lucke, thanks! That's a real time saver.:D
A little OT, but running cd with no options will take you to your home directory as well.
Last edited by dmartins (2009-04-26 19:27:05)
Offline
and cd .. brings you to the previous directory too. (very useful sometimes)
archlinux on Macbook Pro 10,1
Offline
and cd .. brings you to the previous directory too. (very useful sometimes)
Actually, cd .. brings you one directory up the hierarchy.
Offline
Pages: 1