LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-02-2007, 04:17 PM   #1
itsmesee
LQ Newbie
 
Registered: Dec 2007
Posts: 12

Rep: Reputation: 0
pushd &popd


Very new to linux so forgive the stupid questions, but im going through linux with this step by step guide to learning linux and the explaination for pushd & popd is about 1 sentence long and poorly written so could someone give me an idea from a linux idiot perspective as to what this does??

Thanks
 
Old 12-02-2007, 04:25 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
The pushd and popd commands push and pop directories from the directory stack. They are useful because they let you "save your place" in the file system. For example, if you are in /some/big/long/path and you pushd /somewhere/else you will change to /somewhere/else and your original location is pushed onto the stack. When you do popd, you will change back to /some/big/long/path without having to re-type that big long path.
 
Old 12-02-2007, 04:37 PM   #3
itsmesee
LQ Newbie
 
Registered: Dec 2007
Posts: 12

Original Poster
Rep: Reputation: 0
So basically its like the previous button on a t.v. remote?
Please forgive me if that sounds stupid..
 
Old 12-02-2007, 04:48 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Sort of, but it's a stack ... so you can store more than just one item on it for instance, you can do:

Code:
cd /a
pushd /b # /a is pushed onto the stack
pushd /c # /b is pushed onto the stack, which now has [/b,/a]
pushd /d # /c is pushed, stack now has [/c,/b,/a]
popd # changes you to /c, stack now has [/b,/a]
popd # changes you to /b, stack is now [/a]
popd # changes you to /a
 
Old 12-02-2007, 04:56 PM   #5
itsmesee
LQ Newbie
 
Registered: Dec 2007
Posts: 12

Original Poster
Rep: Reputation: 0
OH, okay i get it now!
cool thanks.

Also, what are some good basic programs to start installing on a linux system?

thanks for the help
 
Old 12-02-2007, 05:02 PM   #6
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
I should also mention you can use the dirs command to see the list of directories on the stack. You can use popd +n to go to (and pop) the nth entry from the directory stack (counting from the left -- popd -n counts from the right). Pushd and popd are bash built-in commands so if you look at man bash you can read all the documentation on them.

As for good basic programs, it really depends. What do you want to use the system for. Consumer desktop? Scientific workstation? Server of some sort?
 
Old 12-02-2007, 05:22 PM   #7
itsmesee
LQ Newbie
 
Registered: Dec 2007
Posts: 12

Original Poster
Rep: Reputation: 0
Im trying to learn how to run a webserver without control panels.. Ive been using whm/cpanel for sometime, but i want to start learning more about running the web server, apache, running vps and such. There are great control panels that do it all for you, but i dont want to depend on them.

I was told and from i can tell its true, that centos is common on webservers. Also its the one my providor uses. So im setting this old pc up as a centos machine right next to my pc and im going to practice logging in and stuff. Whenever i update or move files in cpanel on my web server im going to try and teach myself on my home pc how to do it without a GUI..
 
Old 12-02-2007, 10:17 PM   #8
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
OK, well you'll want to make sure you have Apache installed. If it's not installed, you can install it through yum. To turn it on do:

Code:
service httpd start
and make sure you can connect to it from another machine (if you have a firewall on, you may have to make sure that port 80 is open). The Apache configuration files are in /etc/httpd. I suggest you read the Apache documentation for information about all the thing you can do.
 
Old 12-02-2007, 11:10 PM   #9
itsmesee
LQ Newbie
 
Registered: Dec 2007
Posts: 12

Original Poster
Rep: Reputation: 0
Oh boy.. more questions then, what is yum? How does just that little bit of code install apache?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pushd popd dirs christianunix Linux - Newbie 1 10-26-2007 10:10 PM
puhsd, popd implementation Rudess Linux - General 1 03-12-2007 06:37 PM
AOL UK && BT Voyager 100 && Slackware 10.2 && RP-PPPoE pitt0071 Linux - Networking 3 01-17-2006 06:10 AM
Japanese canna won't work : Warning: かな漢字変&am OrganicOrange84 Debian 3 06-30-2005 02:28 PM
Phục hồi dữ liệu bị mất???, cứ pollsite General 1 06-27-2005 12:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration