Results 1 to 6 of 6

Thread: Question about command line commands

  1. #1
    Join Date
    Aug 2009
    Beans
    124

    Question about command line commands

    Well, not really a help question so I decided to take this to the Community Cafe...here goes...

    Are command line commands Lunix (Linux/Unix) standard? Like, will sudo apt-get install x work in, say, Red Hat provided that RH has a package repo and that x is a package in RH*?

    Or are they shell-dependent? Like, I can create my own shell, but finds the sound of "sudo" awkward so I have a command "pika" instead which does everything sudo does.

    *Okay, so I've really never tried RH so pardon me if this sounds nonsense.

  2. #2
    Join Date
    Sep 2010
    Location
    Aotearoa
    Beans
    59

    Re: Question about command line commands

    I think the shell is actually comprised of a set of applications, so long as the other distros have all the programs then the commands will work.
    However some have different programs to do the same things such as yum instead of apt in redhat.
    "I don't have a problem with someone using their talents to become successful, I just don't think the highest calling is success." - Richard Stallman
    sudo apt-get mail
    package not found

  3. #3
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Question about command line commands

    Redhat is based on rpm, so apt-get won't work, although PCLOS also uses rpm, but also uses apt and synpatic.

    Otherwise, except for package management, the basic commands are the same for almost all distributions.

  4. #4
    Join Date
    Dec 2010
    Location
    Fukuoka, Japan
    Beans
    1,064
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Question about command line commands

    A lot of commands are standard. cp, mkdir, mv etc. will probably be found in most distros. However, as vehemoth said, commands are actually programs so it depends on what you have installed on your system. Not all distros use the aptitude/apt-get programs so trying to run apt-get on another distro might not work. Same with sudo. Sudo is not a universal Linux program.

  5. #5
    Join Date
    May 2008
    Beans
    1,427
    Distro
    Ubuntu Development Release

    Re: Question about command line commands

    Think of the commands as text-based applications instead of codes/commands.

  6. #6
    Join Date
    Nov 2005
    Location
    Sendai, Japan
    Beans
    11,296
    Distro
    Kubuntu

    Re: Question about command line commands

    You need to differentiate between two things: commands that are built into the shell (also called "builtins") and commands that run external programs. For a builtin to work, you just need to install (and use) the shell in question. For a command that runs an external program to work, you must install any shell, plus the program in question. Both apt-get and sudo are external programs, so in order to use them you must install a shell of your choice, plus the programs apt-get or sudo. In Ubuntu, both are installed by default.

    To be able to use a command (be it a builtin or an external program) under another name, you can use an alias, most if not all shells suport this. For an external program, you can also just rename the executable...
    Last edited by Bachstelze; August 14th, 2011 at 06:32 AM.
    「明後日の夕方には帰ってるからね。」


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •