Unix Command 'Cheat Sheets'? 77
"I'm sure you all know the type. When you buy a book on a program/OS/Programming Language, it usually contains a page that lists all the functions or commands followed by a simple 1-2 line description of that command.
Something along the lines of:
ls: Used to display a directory listing.
gcc: GNU C Compiler. Used to compile 'C' files into program code.
etc... - The list continues in this fashion.
I know I could read the various FAQ's. Most FAQ's unfortunately follow the 'FAQ A leads to FAQ B which leads to FAQ C which leads back to FAQ A' format. It would be so much easier for newer users to graze down a list of 50-100+ commands, find one that -looks- sort of like what I want to do and type 'man <command>' for usage information."
grep (Score:2, Informative)
Re:ll (Score:1)
bash: ll: command not found
skully@hailstorm:~:127$ uname -a
Darwin hailstorm.frop.org 1.4 Darwin Kernel Version 1.4: Sat Sep 1 15:31:24 PDT 2001; root:xnu/xnu-194.obj~1/RELEASE_PPC Power Macintosh powerpc
{1}(skully@margin:~)0$ ll
bash: ll: command not found
{2}(skully@margin:~)127$ uname -a
Linux margin 2.2.19-4tr #1 Wed Jun 13 15:36:00 CEST 2001 i586 unknown
zwhite@cliff:/home/zwhite$ ll
ksh: ll: not found
zwhite@cliff:/home/zwhite$ uname -a
OpenBSD cliff 2.9 CLIFF#2 i386
Wow, on a sample of 3 different unix machines I happen to be logged into, not a one has a command called ll. Are you sure you're not just thinking of some lame alias your linux distro included? I've never heard of, or used, the "ll" command.
(Yes, I'm a pedantic bastard)
Re:ll (Score:1)
Some distributions (Mandrake 8 comes to mind) includes a fair set of these aliases, including l, ls, la, ll, lla. Very handy for fast listings without playing with options.
Re:ll (Score:1)
Re:ll (Score:1)
Cart and horse. If you're on a Vim-less system, get the admin to upgrade vi to vim.
(Aside: vim6 is a must have upgrade for vimmers and out now)
Re:ll (Score:2)
Re:ll (Score:1)
Okay, horses for courses.
_If_ you're career makes it absolutely necessary to learn vanilla vi, do so.
If not, vim is so much more capable it is well worth having it added to a system you're using for anything above a shortish time. [IMO; blah, blah.]
BTW, I work in a "hardcore Solaris" shop, as the NT developer (!) and weedled the admin into providing me bash as a shell on the servers and I compile/install vim on them myself.
Vim available via here [vim.org].
Re:ll (Score:2)
Now only learning emacs would be a mistake, but I'm a bit biased
Re:ll (Score:1)
Well, quite.
I can see getting frustrated by the "Oh, that must be a vim extension" reflex, if it's happening a lot.
But if this is only occassionally a problem, not using Vim when you can use Vim seems to be cutting off one's nose to spite one's face.
As for emacs: I tried, but had already been infected with vi, and never got a firm footing on the learning curve. With Vim's burgeoning functionality, I don't 'miss' not having emacsed me'sen anyhow (but then meta-unknowing kicks in at this point).
Re:ll (Score:1)
root@barney:/usr/bin -: file ll
ll: PA-RISC1.1 shared executable dynamically linked
root@barney:/usr/bin -: uname -a
HP-UX barney B.11.00 U 9000/800 675319372 unlimited-user license
its not on AIX 4.3 or Unixware 7.1 though....
(and no my server is not really called barney)
Re:ll (Score:1)
Re:ll (Score:2)
alias lg='ls -la | grep $1'
Of course, you really need to know the commands before you start using all these aliases. It's important.
man (Score:2, Insightful)
You're missing the point. (Score:3, Informative)
I know that in the past, i've known exactly what I want to do (for example, start a new service and open an ipchains port for it from only a certain IP), but what would i look at to fix this?
Just a one command per line index would be wonderful.
Re:You're missing the point. (Score:1)
cat
less commands.txt
or less
or grep foo
(foo=string)
to search it.
Re:man (Score:1)
Re:man (Score:2, Informative)
man -k
You would be surprised how easy it is to find the appropriate topic.
Getting a summary of all commands (Score:2)
I agree that "man -k some_keyword" works well if you already know what you are looking for. But what if you don't know what you don't know? In other words, what if you want a list of all commands and a brief description of what they can do? Here are some variations that might get you a summary of every command:
NOTE: The first example contains a single quoted space character as the argument; the second example contains no characters between the quotes.
The idea is to provide a parameter to the keyword search that would match ALL commands. Hope this helps!
CAVEAT: I don't have a linux box handy to check these on; but I recall using something like this myself, when I was in the same boat many years ago.
Re:Getting a summary of all commands (Score:2)
Re:Getting a summary of all commands (Score:2)
man -k "[aeiou]" > foo
or
man -k "[aeiou]" | enscript
Re:Getting a summary of all commands (Score:1)
Re:Getting a summary of all commands (Score:2)
And if you can't remember man with a switch, you can always just use the "apropos" command.
Of course you need filename completion because I can never spell apropos correctly.
If someone where to ask, I'd say it was spelled apr[TAB]
Re:man (Score:1)
Re:man (Score:1)
Funny thing is (Score:1)
but what do I know...I don't use linux anymore for my *nix experiences...too many linuxisms for my tastes
'apropos' (Score:5, Informative)
Re:'apropos' (Score:1)
check man -k
Cheat Sheets (Score:5, Informative)
Linux Command Card
Slackware System Reference
File System Hierarchy
Samba Configuration
I have a couple for SQL Databases but they are not on the site yet. All these sheets are in PDF format so new users who use Windows can get the commands prior to installing Linux. Also, experienced Linux users will know how to read a PDF.
They are available at:
http://www.hexeon.com/clue/library/
Re:Cheat Sheets (Score:1)
Re:Cheat Sheets (Score:2)
Why PDF (Score:1)
The documents are Licensed under the GNU Free Documentation License, so if someone wants to make a text document by all means go ahead. I just like to use PDF.
Re:Why PDF (Score:2)
Re:Why PDF (Score:2)
Loading up a document in notepad and having it linewrap with non-alphabetic charachters is fugly.
PDF avoids this problem, but with a size trade-off.
Like he said, if you want to make them into text, go for it, but for him, his preference was PDF.
Very nice! (Score:1)
Might be good if.. (Score:1)
A stock Slackware 8.0 install (which I notice happens to be your distro of choice) just gives blank pages.
Perhaps you could include some documentation on how to view the pages?
Re:Might be good if.. (Score:1)
Unix in a Nutshell (Score:3, Informative)
Use its pages to make up cheat-sheets with your favorite commands. I think that's about as simple as it gets with UNIX.
You will probably learn the commands more effectively by producing your own cheat sheets than by purchasing some produced by someone else. However, if that is what you are looking for, check at a university bookstore in the CS section. You can probably find that type of material there.
Re:Unix in a Nutshell (Score:2)
I just wish all distributions would ship this one in their shrink wrap boxes as the technical reference manual.
Re:Unix in a Nutshell (Score:1)
Re:Unix in a Nutshell (Score:1)
Although it doesn't quite fulfill the function of a "cheat sheet", the Intro in my (first) edition contains a quick summary of the major commands, categorised by general function.
Ade_
/
O'reilly's Linux in a netshell (Score:1)
Get O'reilly's "Linux in a netshell" book. This is exactly why I got my first one, and my second one (3rd edition).
There is a section on "linux commands", along with smaller sections on bash,csh/tcsh. A section on emacs and a section on vi. Plus sections on sed and awk.
It is a very nice "quick reference manual" for those times when you need to know what the '-M' option to rdist does.
bash... (Score:1)
these include all the directory navigation things, and a few other useful things
this may be somewhat helpful
Re:sed and awk (Score:3, Interesting)
GNU awk reference is excellent (Score:2)
Gawk has a simple means of using fixed fields which is not available in other awks (there are many awks, but Gawk runs on pretty much any OS - certainly on all major OSes - and it's free).
Gawk is like perl, only more elegant, and lacking the network sockets. Gawk and netcat in combination can do most anything perl can do, though, and often faster.
--Charlie
Command Reference Cards (Score:2, Informative)
Some quick cheet sheets (Score:3, Informative)
http://hotwired.lycos.com/webmonkey/reference/u
http://hotwired.lycos.com/webmonkey/html/97/02/
Role 'yer own (Score:2, Informative)
a) I couldn't find one I liked, some are out there if you search but I want one with all the stuff I forget and only the stuff I forget, and
b) When I type it out with a description for the cheet sheet I tend to remember it more.
Because of the effect b) has on a) the document gets revised regularly. It's not that much to maintain after the initial bulk has been written.
I was once going to write a web page that would let you select 4 or 6 topics that you wanted out of a list of who knows how many and they would be presented to you on a web page in a format that you could print nicely, but that never happened :-( Hey CowboyNeil, feel like adding it to slash?
Another failed chance to put search engines to use (Score:5, Informative)
Here are some of the more promising results of a search [google.com] from google.com [google.com] (String used was :unix ref card pdf)
Unix Cheat Sheet [geocities.com]
Unix Cheat Sheet [buffalo.edu]
From Rice University [bilkent.edu.tr] : Very basic
Another [uni-jena.de] Too large and outdated
Selection of Unix, Vi, and Emacs refferences [ualberta.ca] Courtesy Univ. of Alberta.ca
You should be able to find what you need easy enough. I should also highly reccommend to everyone the linuxsecurity.com Linux Security guidesheet. Damn good reading to hardening your system. Here [linuxsecurity.com]
Toodles
Re:Another failed chance to put search engines to (Score:1)
Re:Another failed chance to put search engines to (Score:1)
I rather like the second cheat sheet though.
Re:Another failed chance to put search engines to (Score:1)
What a nice helpful guy[?] like you doing posting at 0?
`man intro` (Score:2)
For some reason Linux doesn't have a command reference there the way other ones do.
Command references and apropos (Score:3, Informative)
http://www.ssc.com/ssc/productlist.html [ssc.com].
A useful online tool, when paired with man pages, is the 'apropos' command. It can be used to search summaries of command functions to find the right command, then you can read the man page for that tool. For example:
# apropos search
apropos (1) - search the whatis database for strings
find (1) - search for files in a directory hierarchy
lkbib (1) - search bibliographic databases
lookbib (1) - search bibliographic databases
manpath (1) - determine user's search path for man pages
whatis (1) - search the whatis database for complete words.
zgrep (1) - search possibly compressed files for a regular expression
So, you can read these descriptions, and if one sounds like the tool you're looking for, call up the man page for that particular utility using "man".
For those missing man pages on the system, you can use my (somewhat outdated) man page web gateway at http://www.sonic.net/cgi-bin/man [sonic.net].
Happy Linuxing!
-Dane (last seen driving the North Bay backroads in a red 2001 Porsche Carerra with the California license plate "LINUX")
My favorite for translating from OS to OS (Score:1)
Great for figuring out how to do X on OS Y if you know how to fo it on OS Z. Except windows.
Another site (Score:1)
O'Reilly Nutshell series (Score:1)
For Unix:
http://www.oreilly.com/catalog/unixnut3/ [oreilly.com]
For Linux:
http://www.oreilly.com/catalog/linuxnut3/ [oreilly.com]
a few useful resources (Score:3, Interesting)
Failing that, a quick search through google or google groups.
Some people prefer printed materials, however, and I know that one of the folks here always seems to go for one book which just has the quick usage of most shell commands [but well, she doesn't get in for a few hours, and it wasn't obvious in her stacks of books] She also had the Linux Command Reference, published by the Linux Journal, which is slightly bigger than the ORA pocket books, but still very portable.
Once of the books that I started out with was the UNIX System Administration Handbook [amazon.com], which I've heard includes linux in the latest version. It's not cheap, it's not small, but it nicely organizes things by topic, and points out possible pitfalls.
My 3x5 cards are a goldmine (Score:1)
Over the years of using Unix systems, whenever I need to work at figuring what command line combinations work for what I need, or what obscure command does something powerful, I write it down on an index card and file it away. Most of these you would never run across in the basic Unix books, although I'll bet most of these can be found in the blue Unix Power Tools book somewhere. In general, these are from Usenet postings gleaned from searches, after man pages turned up nothing (man -k doesn't often help if you don't already know what to look for). Some examples:
viewing a man page outside of the regular search path for man
dynamic linkage dependencies
sort files by size
I have seen the light. Xargs is the light. Learn to love xargs
Inplace editing of files
Trace system calls. Very useful!
how about ls (Score:1)
KidA
More useful: a list of one-liners (Score:4, Informative)
ls -at | head -n1 : list the most recently modified file in the current directory
ps h -u user | awk '{print $1}' | xargs kill -9 : terminate all jobs owned by user.
Re:More useful: a list of one-liners (Score:1)
Slashcode, at least the way it is set up at slashdot, sucks.
I just tried to give a very useful sed code example for renaming mp3s, and the lameness filter was 'encountered'. Yes, the filter is a bastion of lameness.
As I cannot simply C&P my example, I will type it out for you longhand.
for i in *.mp3
do
mv "$i" "`echo $i | sed 'see below'`"
done
Okay, here we go: s slash caret backslash open-paren dot dot backslash close-paren space dash space backslash open-paren dot splat backslash close-paren space dash space backslash open-paren dot splat backslash close-paren dot m p 3 dollar sign slash backslash 1 space dash space backslash 3 dot m p 3 slash
For those who don't know, a splat is an asterisk. Everything else should be clear if you know english; If you don't, I suggest you learn it before trying to read my posts anyway :) My text should be easily decodable, at least. I'd try including a perl script to decode it, but the lameness filter would probably reject it. I only typed all that out (with appropriate C&P) in the first place to make a point, anyway. I'll leave any scripting to you.
How about this? (Score:1)
[RICE.EDU] [rice.edu]
wow (Score:1)