linux修改文件名

Linux基础命令

本小妞迷上赌 提交于 2019-11-27 09:59:16
Linux基础命令 格式:命令字 + 【参数】 + 【操作对象】 1、 man + 命令   查看命令的使用帮助( 退出按“q” ) 2、 Ctrl shift +   放大 ; Ctrl -   缩小 3、 ls + ./    查看当前目录下内容 4、 ls + ../    查看上级目录下内容 5、 pwd    查看当前工作路径(目录) 6、cd + 子目录  切入到子目录 7、cd + ../  切入到上级(父)目录 8、cd <=> cd~  一次返回用户主目录 9、cd -  切入到上次进入的目录 10、mkdir + 目录名  可以在当前目录下创建一个目录 11、rmdir + 目录名  只可删除空目录( 此目录下没有任何文件或目录 ) 12、touch + 文件名  可创建一个文件 13、rm + 文件名  可删除文件 14、touch + file1 + file2 ……  可创建多个文件 15、mkdir + dir1 + dir2 ……  同时创建多个子目录 16、rmdir + dir1 + dir2 ……  同时删除多个目录 17、rm + 文件名 + 文件名 + 文件名 ……  同时删多个文件 18、rm + *.txt  删除全部该格式文件 19、mkdir + -p 目录名1/目录名2 ……  创建多级目录 20、rmdir + -p 目录名1

linux 硬连接与软连接

夙愿已清 提交于 2019-11-27 01:11:15
1、linux中文件占用一个inode,inode指向文件内容。 2、文件名可以认为是一个指针,指向inode。硬连接相当于指针的整体拷贝,并不是对文件内容的拷贝。两个文件名(两个指针)都能修改文件,删除一个不影响另外一个,如下: [root@localhost home]# touch aaa [root@localhost home]# cat >aaa hello [root@localhost home]# ln aaa aaa.hl [root@localhost home]# cat >>aaa.hl world [root@localhost home]# more aaa hello world [root@localhost home]# rm -f aaa [root@localhost home]# more aaa.hl hello world 3、软连接相当于指针的引用,删除指针,引用也就无效了。 [root@localhost home]# touch aaa [root@localhost home]# cat >aaa hello [root@localhost home]# ln -s aaa aaa.sl [root@localhost home]# cat >>aaa.sl world [root@localhost home]# more