Live data from Hacker News

Linux utils that you might not know

shiroyasha.io

1–10 of 159 posts

Re: Linux utils that you might not know

#2
As much as people make fun of him for caring so much about a seemingly minor point, I've come around to understanding RMS's frustration about people calling all of the GNU project "Linux". This sort of title drives home why: neither Linus nor anyone else on the Linux project had anything to do with any of this.

Re: Linux utils that you might not know

#3

As much as people make fun of him for caring so much about a seemingly minor point, I've come around to understanding RMS's frustration about people calling all of the GNU project "Linux". This sort of title drives home why: neither Linus nor anyone else on the Linux project had anything to do with any of this.

and on the contrary: aside from the title, is anything in this article specific to Linux?

Re: Linux utils that you might not know

#4
There is also another command 'paste'.

Example: Created two files (1.txt and 2.txt)

[efg@fedori ~]$ cat 1.txt

file1: line1

file1: line2

[efg@fedori ~]$ cat 2.txt

file2: line1

file2: line2

In order to merge the lines of these two files we can use paste:

[efg@fedori ~]$ paste 1.txt 2.txt

file1: line1 file2: line1

file1: line2 file2: line2

Also check out 'man fold'

Re: Linux utils that you might not know

#5

As much as people make fun of him for caring so much about a seemingly minor point, I've come around to understanding RMS's frustration about people calling all of the GNU project "Linux". This sort of title drives home why: neither Linus nor anyone else on the Linux project had anything to do with any of this.

If someone wrote an article titled "Windows utils that you might not know," I would not expect it's content to be solely applications written by Microsoft.

Re: Linux utils that you might not know

#6

As much as people make fun of him for caring so much about a seemingly minor point, I've come around to understanding RMS's frustration about people calling all of the GNU project "Linux". This sort of title drives home why: neither Linus nor anyone else on the Linux project had anything to do with any of this.

I think a better title would probably be "Common Unix utils that you might not know" or "GNU Coreutils that you might not know" (as some of the things that he is using seem to be coreutils-only?)

Re: Linux utils that you might not know

#8
* 'comm -3' is a quick way to do a set difference from the command line.

* Newer versions of sort have an option for running sorts in parallel. If you're using an older sort, you can split the files, sort them individually with GNU parallel, and use --merge to combine them.

* If you have scripts that read data files, process them, and output more files, consider using a Makefile.

* tmux is a good way to leave a development session on a server that you come back to at the start of the day, or that you run long-running processes in.

* Setting a soft ulimit system-wide is a good way to avoid accidentally running the machine out of memory, causing your C libraries to be paged out to disk, and usually requiring a reboot. Since it's soft, you can override it at any time.

* strace and gdb can be run on just about anything to see what it's doing. If it's an interpreted language, you can often attach to a live process, call a function to invoke some interpreted code, and not have to kill & restart the process to fix a bug or oversight. Or you can attach to a Postgres worker process to get a stack trace, which often tells you why your query is slow if it runs so long you can't get an explain analyze.

* Look in /proc to find tons of useful information about running processes and settings. For example, you can tell how many filehandles a process has open, and sometimes what file it corresponds to. Just yesterday, a grub update caused a server to boot the kernel with the command line replaced with 2 random characters and a newline, which would be harder to debug without /proc/cmdline.

* pushd and popd are useful in shell scripts to temporarily change directories without forgetting where you were.

Post reply on HN