mkdir

创建新文件夹(如果不存在)

语法

  mkdir [Options] folder...

  mkdir "Name with spaces"

选项

-m, --mode=MODE   设置权限模式 (如chmod中)
-p, --parents     若所要建立目录的上层目录目前尚未建立,则会一并建立上层目录
    --verbose     为每个创建的目录打印一条消息

mkdir创建标准目录 ,当前文件夹的. (点) 和 父目录的… (点点)

包含空格的文件夹名称在某些应用程序中可以显示为“Name%20with%20spaces”这是因为20是十六进制空格的Ascii代码。

实例

在目录/home 下建立子目录test,并且只有文件主有读、写和执行权限,其他人无权访问

$ mkdir -m 700 /home/test

mkdir 命令实例:

linux命令:mkdir -p /path/{folder1,folder2,folder3,folder4} /path/{folder1,folder2,folder3,folder4} -p mkdir mkdir -p /path/{folder1,folder2,folder3,folder4}rootopen.com
linux命令:mkdir -p /path/{folder1,folder2,folder3,folder4} /path/{folder1,folder2,folder3,folder4} -p mkdir mkdir -p /path/{folder1,folder2,folder3,folder4}rootopen.com
2019-02-25 22:39:28

linux命令:mkdir [[folder]] && cd $_ $_ cd && [[folder]] mkdir mkdir [[folder]] && cd $_rootopen.com
linux命令:mkdir [[folder]] && cd $_ $_ cd && [[folder]] mkdir mkdir [[folder]] && cd $_rootopen.com
2018-10-17 23:35:24

linux命令:mkdir [folder-name] && $_ $_ && [folder-name] mkdir mkdir [folder-name] && $_rootopen.com
linux命令:mkdir [folder-name] && $_ $_ && [folder-name] mkdir mkdir [folder-name] && $_rootopen.com
2018-10-10 23:22:03

linux命令:mkdir -p src && chmod 777 src && docker run -v $(pwd)/src:/var/www/html wordpress:cli core download && chmod 755 src src 755 chmod && download core wordpress:cli $(pwd)/src:/var/www/html -v run docker && src 777 chmod && src -p mkdir mkdir -p src && chmod 777 src && docker run -v $(pwd)/src:/var/www/html wordpress:cli core download && chmod 755 srcrootopen.com
linux命令:mkdir -p src && chmod 777 src && docker run -v $(pwd)/src:/var/www/html wordpress:cli core download && chmod 755 src src 755 chmod && download core wordpress:cli $(pwd)/src:/var/www/html -v run docker && src 777 chmod && src -p mkdir mkdir -p src && chmod 777 src && docker run -v $(pwd)/src:/var/www/html wordpress:cli core download && chmod 755 srcrootopen.com
2018-09-11 09:55:30

linux命令:mkdir -p a/long/directory/path a/long/directory/path -p mkdir mkdir -p a/long/directory/pathrootopen.com
linux命令:mkdir -p a/long/directory/path a/long/directory/path -p mkdir mkdir -p a/long/directory/pathrootopen.com
2018-05-18 21:40:48

linux命令:mkdir /Volumes/sshdisk 2> /dev/null; sshfs user@server:/ /Volumes/sshdisk -oreconnect,volname=SSHDisk -oreconnect,volname=SSHDisk /Volumes/sshdisk user@server:/ sshfs /dev/null; 2> /Volumes/sshdisk mkdir mkdir /Volumes/sshdisk 2> /dev/null; sshfs user@server:/ /Volumes/sshdisk -oreconnect,volname=SSHDiskrootopen.com
linux命令:mkdir /Volumes/sshdisk 2> /dev/null; sshfs user@server:/ /Volumes/sshdisk -oreconnect,volname=SSHDisk -oreconnect,volname=SSHDisk /Volumes/sshdisk user@server:/ sshfs /dev/null; 2> /Volumes/sshdisk mkdir mkdir /Volumes/sshdisk 2> /dev/null; sshfs user@server:/ /Volumes/sshdisk -oreconnect,volname=SSHDiskrootopen.com
2018-05-27 09:07:48

linux命令:mkdir -p work/{d1,d2}/{src,bin,bak} work/{d1,d2}/{src,bin,bak} -p mkdir mkdir -p work/{d1,d2}/{src,bin,bak}rootopen.com
linux命令:mkdir -p work/{d1,d2}/{src,bin,bak} work/{d1,d2}/{src,bin,bak} -p mkdir mkdir -p work/{d1,d2}/{src,bin,bak}rootopen.com
2018-06-09 18:02:48

