我试图弄清楚每个字在使用linux的文件中发生了多少次。
通过使用下面的代码,我已经将文件中的每个单词放到了一个新行中。
sed -i 's/ /\n/g' books2
我现在正试图用空格替换单词的开头和结尾,因为有些单词包含标点符号。我目前正在使用下面的代码来完成这个任务,但是它似乎不起作用。一旦我有了这个命令,我将能够运行一个命令,它将对所有单词进行计数,并返回所有单词的计数列表。有人能纠正我如何删除标点符号吗?
sed -i 's/\([^[:alpha:]]\)$//' books2 #this is my attempt to remove the
来自apt-get的输出:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
aptitude-common libboost-iostreams1.53.0 libcwidget3 libept1.4.12
Suggested packages:
aptitude-doc-en aptitude-doc tasksel debtags libcwid
我的文本文件如下所示:
If you are a software developer in your 20s or 30s, you've grown up in a world dominated by Linux. It has been a significant player in the data center for decades, and while it's hard to find definitive operating system market share reports, Linux's share of data center opera
我无法通过以下命令在linux上使用附加配置文件启动jvm:
java -Xverify:none -agentlib:JPIBootLoader=JPIAgent:server=enabled;CGProf TestClass
我收到以下错误:
Error occurred during initialization of VM
agent library failed to init: JPIBootLoader
CGProf: command not found
在windows上,上述命令成功运行,我从类的main方法中获得消息。
linux详细信息
uname -a LinuxMic
我有一个包含如下内容的文件file.txt
i love this world
I hate stupid managers
I love linux
I have MS
当我执行以下操作时:
for line in `cat file.txt`; do
echo $line
done
它给出了如下输出
I
love
this
world
I
..
..
但是我需要像下面这样的整行输出--有什么想法吗?
i love this world
I hate stupid managers
I love linux
I have MS