美文网首页
命令行基础

命令行基础

作者: 赤瞳妖精 | 来源:发表于2018-08-10 20:29 被阅读0次

1.ls

List directory contents.

- List files one per line:

ls -1

- List all files, including hidden files:

ls -a

- Long format list (permissions, ownership, size and modification date) of all files:

ls -la

- Long format list with size displayed using human readable units (KB, MB, GB):

ls -lh

- Long format list sorted by size (descending):

ls -lS

- Long format list of all files, sorted by modification date (oldest first):

ls -ltr

2.cat

Print and concatenate files.

- Print the contents of a file to the standard output:

cat file

- Concatenate several files into the target file:

cat file1 file2 > target_file

- Append several files into the target file:

cat file1 file2 >> target_file

- Number all output lines:

cat -n file

3. mv

Move or rename files and directories.

- Move files in arbitrary locations:

mv source target

- Do not prompt for confirmation before overwriting existing files:

mv -f source target

- Do not prompt for confirmation before overwriting existing files but write to standard error before overriding:

mv -fi source target

- Move files in verbose mode, showing files after they are moved:

mv -v source target

4. touch

Change a file access and modification times (atime, mtime).

- Create a new empty file(s) or change the times for existing file(s) to current time:

touch filename

- Set the times on a file to a specific date and time:

touch -t YYYYMMDDHHMM.SS filename

- Use the times from a file to set the times on a second file:

touch -r filename filename2

相关文章

  • Ruby基础知识-基础解释

    Ruby基础知识-基础解释 ruby相关的命令行ruby命令行

  • 命令行基础

    命令行基础 命令行是什么? 命令行界面(command-line interface), 缩写CLI, 是在图形用...

  • Windows相关

    Windows 命令行基础 Windows 的键盘快捷键 wind 命令行工具banbun powershell ...

  • linux基础命令

    命令行基础 一些名词 「图形界面」 「命令行」 「终端」 「shell」 「bash」 安装使用 Windws: ...

  • 命令行作业

    命令行的基础 常用命令行 图示1.ls 显示文件目录列表

  • git命令行基础

    命令行基础 图像界面 图形界面 命令行 终端 shell bash 安装使用 windows:安装git,打开gi...

  • VSCode开发Android版本React Native

    基础设备 1. 依赖包 1.1 React Native命令行工具 1.2 SDK 命令行安装 1.3 配置环境变...

  • 命令行总结

    1.命令行基础 先有命令行,后有的图形界面 Linux (ubuntu)使用终端 unix (macos)使用终端...

  • linux命令行基础

    linux命令行基础 作为一个前端工程师会基本的命令行是必备的要求 名词 [图形界面] [命令行] [终端] [s...

  • 命令行基础

    命令行基础 引用 终端、命令行 **基本命令 pwd 查看当前完整的路径 ~ 代表“家目录” ls 显示所有文...

网友评论

      本文标题:命令行基础

      本文链接:https://www.haomeiwen.com/subject/nhwlbftx.html