linux命令:mkdir -p doc/{text/,img/{wallpaper/,photos/}} doc/{text/,img/{wallpaper/,photos/}} -p mkdir mkdir -p doc/{text/,img/{wallpaper/,photos/}}rootopen.com
linux命令:mkdir -p doc/{text/,img/{wallpaper/,photos/}} doc/{text/,img/{wallpaper/,photos/}} -p mkdir mkdir -p doc/{text/,img/{wallpaper/,photos/}}rootopen.com
2018-02-23 14:03:48

linux命令:mkdir() { /bin/mkdir $@ && eval cd "\$$#"; } } "\$$#"; cd eval && $@ /bin/mkdir { mkdir() mkdir() { /bin/mkdir $@ && eval cd "\$$#"; }rootopen.com
linux命令:mkdir() { /bin/mkdir $@ && eval cd "\$$#"; } } "\$$#"; cd eval && $@ /bin/mkdir { mkdir() mkdir() { /bin/mkdir $@ && eval cd "\$$#"; }rootopen.com
2018-02-22 23:36:48

linux命令:mkdir $(date +%Y%m%d) +%Y%m%d) $(date mkdir mkdir $(date +%Y%m%d)rootopen.com
linux命令:mkdir $(date +%Y%m%d) +%Y%m%d) $(date mkdir mkdir $(date +%Y%m%d)rootopen.com
2018-01-16 12:41:48

linux命令:mkdir `date | sed 's/[: ]/_/g'` ]/_/g'` 's/[: sed | `date mkdir mkdir `date | sed 's/[: ]/_/g'`rootopen.com
linux命令:mkdir `date | sed 's/[: ]/_/g'` ]/_/g'` 's/[: sed | `date mkdir mkdir `date | sed 's/[: ]/_/g'`rootopen.com
2017-12-28 06:23:48

linux命令:mkdir `date --iso` --iso` `date mkdir mkdir `date --iso`rootopen.com
linux命令:mkdir `date --iso` --iso` `date mkdir mkdir `date --iso`rootopen.com
2018-03-12 21:41:48

linux命令:mkdir -p /cdrom/unnamed_cdrom ; mount -F hsfs -o ro `ls -al /dev/sr* |awk '{print "/dev/" $11}'` /cdrom/unnamed_cdrom /cdrom/unnamed_cdrom $11}'` "/dev/" '{print |awk /dev/sr* -al `ls ro -o hsfs -F mount ; /cdrom/unnamed_cdrom -p mkdir mkdir -p /cdrom/unnamed_cdrom ; mount -F hsfs -o ro `ls -al /dev/sr* |awk '{print "/dev/" $11}'` /cdrom/unnamed_cdromrootopen.com
linux命令:mkdir -p /cdrom/unnamed_cdrom ; mount -F hsfs -o ro `ls -al /dev/sr* |awk '{print "/dev/" $11}'` /cdrom/unnamed_cdrom /cdrom/unnamed_cdrom $11}'` "/dev/" '{print |awk /dev/sr* -al `ls ro -o hsfs -F mount ; /cdrom/unnamed_cdrom -p mkdir mkdir -p /cdrom/unnamed_cdrom ; mount -F hsfs -o ro `ls -al /dev/sr* |awk '{print "/dev/" $11}'` /cdrom/unnamed_cdromrootopen.com
2018-02-23 04:38:48

linux命令:mkdir phrack66; (cd phrack66; for n in {1..17} ; do echo "http://www.phrack.org/issues.html?issue=66&id=$n&mode=txt" ; done | xargs wget) wget) xargs | done ; "http://www.phrack.org/issues.html?issue=66&id=$n&mode=txt" echo do ; {1..17} in n for phrack66; (cd phrack66; mkdir mkdir phrack66; (cd phrack66; for n in {1..17} ; do echo "http://www.phrack.org/issues.html?issue=66&id=$n&mode=txt" ; done | xargs wget)rootopen.com
linux命令:mkdir phrack66; (cd phrack66; for n in {1..17} ; do echo "http://www.phrack.org/issues.html?issue=66&id=$n&mode=txt" ; done | xargs wget) wget) xargs | done ; "http://www.phrack.org/issues.html?issue=66&id=$n&mode=txt" echo do ; {1..17} in n for phrack66; (cd phrack66; mkdir mkdir phrack66; (cd phrack66; for n in {1..17} ; do echo "http://www.phrack.org/issues.html?issue=66&id=$n&mode=txt" ; done | xargs wget)rootopen.com
2018-01-07 12:31:48

linux命令:mkdir $(printf '%03d\n' {1..100}) {1..100}) '%03d\n' $(printf mkdir mkdir $(printf '%03d\n' {1..100})rootopen.com
linux命令:mkdir $(printf '%03d\n' {1..100}) {1..100}) '%03d\n' $(printf mkdir mkdir $(printf '%03d\n' {1..100})rootopen.com
2018-04-17 15:52:48

linux命令:mkdir 0{0..9}{0..9};mv 000 100 100 000 0{0..9}{0..9};mv mkdir mkdir 0{0..9}{0..9};mv 000 100rootopen.com
linux命令:mkdir 0{0..9}{0..9};mv 000 100 100 000 0{0..9}{0..9};mv mkdir mkdir 0{0..9}{0..9};mv 000 100rootopen.com
2018-04-18 00:18:48

linux命令:mkdir !* !* mkdir mkdir !*rootopen.com
linux命令:mkdir !* !* mkdir mkdir !*rootopen.com
2018-03-15 03:14:48

linux命令:mkdir myicons && find /usr/share/icons/ -type f | xargs cp -t myicons myicons -t cp xargs | f -type /usr/share/icons/ find && myicons mkdir mkdir myicons && find /usr/share/icons/ -type f | xargs cp -t myiconsrootopen.com
linux命令:mkdir myicons && find /usr/share/icons/ -type f | xargs cp -t myicons myicons -t cp xargs | f -type /usr/share/icons/ find && myicons mkdir mkdir myicons && find /usr/share/icons/ -type f | xargs cp -t myiconsrootopen.com
2018-05-31 06:25:48

linux命令:mkdir myicons; find /usr/share/icons/ -type f -exec cp {} ./myicons/ \; \; ./myicons/ {} cp -exec f -type /usr/share/icons/ find myicons; mkdir mkdir myicons; find /usr/share/icons/ -type f -exec cp {} ./myicons/ \;rootopen.com
linux命令:mkdir myicons; find /usr/share/icons/ -type f -exec cp {} ./myicons/ \; \; ./myicons/ {} cp -exec f -type /usr/share/icons/ find myicons; mkdir mkdir myicons; find /usr/share/icons/ -type f -exec cp {} ./myicons/ \;rootopen.com
2018-03-31 16:23:48

linux命令:mkdir dir; cd $_ $_ cd dir; mkdir mkdir dir; cd $_rootopen.com
linux命令:mkdir dir; cd $_ $_ cd dir; mkdir mkdir dir; cd $_rootopen.com
2018-05-04 05:12:48

linux命令:mkdir $(date +%Y_%m_%d) +%Y_%m_%d) $(date mkdir mkdir $(date +%Y_%m_%d)rootopen.com
linux命令:mkdir $(date +%Y_%m_%d) +%Y_%m_%d) $(date mkdir mkdir $(date +%Y_%m_%d)rootopen.com
2018-05-02 00:35:48

linux命令:mkdir $(date +%F) +%F) $(date mkdir mkdir $(date +%F)rootopen.com
linux命令:mkdir $(date +%F) +%F) $(date mkdir mkdir $(date +%F)rootopen.com
2018-05-01 01:38:48

linux命令:mkdir {1..100} {1..100} mkdir mkdir {1..100}rootopen.com
linux命令:mkdir {1..100} {1..100} mkdir mkdir {1..100}rootopen.com
2018-02-20 09:28:48

linux命令:mkdir copy{1,2}; gzip -dc file.tar.gz | tee >( tar x -C copy1/ ) | tar x -C copy2/ copy2/ -C x tar | ) copy1/ -C x tar >( tee | file.tar.gz -dc gzip copy{1,2}; mkdir mkdir copy{1,2}; gzip -dc file.tar.gz | tee >( tar x -C copy1/ ) | tar x -C copy2/rootopen.com
linux命令:mkdir copy{1,2}; gzip -dc file.tar.gz | tee >( tar x -C copy1/ ) | tar x -C copy2/ copy2/ -C x tar | ) copy1/ -C x tar >( tee | file.tar.gz -dc gzip copy{1,2}; mkdir mkdir copy{1,2}; gzip -dc file.tar.gz | tee >( tar x -C copy1/ ) | tar x -C copy2/rootopen.com
2018-01-17 20:42:48

linux命令:mkdir /home/dhinesh/dir1/{dir2,dir3,dir4}/file1.txt -p -p /home/dhinesh/dir1/{dir2,dir3,dir4}/file1.txt mkdir mkdir /home/dhinesh/dir1/{dir2,dir3,dir4}/file1.txt -prootopen.com
linux命令:mkdir /home/dhinesh/dir1/{dir2,dir3,dir4}/file1.txt -p -p /home/dhinesh/dir1/{dir2,dir3,dir4}/file1.txt mkdir mkdir /home/dhinesh/dir1/{dir2,dir3,dir4}/file1.txt -prootopen.com
2018-01-24 01:36:48

linux命令:mkdir save && for f in *.mp3; do lame -b xxx "$f" ./save/"${f%.mp3}.mp3"; done done ./save/"${f%.mp3}.mp3"; "$f" xxx -b lame do *.mp3; in f for && save mkdir mkdir save && for f in *.mp3; do lame -b xxx "$f" ./save/"${f%.mp3}.mp3"; donerootopen.com
linux命令:mkdir save && for f in *.mp3; do lame -b xxx "$f" ./save/"${f%.mp3}.mp3"; done done ./save/"${f%.mp3}.mp3"; "$f" xxx -b lame do *.mp3; in f for && save mkdir mkdir save && for f in *.mp3; do lame -b xxx "$f" ./save/"${f%.mp3}.mp3"; donerootopen.com
2018-02-24 12:08:48

linux命令:mkdir /tmp/dir1/{0..20} /tmp/dir1/{0..20} mkdir mkdir /tmp/dir1/{0..20}rootopen.com
linux命令:mkdir /tmp/dir1/{0..20} /tmp/dir1/{0..20} mkdir mkdir /tmp/dir1/{0..20}rootopen.com
2018-02-20 05:50:48

linux命令:mkdir ${1..10} ${1..10} mkdir mkdir ${1..10}rootopen.com
linux命令:mkdir ${1..10} ${1..10} mkdir mkdir ${1..10}rootopen.com
2018-03-28 09:51:48

linux命令:mkdir /home/foo/doc/bar && cd $_ $_ cd && /home/foo/doc/bar mkdir mkdir /home/foo/doc/bar && cd $_rootopen.com
linux命令:mkdir /home/foo/doc/bar && cd $_ $_ cd && /home/foo/doc/bar mkdir mkdir /home/foo/doc/bar && cd $_rootopen.com
2018-06-02 01:46:48

linux命令:mkdir replaced;for i in *; do cat "$i"| sed 's/foo/bar/' > "replaced/$i"; done done "replaced/$i"; > 's/foo/bar/' sed "$i"| cat do *; in i replaced;for mkdir mkdir replaced;for i in *; do cat "$i"| sed 's/foo/bar/' > "replaced/$i"; donerootopen.com
linux命令:mkdir replaced;for i in *; do cat "$i"| sed 's/foo/bar/' > "replaced/$i"; done done "replaced/$i"; > 's/foo/bar/' sed "$i"| cat do *; in i replaced;for mkdir mkdir replaced;for i in *; do cat "$i"| sed 's/foo/bar/' > "replaced/$i"; donerootopen.com
2018-04-23 10:25:48

linux命令:mkdir rotated; for v in *.3gp; do ffmpeg -i $v -vf transpose=2 -vcodec ffv1 rotated/${v/3gp/avi} ; done done ; rotated/${v/3gp/avi} ffv1 -vcodec transpose=2 -vf $v -i ffmpeg do *.3gp; in v for rotated; mkdir mkdir rotated; for v in *.3gp; do ffmpeg -i $v -vf transpose=2 -vcodec ffv1 rotated/${v/3gp/avi} ; donerootopen.com
linux命令:mkdir rotated; for v in *.3gp; do ffmpeg -i $v -vf transpose=2 -vcodec ffv1 rotated/${v/3gp/avi} ; done done ; rotated/${v/3gp/avi} ffv1 -vcodec transpose=2 -vf $v -i ffmpeg do *.3gp; in v for rotated; mkdir mkdir rotated; for v in *.3gp; do ffmpeg -i $v -vf transpose=2 -vcodec ffv1 rotated/${v/3gp/avi} ; donerootopen.com
2018-06-09 13:40:48

linux命令:mkdir r1 && sshfs remote1:/home/user r1 && rsync r1/stuff remote2:~/backups/ remote2:~/backups/ r1/stuff rsync && r1 remote1:/home/user sshfs && r1 mkdir mkdir r1 && sshfs remote1:/home/user r1 && rsync r1/stuff remote2:~/backups/rootopen.com
linux命令:mkdir r1 && sshfs remote1:/home/user r1 && rsync r1/stuff remote2:~/backups/ remote2:~/backups/ r1/stuff rsync && r1 remote1:/home/user sshfs && r1 mkdir mkdir r1 && sshfs remote1:/home/user r1 && rsync r1/stuff remote2:~/backups/rootopen.com
2018-02-28 11:40:48

linux命令:mkdir -p /path/to/folder.d; \cd $_ $_ \cd /path/to/folder.d; -p mkdir mkdir -p /path/to/folder.d; \cd $_rootopen.com
linux命令:mkdir -p /path/to/folder.d; \cd $_ $_ \cd /path/to/folder.d; -p mkdir mkdir -p /path/to/folder.d; \cd $_rootopen.com
2018-01-07 20:00:48

linux命令:mkdir -p temp && for f in *.pdf ; do qpdf --password=YOURPASSWORDHERE --decrypt "$f" "temp/$f"; done && mv temp/* . && rm -rf temp temp -rf rm && . temp/* mv && done "temp/$f"; "$f" --decrypt --password=YOURPASSWORDHERE qpdf do ; *.pdf in f for && temp -p mkdir mkdir -p temp && for f in *.pdf ; do qpdf --password=YOURPASSWORDHERE --decrypt "$f" "temp/$f"; done && mv temp/* . && rm -rf temprootopen.com
linux命令:mkdir -p temp && for f in *.pdf ; do qpdf --password=YOURPASSWORDHERE --decrypt "$f" "temp/$f"; done && mv temp/* . && rm -rf temp temp -rf rm && . temp/* mv && done "temp/$f"; "$f" --decrypt --password=YOURPASSWORDHERE qpdf do ; *.pdf in f for && temp -p mkdir mkdir -p temp && for f in *.pdf ; do qpdf --password=YOURPASSWORDHERE --decrypt "$f" "temp/$f"; done && mv temp/* . && rm -rf temprootopen.com
2018-03-09 05:27:48

linux命令:mkdir Epub ; mv -v --target-directory=Epub $(fgrep -lr epub *) *) epub -lr $(fgrep --target-directory=Epub -v mv ; Epub mkdir mkdir Epub ; mv -v --target-directory=Epub $(fgrep -lr epub *)rootopen.com
linux命令:mkdir Epub ; mv -v --target-directory=Epub $(fgrep -lr epub *) *) epub -lr $(fgrep --target-directory=Epub -v mv ; Epub mkdir mkdir Epub ; mv -v --target-directory=Epub $(fgrep -lr epub *)rootopen.com
2018-05-07 17:35:48

linux命令:mkdir tmp ; cd tmp ; zcat ../initrd.gz | cpio -i -i cpio | ../initrd.gz zcat ; tmp cd ; tmp mkdir mkdir tmp ; cd tmp ; zcat ../initrd.gz | cpio -irootopen.com
linux命令:mkdir tmp ; cd tmp ; zcat ../initrd.gz | cpio -i -i cpio | ../initrd.gz zcat ; tmp cd ; tmp mkdir mkdir tmp ; cd tmp ; zcat ../initrd.gz | cpio -irootopen.com
2018-02-04 00:04:48

linux命令:mkdir -v `date +%W`W +%W`W `date -v mkdir mkdir -v `date +%W`Wrootopen.com
linux命令:mkdir -v `date +%W`W +%W`W `date -v mkdir mkdir -v `date +%W`Wrootopen.com
2017-12-31 01:17:48

linux命令:mkdir <dir name> name> <dir mkdir mkdir <dir name>rootopen.com
linux命令:mkdir <dir name> name> <dir mkdir mkdir <dir name>rootopen.com
2018-01-25 05:02:48

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