小兔的筆記本

Just another WordPress.com weblog

pushd 和 popd

Posted by Tsukino Usagi 於 二月 18, 2006

在 Linux 下用 cd 切換目錄時, 可以下 cd – 指令回到上一個用過的目錄, 如果需要記憶數個目錄, 可以用 pushd 和 popd 指令.

$ pushd [路徑]

記憶目前的目錄, 並移到指定的路徑.

$ popd

回到上一個被記錄下來的目錄.

範例:

[usagi@10ban ~]$ cd tmp
[usagi@10ban tmp]$ cd –
/home/usagi
[usagi@10ban ~]$ cd –
/home/usagi/tmp
[usagi@10ban tmp]$ cd –
/home/usagi
[usagi@10ban ~]$ pushd tmp
~/tmp ~
[usagi@10ban tmp]$ pushd ~/public_html/
~/public_html ~/tmp ~
[usagi@10ban public_html]$ popd
~/tmp ~
[usagi@10ban tmp]$ popd
~
[usagi@10ban ~]$

2 回應 to “pushd 和 popd”

  1. Hi! Quick question that’s totally off topic. Do you know how to make your site mobile friendly?
    My blog looks weird when viewing from my iphone 4.

    I’m trying to find a template or plugin that might be
    able to resolve this issue. If you have any recommendations,
    please share. Appreciate it!

  2. First of all I want to say fantastic blog! I had a quick question which I’d like to ask if you don’t mind.
    I was curious to find out how you center yourself
    and clear your mind prior to writing. I have had a difficult time clearing my mind in getting my ideas out there.
    I do take pleasure in writing however it just seems like the first 10 to
    15 minutes are generally lost simply just trying to figure out how to
    begin. Any recommendations or hints? Many thanks!

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s

 
%d 位部落客按了讚: