ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

Linux基础-文件管理命令

2019-11-08 19:02:50  阅读:262  来源: 互联网

标签:文件 Feb 07 linux 命令 Linux bogon root ssx


文件管理命令:

  1. touch: 创建或更新文件时间
    创建文件
    [root@bogon ssx-linux]# touch file{1..6}
    [root@bogon ssx-linux]# ls
    a b c d e file1 file2 file3 file4 file5 file6
    [root@bogon ssx-linux]# touch file{a,b,c}
    [root@bogon ssx-linux]# ls
    a b c d e file1 file2 file3 file4 file5 file6 filea fileb filec
    [root@bogon ssx-linux]# rm -f file{a..c}
    [root@bogon ssx-linux]# ls
    a b c d e file1 file2 file3 file4 file5 file6
    [root@bogon ssx-linux]# touch file{a..z}
    [root@bogon ssx-linux]# ls
    a c e file2 file4 file6 fileb filed filef fileh filej filel filen filep filer filet filev filex filez
    b d file1 file3 file5 filea filec filee fileg filei filek filem fileo fileq files fileu filew filey
    [root@bogon ssx-linux]#

        ***更新文件时间***

    [root@bogon ssx-linux]# ll
    total 0
    drwxr-xr-x 3 root root 15 Feb 1 06:41 a
    drwxr-xr-x 2 root root 6 Feb 1 06:41 b
    drwxr-xr-x 2 root root 6 Feb 1 06:41 c
    drwxr-xr-x 2 root root 6 Feb 1 06:41 d
    drwxr-xr-x 2 root root 6 Feb 1 06:41 e
    -rw-r--r-- 1 root root 0 Feb 1 07:08 file1
    -rw-r--r-- 1 root root 0 Feb 1 07:08 file2
    -rw-r--r-- 1 root root 0 Feb 1 07:08 file3
    -rw-r--r-- 1 root root 0 Feb 1 07:08 file4
    -rw-r--r-- 1 root root 0 Feb 1 07:08 file5
    -rw-r--r-- 1 root root 0 Feb 1 07:08 file6
    [root@bogon ssx-linux]# touch file{1..6}
    [root@bogon ssx-linux]# ll
    total 0
    drwxr-xr-x 3 root root 15 Feb 1 06:41 a
    drwxr-xr-x 2 root root 6 Feb 1 06:41 b
    drwxr-xr-x 2 root root 6 Feb 1 06:41 c
    drwxr-xr-x 2 root root 6 Feb 1 06:41 d
    drwxr-xr-x 2 root root 6 Feb 1 06:41 e
    -rw-r--r-- 1 root root 0 Feb 1 07:12 file1
    -rw-r--r-- 1 root root 0 Feb 1 07:12 file2
    -rw-r--r-- 1 root root 0 Feb 1 07:12 file3
    -rw-r--r-- 1 root root 0 Feb 1 07:12 file4
    -rw-r--r-- 1 root root 0 Feb 1 07:12 file5
    -rw-r--r-- 1 root root 0 Feb 1 07:12 file6
    [root@bogon ssx-linux]#

  2. stat
    [root@bogon ssx-linux]# stat file6
    File: ‘file6’
    Size: 0 Blocks: 0 IO Block: 4096 regular empty file
    Device: fd00h/64768d Inode: 18796551 Links: 1
    Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
    Access: 2019-02-01 07:12:12.448044258 +0800
    Modify: 2019-02-01 07:12:12.448044258 +0800
    Change: 2019-02-01 07:12:12.448044258 +0800
    Birth: -
    [root@bogon ssx-linux]# vi file6
    [root@bogon ssx-linux]# stat file6
    File: ‘file6’
    Size: 6 Blocks: 8 IO Block: 4096 regular file
    Device: fd00h/64768d Inode: 18796553 Links: 1
    Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
    Access: 2019-02-01 07:15:25.168046803 +0800
    Modify: 2019-02-01 07:15:25.168046803 +0800
    Change: 2019-02-01 07:15:25.173046803 +0800
    Birth: -
    [root@bogon ssx-linux]#

  3. lrzsz
    --yum install -y lrzsz

--上传
rz -E
--回车后选择需要上传的文件
sz test.txt
--回车后选择需要存储下载文件的位置

4.file查看文件类型
[root@wll ~]# file file
file: cannot open (No such file or directory)
[root@wll ~]# file file1
file1: empty
[root@wll ~]# echo "123" > file2
[root@wll ~]# file file2
file2: ASCII text
[root@wll ~]#

标签:文件,Feb,07,linux,命令,Linux,bogon,root,ssx
来源: https://www.cnblogs.com/s-sx/p/11822359.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有