linux下建立软链接
实例: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下建立软链接相关推荐
- 怎么在linux下使用ftp服务器,怎么在Linux下建立安全的FTP服务器?
怎么在Linux下建立安全的FTP服务器? 2018-08-31 15:53 分享人:老牛 学习Linux系统时,你可能会遇到网络服务的问题,这里将介绍linux FTP服务器安全及DHCP服务的实现 ...
- LINUX下建立临时文件: mkstemp
LINUX下建立临时的方法(函数)有很多, mktemp, tmpfile等等. 今天只推荐最安全最好用的一种: mkstemp. mkstemp (建立唯一临时文件) 头文件: #include & ...
- linux 下建立硬链接和软连接
对于一个文件来说,有唯一的索引接点(inode)与之对应,而对于一个索引接点号,却可以有多个文件名与之对应.因此,在磁盘上的同一个文件可以通过不同的路径去访问该文件.注意在Linux下是一切皆文件的啊 ...
- buntu linux下建立stm32开发环境: GCC安装以及工程Makefile建立
之前在e络盟的意法半导体掏了一个STM32开发板挺好的,却不想在window下开发,也不想用那么占内存的IAR MDK等软件,所以决定在ubuntu下建立该开发环境,像之前avr linux一样,找了 ...
- ubuntu linux下建立stm32开发环境: 程序烧录 openocd+openjtag
原文出处: http://blog.csdn.net/embbnux/article/details/17619621 之前建立stm32开发环境,程序也已经编译好生成main.bin,接下来就是要把 ...
- nuttx linux 编译,linux下建立nuttx开发环境
1.安装ARM Toolchain.(也可以选择使用buildroot自己搭建开发环境,不过我在linux下使用ARM Toolchain觉得挺好用,官方的开发环境也能够比较好支持ARM Toolch ...
- 在linux下创建软链接(即目录映射)
在linux中创建软链接,使用命令:ln -s. 语法:ln -s 源文件 目标文件. 转载于:https://www.cnblogs.com/walk-the-Line/p/5532530.html
- Linux下创建软链接
创建软链接: ln -s /newdisk/app-tpl/apache-tomcat-7.0.47/webapps/app-tpl-webapp/ /newdisk/UCMSServer/tomca ...
- 【Linux】Linux下建立和管理逻辑卷
目录: --------------------------------------------------- 1,概述 1 2,基本原理 1 3,建立逻辑卷 1 建立物理卷 1 建立 ...
最新文章
- 【直播】张晋:心跳信号分类模型融合
- Linux使用百度云
- Nagios+Centreon+Nrpe集成(二)
- 非阻塞模式与阻塞模式
- 2021云栖大会开源引力峰会发布的战略合作,Grafana服务到底是什么?
- Qt学习笔记-http服务的初步认识(使用程序下载网站上的图片)
- C# 自定义类型通过实现IFormattable接口,来输出指定的格式和语言文化的字符串(例:DateTime)...
- SQL注入攻击原理与防御措施
- Android性能测试用例
- OpenGL图形渲染管线(Pipeline)学习
- Vue仿淘宝购物车网页
- H3C交换机版本升级
- H. Zebras and Ocelots -ICPC North Central NA Contest 2017
- jQuery拖拽图片拼图验证插件
- element 给table设置thead和tbody
- CCF系列题解--2018年3月第三题 URL映射
- csgo原始输入开不开_CSGO职业哥参数配置:帅气猪猪JW
- 【励志篇】我的创业历程总结
- linux修改显示日期格式,centos面板日期格式调整
- autojs快阅读协议脚本源代码免费分享
热门文章
- 超级实用(附技巧)——用word与谷歌翻译将英文PDF文档翻译成中文,免费无限制
- Java-append()方法
- 【Python_笔记】openpyxl中Workbook()和.load_workbook()区别
- 如何使服务具备高可用性
- mysql之连接查询
- Oracle中修改表列名(SQL语句)
- 浅谈MYSQL之级联复制(附带实验)
- ubuntu如何卸载软件
- 交通 流量 时间序列预测,神经网络 机器学习 BPNN
- 辨别 利用AAC转成无损格式音乐 的假无损