add new feauture to "cd" command..

jasonlife의 이미지

shell command에서 작업하실때 cd 라는 명령 참 많이 쓰시죠?
특히나 "cd -" 는 많이 쓰실겁니다. 그런데 바로 전이 아닌 그 전전이나 그이전 디렉토리로 쉽게 다시가려면 귀찮을때가 있죠. 저는 그렇던데 넘 초짜라 그런가 -.-... 암튼, 어제 tldp에서 팁을 하나 발견해서 알려드립니다.

http://tldp.org/LDP/LGNET/current/marinov.html

acd_func.sh 이라는 스크립트를 PATH 상에 카피하시구, .bashrc 마지막에다가 source acd_func.sh 추가해주신담에 쉘 다시 실행 시키세요..

cd 기존의 기능에 몇가지가 추가 되네요..
cd -- 는 기존에 작업했었던 디렉토리의 히스토리를 10개까지 보여주고, cd -num은 해당 디렉토리로 바로 가게 해주네요..

Forums: 
IsExist의 이미지

bash 를 쓴다면 pushd, popd 가 쓸만합니다.

---------
간디가 말한 우리를 파괴시키는 7가지 요소

첫째, 노동 없는 부(富)/둘째, 양심 없는 쾌락
셋째, 인격 없는 지! 식/넷째, 윤리 없는 비지니스

이익추구를 위해서라면..

다섯째, 인성(人性)없는 과학
여섯째, 희생 없는 종교/일곱째, 신념 없는 정치

hyang의 이미지

IsExist wrote:
bash 를 쓴다면 pushd, popd 가 쓸만합니다.

tcsh 쓰고 있는데, tcsh 에서도 pushd, popd 잘 되더군요;;

pushd, popd가 없었다면 이 험난한 세상 어떻게 살았을지...

우리는 지금 미쳐있는 상태다.

졸곰의 이미지

얼마전 안 사실인데 Windows 2000의 cmd에서도 pushd와 popd가 먹더군요! +_+

Running in the 90's
http://spbear.com

이한길의 이미지

윈도우즈 2000의 cmd가 리눅스 또는 유닉스 쉘 많이 따라 했다는 생각이 듭니다.
파일 이름 다 치지 않고 앞에 몇자 치고 뒤에 *를 쓰는것도...되던데요...

저만 몰랐었는지도...

----
먼저 알게 된 것을 알려주는 것은 즐거운 일이다!
http://hangulee.springnote.com
http://hangulee.egloos.com

버려진의 이미지

*는 MS에서도 쓴지 오래되었습니다. 윈도가 나오기 전부터 있었으니까요.
(MS가 먼저라는 뜻은 아닙니다)
DOS에서 *치는 것 외에 ?도 있죠.

absdkltl
abdklt
abowijtlw
absdt

라는 파일들이 있다면

ab*

하면 모두다 포함되지만

ab???

이라고 하면 absdt만 해당하는..

pool007의 이미지

죄송하지만 누가 pushd와 popd의 사용예를 보여주시면 안될까요?
man을 보고 해보려고 했는데 디렉토리 2개이상은 어떻게 사용하는지
잘 모르겠네요.

--
Passion is like genius; a miracle.

랜덤여신의 이미지

pool007 wrote:
죄송하지만 누가 pushd와 popd의 사용예를 보여주시면 안될까요?
man을 보고 해보려고 했는데 디렉토리 2개이상은 어떻게 사용하는지
잘 모르겠네요.

일단 기억하고 싶은 디렉토리 위치가 있으면, cd 대신 pushd 로 이동합니다.
전 디렉토리로 돌아오고 싶으면 popd 를 입력합니다.
간단하죠?
저장된 디렉토리 목록을 보려면 'dirs' 를 입력하시면 됩니다.

pushd 와 popd 는 쉘 내부 명령어이기 때문에,

help pushd
help popd

로 도움말을 보실 수 있으실 것입니다. :)

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.