用终端View the File System+ Show files at the root (/) directory ``` ls -F1 / | grep -v / ``` + Show files in user's home directory cd; ls + Show files in the parent directory ls .. + Show files in a specified directory ls /path/to/that/directory Tally Files+ Tally the number of directories from a given starting point ``` ls -l | grep "^d" | wc -l ``` + Tally the number of symbolic links from a given starting point ``` ls -l | grep "^l" | wc -l ```+ Tally the number of text files from a given starting point ``` find . -maxdepth 1 | xargs file {} \; | grep ASCII | wc -l ```+ Tally the number of shell scripts from a given starting point+ Tally the number of data files from a given starting point+ Tally the number of symbolic links from a given starting point+ Draw a histogram showing the relative numbers of different file types Search for files+ Search for a file by name+ Search for a file by inode number ``` ls -i find . -inum 393520 2> /dev/null ```+ Search for a file by owner+ Search for a file by size+ Search for files that have been modified recently+ Search for files that contain a certain string of characters View files+ Select a file for viewing view hello.c+ View a file in hexadecimal format ``` xxd x.bin ``` + View the top 20 lines of a file ``` head -n 20 somefiles.txt ```
时间: 2024-01-20 13:04:17 浏览: 31
+ View the bottom 10 lines of a file ``` tail -n 10 somefile.txt ```+ View a file's contents in real-time as they are added/modified ``` tail -f somefile.txt ```+ View the contents of a compressed file without decompressing it ``` zcat somefile.gz ```+ View a file's permissions and ownership information ``` ls -l somefile.txt ```+ View a file's contents in a pager such as less or more ``` less somefile.txt ```
相关问题
ls -lrt /fileSystem/out_file/tgInfo/exp_file/ |grep -v other解读
这个命令是在Linux系统中执行的。让我来解读一下每个部分的含义:
- `ls` 是列出文件和目录的命令。
- `-lrt` 是 `ls` 命令的选项之一,用于按照文件的修改时间从旧到新进行排序,并以长格式显示详细信息。
- `/fileSystem/out_file/tgInfo/exp_file/` 是要列出文件的目录路径。
- `|` 是管道符号,用于将前一个命令的输出作为后一个命令的输入。
- `grep` 是一个用于文本搜索的命令。
- `-v` 是 `grep` 命令的选项之一,用于反转匹配,即只显示不包含指定模式的行。
- `other` 是要排除的模式,只显示不包含该模式的行。
所以,这个命令的含义是列出 `/fileSystem/out_file/tgInfo/exp_file/` 目录中最近修改的文件,并排除包含 "other" 的文件。
ls -p $SRC_ROOT_DIR | grep -v /
这个命令的作用是列出 `$SRC_ROOT_DIR` 目录下的所有文件和目录,并排除目录。它使用 `ls` 命令列出目录内容,`-p` 参数在目录名称后面添加斜杠以标识它们是目录,然后使用 `grep` 命令过滤掉带有斜杠的行,即排除目录。
请确保将 `$SRC_ROOT_DIR` 替换为实际的源代码根目录路径。