实例:ln -s /home/gamestat /gamestat

linux下的软链接类似于windows下的快捷方式

ln -s a b 中的 a 就是源文件b链接文件名,其作用是当进入b目录,实际上是链接进入了a目录

如上面的示例,当我们执行命令 cd /gamestat/的时候 实际上是进入了 /home/gamestat/
值得注意的是执行命令的时候,应该是a目录已经建立,目录b没有建立。我最开始操作的是也把b目录给建立了,结果就不对了

删除软链接:

   rm -rf  b  注意不是rm -rf  b/

ln a b 是建立硬链接

建立链接的使用方法如下:

  [root@WEB_YQ_64_79 /]# ln --helpUsage: ln [OPTION]... [-T] TARGET LINK_NAME   (1st form)or:  ln [OPTION]... TARGET                  (2nd form)or:  ln [OPTION]... TARGET... DIRECTORY     (3rd form)or:  ln [OPTION]... -t DIRECTORY TARGET...  (4th form)In the 1st form, create a link to TARGET with the name LINK_NAME.In the 2nd form, create a link to TARGET in the current directory.In the 3rd and 4th forms, create links to each TARGET in DIRECTORY.Create hard links by default, symbolic links with --symbolic.When creating hard links, each TARGET must exist.Mandatory arguments to long options are mandatory for short options too.--backup[=CONTROL]      make a backup of each existing destination file-b                          like --backup but does not accept an argument-d, -F, --directory         allow the superuser to attempt to hard linkdirectories (note: will probably fail due tosystem restrictions, even for the superuser)-f, --force                 remove existing destination files-n, --no-dereference        treat destination that is a symlink to adirectory as if it were a normal file-i, --interactive           prompt whether to remove destinations-s, --symbolic              make symbolic links instead of hard links-S, --suffix=SUFFIX         override the usual backup suffix-t, --target-directory=DIRECTORY  specify the DIRECTORY in which to createthe links-T, --no-target-directory   treat LINK_NAME as a normal file-v, --verbose               print name of each file before linking--help     display this help and exit--version  output version information and exitThe backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.The version control method may be selected via the --backup option or throughthe VERSION_CONTROL environment variable.  Here are the values:none, off       never make backups (even if --backup is given)numbered, t     make numbered backupsexisting, nil   numbered if numbered backups exist, simple otherwisesimple, never   always make simple backup

linux下建立软链接相关推荐

  1. 怎么在linux下使用ftp服务器,怎么在Linux下建立安全的FTP服务器?

    怎么在Linux下建立安全的FTP服务器? 2018-08-31 15:53 分享人:老牛 学习Linux系统时,你可能会遇到网络服务的问题,这里将介绍linux FTP服务器安全及DHCP服务的实现 ...

  2. LINUX下建立临时文件: mkstemp

    LINUX下建立临时的方法(函数)有很多, mktemp, tmpfile等等. 今天只推荐最安全最好用的一种: mkstemp. mkstemp (建立唯一临时文件) 头文件: #include & ...

  3. linux 下建立硬链接和软连接

    对于一个文件来说,有唯一的索引接点(inode)与之对应,而对于一个索引接点号,却可以有多个文件名与之对应.因此,在磁盘上的同一个文件可以通过不同的路径去访问该文件.注意在Linux下是一切皆文件的啊 ...

  4. buntu linux下建立stm32开发环境: GCC安装以及工程Makefile建立

    之前在e络盟的意法半导体掏了一个STM32开发板挺好的,却不想在window下开发,也不想用那么占内存的IAR MDK等软件,所以决定在ubuntu下建立该开发环境,像之前avr linux一样,找了 ...

  5. ubuntu linux下建立stm32开发环境: 程序烧录 openocd+openjtag

    原文出处: http://blog.csdn.net/embbnux/article/details/17619621 之前建立stm32开发环境,程序也已经编译好生成main.bin,接下来就是要把 ...

  6. nuttx linux 编译,linux下建立nuttx开发环境

    1.安装ARM Toolchain.(也可以选择使用buildroot自己搭建开发环境,不过我在linux下使用ARM Toolchain觉得挺好用,官方的开发环境也能够比较好支持ARM Toolch ...

  7. 在linux下创建软链接(即目录映射)

    在linux中创建软链接,使用命令:ln -s. 语法:ln -s 源文件 目标文件. 转载于:https://www.cnblogs.com/walk-the-Line/p/5532530.html

  8. Linux下创建软链接

    创建软链接: ln -s /newdisk/app-tpl/apache-tomcat-7.0.47/webapps/app-tpl-webapp/ /newdisk/UCMSServer/tomca ...

  9. 【Linux】Linux下建立和管理逻辑卷

    目录: --------------------------------------------------- 1,概述 1 2,基本原理 1 3,建立逻辑卷     1 建立物理卷     1 建立 ...

最新文章

  1. 【直播】张晋:心跳信号分类模型融合
  2. Linux使用百度云
  3. Nagios+Centreon+Nrpe集成(二)
  4. 非阻塞模式与阻塞模式
  5. 2021云栖大会开源引力峰会发布的战略合作,Grafana服务到底是什么?
  6. Qt学习笔记-http服务的初步认识(使用程序下载网站上的图片)
  7. C# 自定义类型通过实现IFormattable接口,来输出指定的格式和语言文化的字符串(例:DateTime)...
  8. SQL注入攻击原理与防御措施
  9. Android性能测试用例
  10. OpenGL图形渲染管线(Pipeline)学习
  11. Vue仿淘宝购物车网页
  12. H3C交换机版本升级
  13. H. Zebras and Ocelots -ICPC North Central NA Contest 2017
  14. jQuery拖拽图片拼图验证插件
  15. element 给table设置thead和tbody
  16. CCF系列题解--2018年3月第三题 URL映射
  17. csgo原始输入开不开_CSGO职业哥参数配置:帅气猪猪JW
  18. 【励志篇】我的创业历程总结
  19. linux修改显示日期格式,centos面板日期格式调整
  20. autojs快阅读协议脚本源代码免费分享

热门文章

  1. 超级实用(附技巧)——用word与谷歌翻译将英文PDF文档翻译成中文,免费无限制
  2. Java-append()方法
  3. 【Python_笔记】openpyxl中Workbook()和.load_workbook()区别
  4. 如何使服务具备高可用性
  5. mysql之连接查询
  6. Oracle中修改表列名(SQL语句)
  7. 浅谈MYSQL之级联复制(附带实验)
  8. ubuntu如何卸载软件
  9. 交通 流量 时间序列预测,神经网络 机器学习 BPNN
  10. 辨别 利用AAC转成无损格式音乐 的假无损