5 ms·
GNU Coreutils Cheat Sheet
- doggonematte 14y agocurl -s http://www.gnu.org/software/coreutils/manual/coreutils.html | sed '/<li>.*-inv.*p>:.*[^>]<.a>/!d;s/.*#//;s/-inv.*:/:/;s/<.a>//' |sort "A long, long time ago when I was <em>mastering</em> Linux..." [emphasis mine] I am an amateur, and still learning, so what do I know? But I fail to see any evidence of "mastery" here. And where's the cheat sheet for the binutils? Are they not important? Edit: Added more indentation to protect Kleene stars.
- dbaupp 14y agoTry indenting the code two or three spaces, and then it should be formatted without parsing *'s and so on.
- doggonematte 14y agoSweet. Thanks. I was only indenting by one space.
- pixelbeat 14y agoVery nice! Note if you put the | at the end of the line the whole command is copy and pasteable. Also you could pipe to `column -t -s:` to align nicely Also you can download the 57K index rather than the 1.3M manual to get the command list. curl -s http://www.gnu.org/software/coreutils/manual/html_node/index.html | sed '/<li>.*-inv.*p>:.*[^>]<.a>/!d;s/.*#//;s/-inv.*:/:/;s/<.a>//' | sort | column -t -s:
- michaelhoffman 14y agoA nice effort, but I personally don't find an alphabetical listing very helpful. As doggonematte points out, the coreutils manual has a nice hierarchical structure that makes it easy to find the command I want: http://www.gnu.org/software/coreutils/manual/coreutils.html#toc_Output-of-entire-files http://www.gnu.org/software/coreutils/manual/coreutils.html#...
- dfc 14y agoI always feel compelled to mention joeyh's moreutils whenever a discussion of coreutils comes up. If there was a sequel to coreutils it would be moreutils. chronic: runs a command quietly unless it fails combine: combine the lines in two files using boolean operations ifdata: get network interface info without parsing ifconfig output ifne: run a program if the standard input is not empty isutf8: check if a file or standard input is utf-8 lckdo: execute a program with a lock held mispipe: pipe two commands, returning the exit status of the first parallel: run multiple jobs at once pee: tee standard input to pipes sponge: soak up standard input and write to a file ts: timestamp standard input vidir: edit a directory in your text editor vipe: insert a text editor into a pipe zrun: automatically uncompress arguments to command http://joeyh.name/code/moreutils/ http://joeyh.name/code/moreutils/
- derekp7 14y agoSince several of these utilities you mentioned have to do with piping, I thought I'd mention a bash trick that a lot of people haven't heard of. You can take (almost) any command that takes a file name to read input from, and substitute that file name with: <(command_name) This will run the named command, send its output to a fifo (named pipe), and substitute that fifo's file name in its place. This is useful if you have to feed output from more than one command into a program -- for example, "join" takes two files, only one of them can be standard input. But if you want, you can do something like this: join -j1 1 -j2 1 <(cat somefile |sort) <(cat otherfile |sort) Or, if you want to see syntax highlighted diff output: vim <(diff -uN file1 file2) And it is also nestable: vim <(diff -uN <(command_1) <(command_2))
- pixelbeat 14y agoHere is a similar exposition with links to further info, on GNU and other platforms: http://www.pixelbeat.org/docs/unix_commands/ http://www.pixelbeat.org/docs/unix_commands/
- ashika 14y agothe fact you can download this gnu cheatsheet as xlsx is some delicious irony
- dredmorbius 14y agoGNO Coreutils Cheat Script (debian/ubuntu and other apt-based distros version): for pgm in $( dpkg -L coreutils | grep bin | sed 's,^.*\/,,' ); do man $pgm 2>/dev/null | sed -ne '6p'; done
- gmartres 14y agowhatis -s1 $(dpkg -L coreutils | grep "bin/" | sed 's,^.*\/,,') Should work too (and be a lot faster).
- dredmorbius 14y agoNice. I was trying to remember how to extract the summary lines by themselves. And yes, it's much faster (fewer execs, less manpage formatting and parsing). Note that your solution skips chroot (man section 8). The fix: whatis -s1,8 $(dpkg -L coreutils | grep "bin/" | sed 's,^.*\/,,')
- pixelbeat 14y agoCool! Here is an rpm variant with simplified sed: whatis -s1 $(rpm -ql coreutils | sed -n 's,.*/bin/,,p')
- niels_olson 14y agoI posted a simple redesign of his cheatsheet in the comments, which the author deleted. Bummer. Reposting here: http://nielsolson.us/dropbox/catonmat/gnu-coreutils-cheat-sheet.xlsx http://nielsolson.us/dropbox/catonmat/gnu-coreutils-cheat-sh... http://nielsolson.us/dropbox/catonmat/gnu-coreutils-cheat-sheet.pdf http://nielsolson.us/dropbox/catonmat/gnu-coreutils-cheat-sh... Edited the spreadsheet LibreOffice.
- niels_olson 14y agoUpdate: Peteris asked me to repost. Done. Nice follow up.