how to ______ using the CLI?

Posted:
in Genius Bar edited January 2014
to my understanding if its the option to do something is built into osx's unix core there more than likey is a way to do it through commandline...



What I'm looking for are some links to "how to ____ using the cli" don't ask why, I guess I am just curious to see how things are done through the command line.



For example: imaging and burning cd/dvds; activating sharepoints (not just setting users and groups, but activating them for osxserver)<--mind you this in my mentality would come in damn hand if one needed to ssh into the server to do some maintenence.



Lemme know if any of you more experienced cli people here have any leads to enlightenment... thanks

Comments

  • Reply 1 of 5
    well, cd burning on *nix is dominated by the 'cdrecord' program (you can get it with fink). it works with osx too. i had some trouble with it and my old yamaha burner, but i did manage to get it to work a few times. haven't tried it on my newer burner.



    as for sharepoints, i'm not sure exactly what you are referring to. i'm thinking samba (SMB, CFIS), and i'll presume thats what you meant. creating samba shares can be done by simply editing a file (and then restarting the samba server). so you can open up your favorite cli text editor (i like emacs, some prefer vi, others pico, nano, and i'm sure there are more). i don't remember off hand where the file is, but i remember it being kind of difficult to get the hang of.



    if you want to learn to do a lot on the cli, you should know about man-pages. type 'man man' to get started there. just about every cli program has an associated man page. if you install cdrecord, for example, the man page can be reached by typing 'man cdrecord'.



    if you are an absolute beginner with the cli, you should read up on 'tcsh'. that's osx's default shell. when you type something on the cli, the shell is what is reading it, then it starts up other programs to handle ur commands (sometimes it can handle commands without starting up new programs). you should also learn about 'ls', and 'cd'. cd changes your 'current working directory'. so, after you 'cd' to a directory, all commands you execute will work from that directory (there are exeptions to this though). 'ls' lists the contents of a directory (without args, it lists the cwd). 'pwd' is useful sometimes, it prints the current working directory.
  • Reply 2 of 5
    Quote:

    Originally posted by thuh Freak

    if you want to learn to do a lot on the cli, you should know about man-pages. type 'man man' to get started there. just about every cli program has an associated man page. if you install cdrecord, for example, the man page can be reached by typing 'man cdrecord'.



    if you are an absolute beginner with the cli, you should read up on 'tcsh'. that's osx's default shell. when you type something on the cli, the shell is what is reading it, then it starts up other programs to handle ur commands (sometimes it can handle commands without starting up new programs)...




    heya, thanks a lot for your length reply... sorta feel like I wasted you time not explaining my understanding of nix and the whole cli shabang. I'm more or less self taught in the ordeal. It all started in highschool when this sysadmin railed into my head the 3digit-deal on how chmod works. So I have a pretty good idea on how user/groups/ and basic commands of moving around cd/ls/pwd/chmod/chgrp/chown/. And I can also say with great regret that I continue to make a mess of things when I su into root for extended periods of time



    Furthermore I do know about man man, and that there's/should man pages on most everything. Here's my dilemma, as embarassing as it is to admit it. A). I have trouble understanding some man pages (i.e. combining flags, and just the way they word stuff. B). I must not ever know what there are man pages for, is there a list of all the documents that have man pages, if so I guess I've just completely missed something...



    once again thanks for your feedback, hope you might be able to provide that something thats holding me back...I got this strange feeling that I'm missing just one bit of information to a whole scope of knowledge.
  • Reply 3 of 5
    baumanbauman Posts: 1,248member
    If you're looking for a specific command, try typing 'apropos share', or whatever type of command your are looking for.



    Another great way to learn about things is by looking through the /bin, /sbin, /usr/bin, and /usr/sbin folders. Just by seeing names and typing man you can get an idea of things that you can do.



    I'm in about the same place that you are... self-taught, and I know the basics. It's really hard to find good tutorials beyond that point.



    As far as what has a man page, you can type 'echo $MANPATH' to see where your system is looking for the pages. Then in each one of those there are folders, and within those are the actual pages.
  • Reply 4 of 5
    Quote:

    Originally posted by Dark Seraph

    Furthermore I do know about man man, and that there's/should man pages on most everything. Here's my dilemma, as embarassing as it is to admit it. A). I have trouble understanding some man pages (i.e. combining flags, and just the way they word stuff. B). I must not ever know what there are man pages for, is there a list of all the documents that have man pages, if so I guess I've just completely missed something...



    once again thanks for your feedback, hope you might be able to provide that something thats holding me back...I got this strange feeling that I'm missing just one bit of information to a whole scope of knowledge.




    well, i dont have osx nearby, but my debian "man man" page shows a '-k' option to search through man pages. i never used it, cuz i tend to google first, a quick test showed that if you do 'man -k ftp' it returns a list of man pages that match the search term (in my case 'ftp'), with their section in parenthesis, and a one liner description. so that's probably useful. if you want a list of all your man pages, you first have to discover your MANPATH. this is usually an environment variable (the environment is a collection of variables, which you can set and usually change to give programs hints about things, and change their behavior). if you do 'echo $MANPATH' you can see the value of your MANPATH. it is a colon ( separated list of places to look for man pages. inside each of those directories, is usually folders named 'manX', where X is a number from 1-9 (or so). the 1-9 are the sections. most programs are in sections 1 and 8 (there are standards, requiring programs to be in certain sections, and i don't know the rule off hand).



    with most GNU programs (programs made by the fsf, and programs that are part of the GNU Project) have a '--help' or '-h' option (many other programs, not associated with the GNU also have a '--help' or '-h' option). so for a program like gcc (the GNU C compiler), if you type 'gcc --help' it will print out a list of command line options, with a description and sometimes common uses. many cli programs require that switches (the dash options), preceed other arguments. with the default mac os x version of 'ls' this is valid: 'ls -l ~', but this is not: 'ls ~ -l'. many cli programs don't have this restriction (like the GNU version of ls), so switches can be interspersed with other args. another thing that may be tripping you up is the way the shell handles white-space and other special characters. if i try to ls a folder named "my folder" like this 'ls my folder', ls will try to list the two folders, 'my' and 'folder' (which may or may not exist). but if i quote the real folder name like this: ls "my folder", or like this ls 'my folder', the shell will pass of "my folder" (without the quotes) to ls, and ls will handle it correclty. The difference between double quotes and single is explained in tcsh man page (as well as other shell's man pages); basically, double quotes allow you to insert environment variables, and strange characters, where single-quotes are literal.



    can u give me an example of a program and what options u are trying to use, that doesn't work? i can probably more easily see the problem that way.
  • Reply 5 of 5
    baumanbauman Posts: 1,248member
    Yeah, 'man -k' and 'apropos' and 'whatis' all do the same thing... they search through for commands and their descriptions for matches.
Sign In or Register to comment.