cd

更改目录 - 将当前工作目录更改为特定文件夹

语法

  cd [Options] [Directory]

选项

-P    不遵循符号链接
-L    遵循符号链接(默认)

如果给出了directory,则将shell的工作目录更改为directory。如果没有,则更改为HOME(shell变量)

如果目录成功更改,则返回状态为零,否则返回非零
Examples

切换到sybase文件夹

$ cd /usr/local/sybase
$ pwd
/usr/local/sybase

切换到另一个文件夹

$ cd /var/log
$ pwd
/var/log

快速返回

$ cd - 
$ pwd
/usr/local/sybase

切换到上一级目录

$ cd ..
$ pwd
/usr/local/

$ cd (切换到主目录)

切换到当前目录中的fred目录::

$ cd ./fred

cd 命令实例:

linux命令:cd ~/;chmod g-w,o-w ~ ~ g-w,o-w ~/;chmod cd cd ~/;chmod g-w,o-w ~rootopen.com
linux命令:cd ~/;chmod g-w,o-w ~ ~ g-w,o-w ~/;chmod cd cd ~/;chmod g-w,o-w ~rootopen.com
2019-07-09 20:57:08

linux命令:cd - - cd cd -rootopen.com
linux命令:cd - - cd cd -rootopen.com
2018-11-26 23:26:21

linux命令:cd - - cd cd - rootopen.com
linux命令:cd - - cd cd - rootopen.com
2018-07-24 23:10:21

linux命令:cd . . cd cd .rootopen.com
linux命令:cd . . cd cd .rootopen.com
2018-07-24 22:53:31

linux命令:cd ~ ~ cd cd ~rootopen.com
linux命令:cd ~ ~ cd cd ~rootopen.com
2018-07-24 22:48:40

linux命令:cd .. .. cd cd ..rootopen.com
linux命令:cd .. .. cd cd ..rootopen.com
2018-07-24 22:46:08

linux命令:cd /usr/sbin /usr/sbin cd cd /usr/sbinrootopen.com
linux命令:cd /usr/sbin /usr/sbin cd cd /usr/sbinrootopen.com
2018-07-24 22:45:26

linux命令:cd / / cd cd /rootopen.com
linux命令:cd / / cd cd /rootopen.com
2018-07-24 22:43:18

linux命令:cd /this/directory; for f in *; do ln -s `pwd`/$f /that/directory; done done /that/directory; `pwd`/$f -s ln do *; in f for /this/directory; cd cd /this/directory; for f in *; do ln -s `pwd`/$f /that/directory; donerootopen.com
linux命令:cd /this/directory; for f in *; do ln -s `pwd`/$f /that/directory; done done /that/directory; `pwd`/$f -s ln do *; in f for /this/directory; cd cd /this/directory; for f in *; do ln -s `pwd`/$f /that/directory; donerootopen.com
2018-01-11 22:12:48

linux命令:cd ~/.purple/logs/; egrep -ri "i can haz|pwn|l33t|w00|zomg" * | cut -d'/' -f 3 | sort | uniq | xargs -I {} echo "Note to self: ban user '{}'" '{}'" user ban self: to "Note echo {} -I xargs | uniq | sort | 3 -f -d'/' cut | * haz|pwn|l33t|w00|zomg" can "i -ri egrep ~/.purple/logs/; cd cd ~/.purple/logs/; egrep -ri "i can haz|pwn|l33t|w00|zomg" * | cut -d'/' -f 3 | sort | uniq | xargs -I {} echo "Note to self: ban user '{}'"rootopen.com
linux命令:cd ~/.purple/logs/; egrep -ri "i can haz|pwn|l33t|w00|zomg" * | cut -d'/' -f 3 | sort | uniq | xargs -I {} echo "Note to self: ban user '{}'" '{}'" user ban self: to "Note echo {} -I xargs | uniq | sort | 3 -f -d'/' cut | * haz|pwn|l33t|w00|zomg" can "i -ri egrep ~/.purple/logs/; cd cd ~/.purple/logs/; egrep -ri "i can haz|pwn|l33t|w00|zomg" * | cut -d'/' -f 3 | sort | uniq | xargs -I {} echo "Note to self: ban user '{}'"rootopen.com
2018-03-04 05:50:48

