所有关于mkdir命令 (38)

我们可以通过在括号之间列出并用逗号分隔来创建多个子文件夹,而不是键入单独的命令来创建各种子文件夹

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

其他方案不起作用(缺少cd命令)

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

为了使它更加实用,请确保您可以使用密钥对登录到ssh服务器。

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

不是一个发现,而是一个非常有用的发现。在上面的例子中,日期格式是'yyyymmdd'。对于其他可能的格式,请参阅'man date'。此命令在使用别名时也非常方便:alias mkdd ='mkdir $(date +%Y%m%d)'

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

用ISO 8601格式(yyyy-mm-dd)创建一个以当前日期命名的目录。用于按日期存储备份。 --iso开关只能用于GNU日期,对其他日期版本可以使用格式字符串参数。

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

这将允许您在Solaris SPARC 9或更低版本上安装CD-ROM。由于无效和卷管理守护进程,这在Solaris 10上不起作用.www.fir3net.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
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

上班路上早上好读,但可悲的是,整个问题66的.tar.gz还没有在phrack的网站上。所以使用wget下载。

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

没有外部命令,但只能做0-99,而不是1-100,所以我们稍后再调整它

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

非常基本,但是谁知道..mkdir!$也应该工作,只使用'最后'参数。 - 2再次执行cd Desktop / Notes。'man history'中的更多提示

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

今天我需要选择一个应用程序的图标。我更简单的方法:将所有/ usr / share /图标放在myicons文件夹中,并使用鹦鹉螺做brows'em。然后rm -r'整个目录。

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

用xargs的其他方式,只能用find -exec

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
  • 1
  • 2
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

推荐
    热门命令