Cd is a command-line utility to change the working directory.
7
votes
3answers
2k views
~ is $HOME, but sometimes?
This is kind of a trivial and dumb question.
cd ~
does the same thing as
cd $HOME
which is also the same as
cd /home/tandu
However,
cd ~not-tandu
changes to /home/not-tandu
Is this ...
3
votes
2answers
203 views
Force change of a user's cwd as root
I'm looking to change a user's process such that I can set it's cwd.
Related, and secondary to the question, I have a filesystem I want to unmount but a user is sitting on it with a bash process. I ...
12
votes
2answers
889 views
What is the bash shortcut to change to the previous directory?
Sadly, I only learned about this last year by stumbling upon it randomly on the internet. I use it so infrequently that I always forget what it is by the time I need it again.
How do you change to ...
3
votes
2answers
338 views
Conflict between `pushd .` and `cd -`
I am a happy user of the cd - command to go to the previous directory. At the same time I like pushd . and popd.
However, when I want to remember the current working directory by means of pushd ., I ...
5
votes
1answer
472 views
Can't get directory listing of folder I have permissions to
I was having some permission problems and used the following command on directory Media:
chmod -R ugo+r Media
It didn't help so then I did:
chmod -R 775 Media
Now I get this error when I try to ...
3
votes
5answers
674 views
Directory is not opening with cd command
I have a directory in Desktop named Project. I tried opening it using the cd command but it is not opening. What's the reason?
Check the screenshot. The directory has all the required permissions.
I ...
6
votes
1answer
381 views
Show message when cd into specific directory
How can I display a message when I cd into a specific directory? This directory is a local one, and I just need a reminder when I go into it from the terminal.
0
votes
2answers
65 views
5
votes
2answers
158 views
Output of which command used for input to cd
I would like to take the output of a which command, and cd to the parent directory. For example, say I have the following:
which someprogram
With output:
/home/me/somedirectory/someprogram
And I ...
4
votes
1answer
177 views
Any cd shortcut to switch an intermediate directory in current path?
if I have current path as a long one..and I want to switch to a directory with just one word from path replaced by something else..like say when using maven , I want to switch from main path to test ...
6
votes
2answers
388 views
Why `.` is displayed by `ls`?
After reading the question When you type “ls -a”, what is the significance of “.” and “..”?, I have a similar one.
Why to display .? I mean, is there any directory where cd . would not work? How is ...
14
votes
1answer
985 views
Execute bash scripts on entering a directory
What is the best way to execute a script when entering into a directory? When I move into a new directory I would like bash to execute the projectSettings.bash script much like RVM does.
3
votes
1answer
145 views
bash: cd to the most recently modified child directory
Wondering if there's an easy and/or portable way to say "change to the most recently modified child directory." I can use ls and awk but there's probably a better way.
cd $( ls -ltrd */ | tail -1 | ...
3
votes
2answers
153 views
How does bash continue to work correctly when you move its working directory?
On Linux, I moved a directory to another directory using mv, and in another shell, my working directory happened to be the directory that was moved.
I ran hg pull in that shell, and to my surprise, ...
2
votes
1answer
1k views
Why can't list file/directory relative to .. from a symbolic link directory (No such file or directory)?
I have a /usr/tomcat6/logs directory linked to /var/log/tomcat6.
When I changed directory to /usr/tomcat6/logs and try to ls files using a relative pathname ../conf/Catalina/localhost, a No such file ...
3
votes
1answer
539 views
changing current working dir with a script
I've read this question and answer, but it doesn't quit fit my problem, even tho it's similar.
I'm writing a script (called cpj) that will launch one of my current projects. I have about 5 of them. ...
3
votes
1answer
1k views
What is the best touch screen kiosk solution?
I'm a web developer and I'm looking for the best stripped-down linux experience that provides a full-screen experience for touch screens. I'll be looking for:
a robust experience that stops people ...
12
votes
3answers
1k views
Changing parent directory (../) with symlinks
I have a symlink
~/link -> ~/a/really/long/path
When I do
cd ~/link
cd ..
it takes me to
~
but I want to go to
~/a/really/long
Is there a way to do this?
I am using bash.