“cat foo foo foo 做了什么”?

发布于 2024-12-01 16:38:09 字数 185 浏览 2 评论 0原文

嘿,我想为 UNIX 准备各种基本命令,因此我需要这个 ans。 unix 中 cat foo foo foo 的输出是什么?我很困惑它会显示 foo 文件的输出三次还是我可能不知道的其他内容? 任何帮助表示赞赏?

更新:实际上我没有安装UNIX,我只是准备测试。我知道这个问题不应该被问,但除了这个之外我没有其他方法。甚至我已经搜索过它。

hey i wana prepare for various basic commands for unix so for that i need this ans.
what is the output of cat foo foo foo in unix?I m confused will it display the output of foo file three times or anything else that i may not know?
any help is appreciated?

UPDATE: actually i m not having UNIX installed and i m just preparing for test.I know this question is not to be asked but there is no other means to me except this.and even i have searched for it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

筑梦 2024-12-08 16:38:09

尝试使用联机帮助页 (man cat)。

cat [-benstuv] [文件...]

cat 实用程序按顺序读取文件 [...]

是的,它将显示 foo 三次。

Try using the manpages (man cat).

cat [-benstuv] [file ...]

The cat utility reads files sequentially [...]

Yes, it will display foo three times.

囍孤女 2024-12-08 16:38:09

它们将被视为三个不同的文件,因此您将获得 foo 内容的三倍

They will be considered as three different files, so you would get three time the content of foo

断念 2024-12-08 16:38:09

依次显示 foo 的内容 3 次。更好,阅读man cat

Display the contents of foo three times one after other. Better, read man cat

凡尘雨 2024-12-08 16:38:09

有趣的是,似乎没有人注意到它所做的不仅仅是复制文件 foo 的内容?
显示foo文件内容3次后,直接显示文件does内容!

从技术上讲,cat 不会在命令行中查看文件名,除了读取文件。

这意味着它“不知道”一个文件被使用了三次。这意味着它不利用文件名重复的信息。但是,诸如第一次保存内容,然后再将其写出两次之类的操作无论如何都是无效的 - 文件可能在第一次读取时已更改。

连接四个文件的内容,这就是它的作用!

而且 - 这就是 cat 被命名为 cat 的原因 - 它用于连接文件!

我的意思是,这个标题确实可能是一个很好的诡计问题 - 几句话就充满了混乱。

Funny, it looks like nobody noticed that it does more that replicating the contents of file foo?
It shows the content of the file does directly after three times showing the content of file foo!

Technically, cat does not look at the file names in the command line, except for reading the files.

That means it "does not know" that one file is used three times. What it means is that it does not make use of the information that a file name is repeated. But something like saving the content the first time, and write it out two more times would be invalid anyway - the file could have changed while reading the first time.

Concatenating the content of four files, that's what it does!

And - that's why cat is named cat - it is for concatenating files!

I mean, that title could really be a nice trick question - lots of confusion in few words.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文