linux命令:cd XX YY YY XX cd cd XX YYrootopen.com
linux命令:cd XX YY YY XX cd cd XX YYrootopen.com
2018-02-27 18:45:48

linux命令:cd cd cdrootopen.com
linux命令:cd cd cdrootopen.com
2018-06-07 19:52:48

linux命令:cd - - cd cd -rootopen.com
linux命令:cd - - cd cd -rootopen.com
2018-04-09 05:57:48

linux命令:cd /some/directory \&\& tar cf - | cd /some/directory \&\& tar xvf - */ */ - xvf tar \&\& /some/directory cd | - cf tar \&\& /some/directory cd cd /some/directory \&\& tar cf - | cd /some/directory \&\& tar xvf - */rootopen.com
linux命令:cd /some/directory \&\& tar cf - | cd /some/directory \&\& tar xvf - */ */ - xvf tar \&\& /some/directory cd | - cf tar \&\& /some/directory cd cd /some/directory \&\& tar cf - | cd /some/directory \&\& tar xvf - */rootopen.com
2018-03-21 17:03:48

linux命令:cd // // cd cd //rootopen.com
linux命令:cd // // cd cd //rootopen.com
2018-04-20 11:06:48

linux命令:cd /d d:\Windows d:\Windows /d cd cd /d d:\Windowsrootopen.com
linux命令:cd /d d:\Windows d:\Windows /d cd cd /d d:\Windowsrootopen.com
2018-05-31 17:41:48

linux命令:cd \ \ cd cd \rootopen.com
linux命令:cd \ \ cd cd \rootopen.com
2018-02-11 03:28:48

linux命令:cd - - cd cd -rootopen.com
linux命令:cd - - cd cd -rootopen.com
2018-03-01 00:14:48

linux命令:cd /usr/ports; grep -F "`for o in \`pkg_info -qao\` ; \ do echo "|/usr/ports/${o}|" ; done`" `make -V INDEXFILE` | \ grep -i \|ports@freebsd.org\| | cut -f 2 -d \| \| -d 2 -f cut | \|ports@freebsd.org\| -i grep \ | INDEXFILE` -V `make done`" ; "|/usr/ports/${o}|" echo do \ ; -qao\` \`pkg_info in o "`for -F grep /usr/ports; cd cd /usr/ports; grep -F "`for o in \`pkg_info -qao\` ; \ do echo "|/usr/ports/${o}|" ; done`" `make -V INDEXFILE` | \ grep -i \|ports@freebsd.org\| | cut -f 2 -d \|rootopen.com
linux命令:cd /usr/ports; grep -F "`for o in \`pkg_info -qao\` ; \ do echo "|/usr/ports/${o}|" ; done`" `make -V INDEXFILE` | \ grep -i \|ports@freebsd.org\| | cut -f 2 -d \| \| -d 2 -f cut | \|ports@freebsd.org\| -i grep \ | INDEXFILE` -V `make done`" ; "|/usr/ports/${o}|" echo do \ ; -qao\` \`pkg_info in o "`for -F grep /usr/ports; cd cd /usr/ports; grep -F "`for o in \`pkg_info -qao\` ; \ do echo "|/usr/ports/${o}|" ; done`" `make -V INDEXFILE` | \ grep -i \|ports@freebsd.org\| | cut -f 2 -d \|rootopen.com
2018-05-24 14:07:48

linux命令:cd !$ !$ cd cd !$rootopen.com
linux命令:cd !$ !$ cd cd !$rootopen.com
2018-01-06 23:54:48

linux命令:cd /source/directory; tar cf - . | tar xf - -C /destination/directory /destination/directory -C - xf tar | . - cf tar /source/directory; cd cd /source/directory; tar cf - . | tar xf - -C /destination/directoryrootopen.com
linux命令:cd /source/directory; tar cf - . | tar xf - -C /destination/directory /destination/directory -C - xf tar | . - cf tar /source/directory; cd cd /source/directory; tar cf - . | tar xf - -C /destination/directoryrootopen.com
2018-05-24 22:46:48

linux命令:cd `pwd -P` -P` `pwd cd cd `pwd -P`rootopen.com
linux命令:cd `pwd -P` -P` `pwd cd cd `pwd -P`rootopen.com
2018-04-28 17:30:48

linux命令:cd() { builtin cd "${@:-$HOME}" && ls; } } ls; && "${@:-$HOME}" cd builtin { cd() cd() { builtin cd "${@:-$HOME}" && ls; }rootopen.com
linux命令:cd() { builtin cd "${@:-$HOME}" && ls; } } ls; && "${@:-$HOME}" cd builtin { cd() cd() { builtin cd "${@:-$HOME}" && ls; }rootopen.com
2018-03-07 23:47:48

linux命令:cd !$ !$ cd cd !$rootopen.com
linux命令:cd !$ !$ cd cd !$rootopen.com
2018-06-04 20:28:48

linux命令:cd cd cdrootopen.com
linux命令:cd cd cdrootopen.com
2018-05-21 14:30:48

linux命令:cdrecord -v dev=/dev/cdrom yourimage.iso yourimage.iso dev=/dev/cdrom -v cdrecord cdrecord -v dev=/dev/cdrom yourimage.isorootopen.com
linux命令:cdrecord -v dev=/dev/cdrom yourimage.iso yourimage.iso dev=/dev/cdrom -v cdrecord cdrecord -v dev=/dev/cdrom yourimage.isorootopen.com
2018-05-24 02:11:48

linux命令:cd ~/.mozilla/firefox/ && sqlite3 `cat profiles.ini | grep Path | awk -F= '{print $2}'`/formhistory.sqlite "select * from moz_formhistory" && cd - > /dev/null /dev/null > - cd && moz_formhistory" from * "select $2}'`/formhistory.sqlite '{print -F= awk | Path grep | profiles.ini `cat sqlite3 && ~/.mozilla/firefox/ cd cd ~/.mozilla/firefox/ && sqlite3 `cat profiles.ini | grep Path | awk -F= '{print $2}'`/formhistory.sqlite "select * from moz_formhistory" && cd - > /dev/nullrootopen.com
linux命令:cd ~/.mozilla/firefox/ && sqlite3 `cat profiles.ini | grep Path | awk -F= '{print $2}'`/formhistory.sqlite "select * from moz_formhistory" && cd - > /dev/null /dev/null > - cd && moz_formhistory" from * "select $2}'`/formhistory.sqlite '{print -F= awk | Path grep | profiles.ini `cat sqlite3 && ~/.mozilla/firefox/ cd cd ~/.mozilla/firefox/ && sqlite3 `cat profiles.ini | grep Path | awk -F= '{print $2}'`/formhistory.sqlite "select * from moz_formhistory" && cd - > /dev/nullrootopen.com
2018-05-11 17:58:48

linux命令:cdrecord dev=0,0,0 -v -eject yourimage.iso yourimage.iso -eject -v dev=0,0,0 cdrecord cdrecord dev=0,0,0 -v -eject yourimage.isorootopen.com
linux命令:cdrecord dev=0,0,0 -v -eject yourimage.iso yourimage.iso -eject -v dev=0,0,0 cdrecord cdrecord dev=0,0,0 -v -eject yourimage.isorootopen.com
2018-01-03 17:54:48

linux命令:cd /mnt/old && tar cvf - . | ( cd /mnt/new && tar xvf - ) ) - xvf tar && /mnt/new cd ( | . - cvf tar && /mnt/old cd cd /mnt/old && tar cvf - . | ( cd /mnt/new && tar xvf - )rootopen.com
linux命令:cd /mnt/old && tar cvf - . | ( cd /mnt/new && tar xvf - ) ) - xvf tar && /mnt/new cd ( | . - cvf tar && /mnt/old cd cd /mnt/old && tar cvf - . | ( cd /mnt/new && tar xvf - )rootopen.com
2018-01-29 09:54:48

linux命令:cd $(dirname $(find ~ -name emails.txt)) emails.txt)) -name ~ $(find $(dirname cd cd $(dirname $(find ~ -name emails.txt))rootopen.com
linux命令:cd $(dirname $(find ~ -name emails.txt)) emails.txt)) -name ~ $(find $(dirname cd cd $(dirname $(find ~ -name emails.txt))rootopen.com
2018-02-22 08:31:48

linux命令:cd !$ !$ cd cd !$rootopen.com
linux命令:cd !$ !$ cd cd !$rootopen.com
2018-06-10 22:49:48

linux命令:cd ../"$(ls -F ..|grep '/'|grep -A1 `basename $PWD`|tail -n 1)" 1)" -n $PWD`|tail `basename -A1 '/'|grep ..|grep -F ../"$(ls cd cd ../"$(ls -F ..|grep '/'|grep -A1 `basename $PWD`|tail -n 1)"rootopen.com
linux命令:cd ../"$(ls -F ..|grep '/'|grep -A1 `basename $PWD`|tail -n 1)" 1)" -n $PWD`|tail `basename -A1 '/'|grep ..|grep -F ../"$(ls cd cd ../"$(ls -F ..|grep '/'|grep -A1 `basename $PWD`|tail -n 1)"rootopen.com
2018-01-05 04:39:48

linux命令:cd ../"$(ls -F ..|grep '/'|grep -B1 `basename $PWD`|head -n 1)" 1)" -n $PWD`|head `basename -B1 '/'|grep ..|grep -F ../"$(ls cd cd ../"$(ls -F ..|grep '/'|grep -B1 `basename $PWD`|head -n 1)"rootopen.com
linux命令:cd ../"$(ls -F ..|grep '/'|grep -B1 `basename $PWD`|head -n 1)" 1)" -n $PWD`|head `basename -B1 '/'|grep ..|grep -F ../"$(ls cd cd ../"$(ls -F ..|grep '/'|grep -B1 `basename $PWD`|head -n 1)"rootopen.com
2018-06-04 08:25:48

linux命令:cd "$(mktemp -d)" -d)" "$(mktemp cd cd "$(mktemp -d)"rootopen.com
linux命令:cd "$(mktemp -d)" -d)" "$(mktemp cd cd "$(mktemp -d)"rootopen.com
2018-01-04 04:39:48

linux命令:cd <YOUR_DIRECTORY>; for i in `ls ./`; do tar czvf "$i".tar.gz "$i" ; done done ; "$i" "$i".tar.gz czvf tar do ./`; `ls in i for <YOUR_DIRECTORY>; cd cd <YOUR_DIRECTORY>; for i in `ls ./`; do tar czvf "$i".tar.gz "$i" ; donerootopen.com
linux命令:cd <YOUR_DIRECTORY>; for i in `ls ./`; do tar czvf "$i".tar.gz "$i" ; done done ; "$i" "$i".tar.gz czvf tar do ./`; `ls in i for <YOUR_DIRECTORY>; cd cd <YOUR_DIRECTORY>; for i in `ls ./`; do tar czvf "$i".tar.gz "$i" ; donerootopen.com
2018-02-12 14:10:48

linux命令:cd /example/directory && unzip \*.zip \*.zip unzip && /example/directory cd cd /example/directory && unzip \*.ziprootopen.com
linux命令:cd /example/directory && unzip \*.zip \*.zip unzip && /example/directory cd cd /example/directory && unzip \*.ziprootopen.com
2018-02-21 08:17:48

linux命令:cdparanoia -B -B cdparanoia cdparanoia -Brootopen.com
linux命令:cdparanoia -B -B cdparanoia cdparanoia -Brootopen.com
2018-05-21 23:48:48

linux命令:cd !$:h !$:h cd cd !$:hrootopen.com
linux命令:cd !$:h !$:h cd cd !$:hrootopen.com
2018-04-22 14:02:48

linux命令:cd `dirname $_` $_` `dirname cd cd `dirname $_`rootopen.com
linux命令:cd `dirname $_` $_` `dirname cd cd `dirname $_`rootopen.com
2018-01-11 09:58:48

linux命令:cdrdao read-cd --device ATA:1,1,0 --driver generic-mmc-raw --read-raw image.toc image.toc --read-raw generic-mmc-raw --driver ATA:1,1,0 --device read-cd cdrdao cdrdao read-cd --device ATA:1,1,0 --driver generic-mmc-raw --read-raw image.tocrootopen.com
linux命令:cdrdao read-cd --device ATA:1,1,0 --driver generic-mmc-raw --read-raw image.toc image.toc --read-raw generic-mmc-raw --driver ATA:1,1,0 --device read-cd cdrdao cdrdao read-cd --device ATA:1,1,0 --driver generic-mmc-raw --read-raw image.tocrootopen.com
2018-01-14 20:34:48

linux命令:cdrecord -v path_to_iso_image.iso path_to_iso_image.iso -v cdrecord cdrecord -v path_to_iso_image.isorootopen.com
linux命令:cdrecord -v path_to_iso_image.iso path_to_iso_image.iso -v cdrecord cdrecord -v path_to_iso_image.isorootopen.com
2018-02-08 06:44:48

linux命令:cdrecord -v -blank=all -force -force -blank=all -v cdrecord cdrecord -v -blank=all -forcerootopen.com
linux命令:cdrecord -v -blank=all -force -force -blank=all -v cdrecord cdrecord -v -blank=all -forcerootopen.com
2018-03-26 08:31:48

linux命令:cd() { if [[ "$1" =~ ^\.\.+$ ]];then local a dir;a=${#1};while [ $a -ne 1 ];do dir=${dir}"../";((a--));done;builtin cd $dir;else builtin cd "$@";fi ;} ;} "$@";fi cd builtin $dir;else cd dir=${dir}"../";((a--));done;builtin ];do 1 -ne $a [ dir;a=${#1};while a local ]];then ^\.\.+$ =~ "$1" [[ if { cd() cd() { if [[ "$1" =~ ^\.\.+$ ]];then local a dir;a=${#1};while [ $a -ne 1 ];do dir=${dir}"../";((a--));done;builtin cd $dir;else builtin cd "$@";fi ;}rootopen.com
linux命令:cd() { if [[ "$1" =~ ^\.\.+$ ]];then local a dir;a=${#1};while [ $a -ne 1 ];do dir=${dir}"../";((a--));done;builtin cd $dir;else builtin cd "$@";fi ;} ;} "$@";fi cd builtin $dir;else cd dir=${dir}"../";((a--));done;builtin ];do 1 -ne $a [ dir;a=${#1};while a local ]];then ^\.\.+$ =~ "$1" [[ if { cd() cd() { if [[ "$1" =~ ^\.\.+$ ]];then local a dir;a=${#1};while [ $a -ne 1 ];do dir=${dir}"../";((a--));done;builtin cd $dir;else builtin cd "$@";fi ;}rootopen.com
2018-02-09 01:05:48

linux命令:cd /usr/home && for i in *;do chsh -s bash $i;done $i;done bash -s chsh *;do in i for && /usr/home cd cd /usr/home && for i in *;do chsh -s bash $i;donerootopen.com
linux命令:cd /usr/home && for i in *;do chsh -s bash $i;done $i;done bash -s chsh *;do in i for && /usr/home cd cd /usr/home && for i in *;do chsh -s bash $i;donerootopen.com
2018-03-29 08:00:48

linux命令:cdrecord -v speed=4 driveropts=burnfree dev=/dev/scd0 cd.iso cd.iso dev=/dev/scd0 driveropts=burnfree speed=4 -v cdrecord cdrecord -v speed=4 driveropts=burnfree dev=/dev/scd0 cd.isorootopen.com
linux命令:cdrecord -v speed=4 driveropts=burnfree dev=/dev/scd0 cd.iso cd.iso dev=/dev/scd0 driveropts=burnfree speed=4 -v cdrecord cdrecord -v speed=4 driveropts=burnfree dev=/dev/scd0 cd.isorootopen.com
2018-05-16 00:18:48

linux命令:cdrdao read-cd --read-raw --datafile "`volname /dev/hdc | sed 's/[ ^t]*$//'`".bin --device ATAPI:0,0,0 --driver generic-mmc-raw "`volname /dev/hdc | sed 's/[ ^t]*$//'`".toc ^t]*$//'`".toc 's/[ sed | /dev/hdc "`volname generic-mmc-raw --driver ATAPI:0,0,0 --device ^t]*$//'`".bin 's/[ sed | /dev/hdc "`volname --datafile --read-raw read-cd cdrdao cdrdao read-cd --read-raw --datafile "`volname /dev/hdc | sed 's/[ ^t]*$//'`".bin --device ATAPI:0,0,0 --driver generic-mmc-raw "`volname /dev/hdc | sed 's/[ ^t]*$//'`".tocrootopen.com
linux命令:cdrdao read-cd --read-raw --datafile "`volname /dev/hdc | sed 's/[ ^t]*$//'`".bin --device ATAPI:0,0,0 --driver generic-mmc-raw "`volname /dev/hdc | sed 's/[ ^t]*$//'`".toc ^t]*$//'`".toc 's/[ sed | /dev/hdc "`volname generic-mmc-raw --driver ATAPI:0,0,0 --device ^t]*$//'`".bin 's/[ sed | /dev/hdc "`volname --datafile --read-raw read-cd cdrdao cdrdao read-cd --read-raw --datafile "`volname /dev/hdc | sed 's/[ ^t]*$//'`".bin --device ATAPI:0,0,0 --driver generic-mmc-raw "`volname /dev/hdc | sed 's/[ ^t]*$//'`".tocrootopen.com
2018-04-19 04:19:48

linux命令:cd /etc/init.d && sudo ./apache2 start start ./apache2 sudo && /etc/init.d cd cd /etc/init.d && sudo ./apache2 startrootopen.com
linux命令:cd /etc/init.d && sudo ./apache2 start start ./apache2 sudo && /etc/init.d cd cd /etc/init.d && sudo ./apache2 startrootopen.com
2018-01-07 03:47:48

linux命令:cd() { if [ -z "$1" ]; then command cd; else if [ -f "$1" ]; then command cd $(dirname "$1"); else command cd "$1"; fi; fi; } } fi; fi; "$1"; cd command else "$1"); $(dirname cd command then ]; "$1" -f [ if else cd; command then ]; "$1" -z [ if { cd() cd() { if [ -z "$1" ]; then command cd; else if [ -f "$1" ]; then command cd $(dirname "$1"); else command cd "$1"; fi; fi; }rootopen.com
linux命令:cd() { if [ -z "$1" ]; then command cd; else if [ -f "$1" ]; then command cd $(dirname "$1"); else command cd "$1"; fi; fi; } } fi; fi; "$1"; cd command else "$1"); $(dirname cd command then ]; "$1" -f [ if else cd; command then ]; "$1" -z [ if { cd() cd() { if [ -z "$1" ]; then command cd; else if [ -f "$1" ]; then command cd $(dirname "$1"); else command cd "$1"; fi; fi; }rootopen.com
2018-05-03 12:25:48

linux命令:cd /some/empty/folder/website_diffs/sitename && wget -N http://domain.com/ 2>&1 |grep -q "o newer" || printf "Sites web page appears to have updated.\n\nSuggest you check it out.\n\n"|mail -s "Sites page updated." david@email.com david@email.com updated." page "Sites -s out.\n\n"|mail it check you updated.\n\nSuggest have to appears page web "Sites printf || newer" "o -q |grep 2>&1 http://domain.com/ -N wget && /some/empty/folder/website_diffs/sitename cd cd /some/empty/folder/website_diffs/sitename && wget -N http://domain.com/ 2>&1 |grep -q "o newer" || printf "Sites web page appears to have updated.\n\nSuggest you check it out.\n\n"|mail -s "Sites page updated." david@email.comrootopen.com
linux命令:cd /some/empty/folder/website_diffs/sitename && wget -N http://domain.com/ 2>&1 |grep -q "o newer" || printf "Sites web page appears to have updated.\n\nSuggest you check it out.\n\n"|mail -s "Sites page updated." david@email.com david@email.com updated." page "Sites -s out.\n\n"|mail it check you updated.\n\nSuggest have to appears page web "Sites printf || newer" "o -q |grep 2>&1 http://domain.com/ -N wget && /some/empty/folder/website_diffs/sitename cd cd /some/empty/folder/website_diffs/sitename && wget -N http://domain.com/ 2>&1 |grep -q "o newer" || printf "Sites web page appears to have updated.\n\nSuggest you check it out.\n\n"|mail -s "Sites page updated." david@email.comrootopen.com
2018-03-14 15:43:48

linux命令:cd cd cdrootopen.com
linux命令:cd cd cdrootopen.com
2018-01-04 16:06:48

Linux的Bash命令行(A-Z排序)