简体   繁体   中英

How to append the output of bashrc to txtfile

在 Linux 终端中,将 bashrc 的输出附加到文本文件(例如 mybash.txt)的命令字符串是什么我知道在附加时使用双胡萝卜“>>”但不知道如何附加输出bashrc 到文本文件。

You can use cat file >> outfile . If you only want to read the start of the file you can use:

head -N file >> outfile # where N is the numbers of lines you want to write

For the last part of a file you can use:

tail -N file >> outfile # where N is the numbers of lines you want to write

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM