Basic commands in Linux: Difference between revisions
wikademia>Emesee m Basic commands in linux moved to Basic commands in Linux |
wikademia>Wikademia m moved Alpha:Basic commands in Linux to Basic commands in Linux over redirect |
||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
[[w:Unix-like|Unix-like]] [[operating system]]s require a working knowledge of several basic commands. [[w:Unix|Unix®]], [[w:Linux|Linux]], [[w:Berkeley Software Distribution|BSD]] and such use a ubiquitous set of these based on the [[w:Single UNIX Specification|Single UNIX Specification]]. Learning to operate a [[command line interface]] is a key skill in learning [[Linux]] and [[BSD]]. | |||
== Basic commands == | |||
{| class=" wikitable sortable" | |||
|+ IEEE Std 1003.1-2001 utilities | |||
|- | |||
!style="width:10em;"| Name | |||
!style="width:15em;"| Category | |||
!style=""| Description | |||
!style="width:5em;;"| First appeared | |||
|- | |||
| [[w:admin (Unix)|admin]] | |||
| [[w:Source Code Control System|SCCS]] | |||
| Create and administer [[w:Source Code Control System|SCCS]] files | |||
| | |||
|- | |||
| [[w:Alias (command)|alias]] | |||
| Misc | |||
| Define or display aliases | |||
| | |||
|- | |||
| [[w:ar (Unix)|ar]] | |||
| Misc | |||
| Create and maintain [[w:Library (computing)|library]] archives | |||
| | |||
|- | |||
| [[w:asa (Unix)|asa]] | |||
| Text Processing | |||
| Interpret carriage-control characters | |||
| | |||
|- | |||
| [[w:at (Unix)|at]] | |||
| Process Management | |||
| Execute commands at a later time | |||
| Version 7 AT&T UNIX | |||
|- | |||
| [[w:AWK (programming language)|awk]] | |||
| Text processing | |||
| Pattern scanning and processing language | |||
| Version 7 AT&T UNIX | |||
|- | |||
| [[w:basename|basename]] | |||
| Filesystem | |||
| Return non-directory portion of a pathname | |||
| | |||
|- | |||
| [[w:batch (Unix)|batch]] | |||
| Process Management | |||
| Schedule commands to be executed in a batch queue | |||
| | |||
|- | |||
| [[w:bc programming language|bc]] | |||
| Misc | |||
| [[w:Arbitrary-precision arithmetic|Arbitrary-precision arithmetic]] language | |||
| | |||
|- | |||
| [[w:bg (Unix)|bg]] | |||
| Process Management | |||
| Run jobs in the background | |||
| | |||
|- | |||
| [[w:break (Unix)|break]] | |||
| Shell programming | |||
| Exit from [[w:for loop|for]], [[w:while loop|while]], or [[w:until|until]] [[w:Control flow#Loops|loop]] | |||
| | |||
|- | |||
| [[w:c99_(Unix)|c99]] | |||
| C Programming | |||
| [[w:compiler|Compile]] standard [[w:C (programming language)|C]] programs | |||
| | |||
|- | |||
| [[w:cal (Unix)|cal]] | |||
| Misc | |||
| Print a calendar | |||
| Version 5 AT&T UNIX | |||
|- | |||
| [[w:cat (Unix)|cat]] | |||
| Filesystem | |||
| Concatenate and print files | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:cd (command)|cd]] | |||
| Filesystem | |||
| Change the working directory | |||
| | |||
|- | |||
| [[w:cflow|cflow]] | |||
| C Programming | |||
| Generate a C-language [[w:flowgraph|flowgraph]] | |||
| | |||
|- | |||
| [[w:chgrp|chgrp]] | |||
| Filesystem | |||
| Change the file group ownership | |||
| | |||
|- | |||
| [[w:chmod|chmod]] | |||
| Filesystem | |||
| Change the file modes/attributes/permissions | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:chown|chown]] | |||
| Filesystem | |||
| Change the file ownership | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:cksum|cksum]] | |||
| Filesystem | |||
| Write file [[w:checksums|checksums]] and sizes | |||
| 4.4BSD | |||
|- | |||
| [[w:cmp (Unix)|cmp]] | |||
| Filesystem | |||
| Compare two files | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:comm|comm]] | |||
| Text Processing | |||
| Select or reject lines common to two files | |||
| Version 4 AT&T UNIX | |||
|- | |||
| [[w:command (Unix)|command]] | |||
| Shell Programming | |||
| Execute a simple command | |||
| | |||
|- | |||
| [[w:compress|compress]] | |||
| Filesystem | |||
| Compress data | |||
| 4.3BSD | |||
|- | |||
| [[w:continue (Unix)|continue]] | |||
| Shell programming | |||
| Continue [[w:for_loop|for]], [[w:while_loop|while]], or [[w:until|until]] [[w:Control_flow#Loops|loop]] | |||
| | |||
|- | |||
| [[w:cp (Unix)|cp]] | |||
| Filesystem | |||
| Copy files | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:crontab|crontab]] | |||
| Misc | |||
| Schedule periodic background work | |||
| | |||
|- | |||
| [[w:csplit|csplit]] | |||
| Text Processing | |||
| Split files based on context | |||
| PWB UNIX | |||
|- | |||
| [[w:ctags|ctags]] | |||
| C Programming | |||
| Create a tags file | |||
| 3.0BSD | |||
|- | |||
| [[w:cut (Unix)|cut]] | |||
| Shell Programming | |||
| Cut out selected fields of each line of a file | |||
| | |||
|- | |||
| [[w:cxref|cxref]] | |||
| C Programming | |||
| Generate a [[w:C (programming language)|C-language]] program cross-reference table | |||
| | |||
|- | |||
| [[w:date (Unix)|date]] | |||
| Misc | |||
| Write the date and time | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:dd (Unix)|dd]] | |||
| Filesystem | |||
| Convert and copy a file | |||
| | |||
|- | |||
| [[w:delta (Unix)|delta]] | |||
| SCCS | |||
| Make a delta (change) to an SCCS file | |||
| | |||
|- | |||
| [[w:df (Unix)|df]] | |||
| Filesystem | |||
| Report free disk space | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:diff|diff]] | |||
| Text processing | |||
| Compare two files | |||
| | |||
|- | |||
| [[w:dirname|dirname]] | |||
| Filesystem | |||
| Return the directory portion of a pathname | |||
| | |||
|- | |||
| [[w:dot (Unix)|dot]] | |||
| Shell programming | |||
| Execute commands in the current environment | |||
| | |||
|- | |||
| [[w:du (Unix)|du]] | |||
| Filesystem | |||
| Estimate file space usage | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:echo (command)|echo]] | |||
| Shell programming | |||
| Write arguments to standard output | |||
| | |||
|- | |||
| [[w:ed (text editor)|ed]] | |||
| Text processing | |||
| The standard text editor | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:env (shell)|env]] | |||
| Misc | |||
| Set the environment for command invocation | |||
| | |||
|- | |||
| [[w:eval]] | |||
| Shell programming | |||
| Construct command by concatenating arguments | |||
| | |||
|- | |||
| [[w:ex (editor)|ex]] | |||
| Text processing | |||
| Text editor | |||
| BSD | |||
|- | |||
| [[w:exec (operating system)|exec]] | |||
| Shell programming | |||
| Execute commands and open, close, or copy [[w:file descriptors|file descriptors]] | |||
| | |||
|- | |||
| [[w:exit (command)|exit]] | |||
| Shell programming | |||
| Cause the shell to exit | |||
| | |||
|- | |||
| [[w:expand (Unix)|expand]] | |||
| Text Processing | |||
| Convert tabs to spaces | |||
| 3.0BSD | |||
|- | |||
| [[w:Environment variable#UNIX|export]] | |||
| Misc | |||
| Set the export attribute for variables | |||
| | |||
|- | |||
| [[w:expr|expr]] | |||
| Shell Programming | |||
| Evaluate arguments as an expression | |||
| | |||
|- | |||
| [[w:false (Unix)|false]] | |||
| Shell programming | |||
| Return false value | |||
| | |||
|- | |||
| [[w:fc (Unix)|fc]] | |||
| Misc | |||
| Process the command history list | |||
| | |||
|- | |||
| [[w:fg (Unix)|fg]] | |||
| Process Management | |||
| Run jobs in the foreground | |||
| | |||
|- | |||
| [[w:file (Unix)|file]] | |||
| Filesystem | |||
| Determine file type | |||
| Version 4 AT&T UNIX | |||
|- | |||
| [[w:find|find]] | |||
| Filesystem | |||
| Find files | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:fold (Unix)|fold]] | |||
| Text processing | |||
| Filter for folding lines | |||
| | |||
|- | |||
| [[w:fort77|fort77]] | |||
| C Programming | |||
| [[w:FORTRAN]] compiler | |||
| | |||
|- | |||
| [[w:fuser (Unix)|fuser]] | |||
| Process Management | |||
| List [[w:Process_identifier|process IDs]] of all processes that have one or more files open | |||
| | |||
|- | |||
| [[w:gencat|gencat]] | |||
| Misc | |||
| Generate a formatted message catalog | |||
| | |||
|- | |||
| [[w:get (Unix)|get]] | |||
| SCCS | |||
| Get a version of an SCCS file | |||
| | |||
|- | |||
| [[w:getconf|getconf]] | |||
| Misc | |||
| Get configuration values | |||
| | |||
|- | |||
| [[w:getopts|getopts]] | |||
| Shell Programming | |||
| Parse utility options | |||
| | |||
|- | |||
| [[w:grep|grep]] | |||
| Misc | |||
| Search text for a pattern | |||
| | |||
|- | |||
| [[w:hash (Unix)|hash]] | |||
| Misc | |||
| Remember or report utility locations | |||
| | |||
|- | |||
| [[w:head (Unix)|head]] | |||
| Text processing | |||
| Copy the first part of files | |||
| PWB UNIX | |||
|- | |||
| [[w:iconv|iconv]] | |||
| Text processing | |||
| Codeset conversion | |||
| | |||
|- | |||
| [[w:id (Unix)|id]] | |||
| Misc | |||
| Return user identity | |||
| 4.4BSD | |||
|- | |||
| [[w:ipcrm|ipcrm]] | |||
| Misc | |||
| Remove a message queue, semaphore set, or shared memory segment identifier | |||
| | |||
|- | |||
| [[w:ipcs|ipcs]] | |||
| Misc | |||
| Report interprocess communication facilities status | |||
| | |||
|- | |||
| [[w:jobs (Unix)|jobs]] | |||
| Process Management | |||
| Display status of jobs in the current session | |||
| | |||
|- | |||
| [[w:join (Unix)|join]] | |||
| Text Processing | |||
| [[w:Relational database|Relational database]] operator | |||
| | |||
|- | |||
| [[w:kill (Unix)|kill]] | |||
| Process Management | |||
| Terminate or signal processes | |||
| Version 3 AT&T UNIX | |||
|- | |||
| [[w:lex programming tool|lex]] | |||
| C Programming | |||
| Generate programs for [[w:Lexical analyzer|lexical tasks]] | |||
| | |||
|- | |||
| [[w:link (Unix)|link]] | |||
| Filesystem | |||
| Call link function | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:ln (Unix)|ln]] | |||
| Filesystem | |||
| Link files | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:locale|locale]] | |||
| Misc | |||
| Get locale-specific information | |||
| | |||
|- | |||
| [[w:localedef|localedef]] | |||
| Misc | |||
| Define locale environment | |||
| | |||
|- | |||
| [[w:logger (Unix)|logger]] | |||
| Shell programming | |||
| Log messages | |||
| | |||
|- | |||
| [[w:logname|logname]] | |||
| Misc | |||
| Return the user's login name | |||
| 4.4BSD | |||
|- | |||
| [[w:lp (Unix)|lp]] | |||
| Text Processing | |||
| Send files to a printer | |||
| | |||
|- | |||
| [[w:ls|ls]] | |||
| Filesystem | |||
| List directory contents | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:M4 (computer language)|m4]] | |||
| Misc | |||
| Macro processor | |||
| PWB UNIX | |||
|- | |||
| [[w:mailx|mailx]] | |||
| Misc | |||
| Process messages | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:make (software)|make]] | |||
| Programming | |||
| Maintain, update, and regenerate groups of programs | |||
| | |||
|- | |||
| [[w:Manual page (Unix)|man]] | |||
| Misc | |||
| Display system documentation | |||
| | |||
|- | |||
| [[w:mesg|mesg]] | |||
| Misc | |||
| Permit or deny messages | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:mkdir|mkdir]] | |||
| Filesystem | |||
| Make directories | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:mkfifo|mkfifo]] | |||
| Filesystem | |||
| Make [[w:FIFO|FIFO]] special files | |||
| 4.4BSD | |||
|- | |||
| [[w:more (command)|more]] | |||
| Text processing | |||
| Display files on a page-by-page basis | |||
| | |||
|- | |||
| [[w:mv|mv]] | |||
| Filesystem | |||
| Move files | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:newgrp|newgrp]] | |||
| Misc | |||
| Change to a new group | |||
| Version 6 AT&T UNIX | |||
|- | |||
| [[w:nice (Unix)|nice]] | |||
| Process Management | |||
| Invoke a utility with an altered nice value | |||
| Version 4 AT&T UNIX | |||
|- | |||
| [[w:nl (Unix)|nl]] | |||
| Text Processing | |||
| Line numbering filter | |||
| | |||
|- | |||
| [[w:nm (Unix)|nm]] | |||
| C Programming | |||
| Write the name list of an [[w:object file|object file]] | |||
| | |||
|- | |||
| [[w:nohup|nohup]] | |||
| Process Management | |||
| Invoke a utility immune to [[w:SIGHUP|hangups]] | |||
| | |||
|- | |||
| [[w:od (Unix)|od]] | |||
| Misc | |||
| Dump files in various formats | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:paste (Unix)|paste]] | |||
| Text processing | |||
| Merge corresponding or subsequent lines of files | |||
| Version 32V AT&T UNIX | |||
|- | |||
| [[w:patch (Unix)|patch]] | |||
| Text processing | |||
| Apply changes to files | |||
| | |||
|- | |||
| [[w:pathchk|pathchk]] | |||
| Filesystem | |||
| Check pathnames | |||
| | |||
|- | |||
| [[w:pax (Unix)|pax]] | |||
| Misc | |||
| Portable archive interchange | |||
| 4.4BSD | |||
|- | |||
| [[w:pr (Unix)|pr]] | |||
| Text processing | |||
| Print files | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:printf (Unix)|printf]] | |||
| Shell programming | |||
| Write formatted output | |||
| 4.3BSD-Reno | |||
|- | |||
| [[w:prs|prs]] | |||
| SCCS | |||
| Print an SCCS file | |||
| | |||
|- | |||
| [[w:ps (Unix)|ps]] | |||
| Process Management | |||
| Report process status | |||
| Version 4 AT&T UNIX | |||
|- | |||
| [[w:pwd|pwd]] | |||
| Filesystem | |||
| print working directory - Return working directory name | |||
| | |||
|- | |||
| [[w:qalter|qalter]] | |||
| Batch Utilities | |||
| Alter batch job | |||
| | |||
|- | |||
| [[w:qdel|qdel]] | |||
| Batch Utilities | |||
| Delete batch jobs | |||
| | |||
|- | |||
| [[w:qhold|qhold]] | |||
| Batch Utilities | |||
| Hold batch jobs | |||
| | |||
|- | |||
| [[w:qmove|qmove]] | |||
| Batch Utilities | |||
| Move batch jobs | |||
| | |||
|- | |||
| [[w:qmsg|qmsg]] | |||
| Batch Utilities | |||
| Send message to batch jobs | |||
| | |||
|- | |||
| [[w:qrerun|qrerun]] | |||
| Batch Utilities | |||
| Rerun batch jobs | |||
| | |||
|- | |||
| [[w:qrls|qrls]] | |||
| Batch Utilities | |||
| Release batch jobs | |||
| | |||
|- | |||
| [[w:qselect|qselect]] | |||
| Batch Utilities | |||
| Select batch jobs | |||
| | |||
|- | |||
| [[w:qsig|qsig]] | |||
| Batch Utilities | |||
| Signal batch jobs | |||
| | |||
|- | |||
| [[w:qstat (Unix)|qstat]] | |||
| Batch Utilities | |||
| Show status of batch jobs | |||
| | |||
|- | |||
| [[w:qsub|qsub]] | |||
| Batch Utilities | |||
| Submit a script | |||
| | |||
|- | |||
| [[w:read (Unix)|read]] | |||
| Shell Programming | |||
| Read a line from standard input | |||
| | |||
|- | |||
| [[w:readonly|readonly]] | |||
| Misc | |||
| Set the readonly attribute for variables | |||
| | |||
|- | |||
| [[w:renice|renice]] | |||
| Process Management | |||
| Set [[w:nice values|nice values]] of running processes | |||
| 4.0BSD | |||
|- | |||
| [[w:return (Unix)|return]] | |||
| Shell Programming | |||
| Return from a function | |||
| | |||
|- | |||
| [[w:rm (Unix)|rm]] | |||
| Filesystem | |||
| Remove directory entries | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:rmdel|rmdel]] | |||
| SCCS | |||
| Remove a delta from an SCCS file | |||
| | |||
|- | |||
| [[w:rmdir|rmdir]] | |||
| Filesystem | |||
| Remove directories | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:sact (Unix)|sact]] | |||
| SCCS | |||
| Print current SCCS file-editing activity | |||
| | |||
|- | |||
| [[w:sccs (Unix)|sccs]] | |||
| [[w:Source Code Control_System|SCCS]] | |||
| Front end for the SCCS subsystem | |||
| | |||
|- | |||
| [[w:sed|sed]] | |||
| Text processing | |||
| Stream editor | |||
| Version 7 AT&T UNIX | |||
|- | |||
| [[w:set (Unix)|set]] | |||
| Misc | |||
| Set or unset options and positional parameters | |||
| | |||
|- | |||
| [[w:bourne shell|sh]] | |||
| Shell programming | |||
| [[w:shell (computing)|Shell]], the standard command language interpreter | |||
| Version 7 AT&T UNIX | |||
|- | |||
| [[w:shift (Unix)|shift]] | |||
| Shell programming | |||
| Shift positional parameters | |||
| | |||
|- | |||
| [[w:sleep (Unix)|sleep]] | |||
| Shell programming | |||
| Suspend execution for an interval | |||
| Version 4 AT&T UNIX | |||
|- | |||
| [[w:sort (Unix)|sort]] | |||
| Text Processing | |||
| Sort, merge, or sequence check text files | |||
| | |||
|- | |||
| [[w:split (Unix)|split]] | |||
| Misc | |||
| Split files into pieces | |||
| Version 3 AT&T UNIX | |||
|- | |||
| [[w:strings (Unix)|strings]] | |||
| C Programming | |||
| Find printable strings in files | |||
| | |||
|- | |||
| [[w:strip (Unix)|strip]] | |||
| C Programming | |||
| Remove unnecessary information from executable files | |||
| | |||
|- | |||
| [[w:stty|stty]] | |||
| Misc | |||
| Set the options for a terminal | |||
| | |||
|- | |||
| [[w:tabs (Unix)|tabs]] | |||
| Misc | |||
| Set terminal tabs | |||
| PWB UNIX | |||
|- | |||
| [[w:tail (Unix)|tail]] | |||
| Text processing | |||
| Copy the last part of a file | |||
| PWB UNIX | |||
|- | |||
| [[w:talk (Unix)|talk]] | |||
| Misc | |||
| Talk to another user | |||
| 4.2BSD | |||
|- | |||
| [[w:tee (command)|tee]] | |||
| Shell programming | |||
| Duplicate [[w:standard input|standard input]] | |||
| | |||
|- | |||
| [[w:test (Unix)|test]] | |||
| Shell programming | |||
| Evaluate [[w:expression (programming)|expression]] | |||
| | |||
|- | |||
| [[w:time (Unix)|time]] | |||
| Process Management | |||
| Time a simple command | |||
| Version 3 AT&T UNIX | |||
|- | |||
| [[w:times (Unix)|times]] | |||
| Process Management | |||
| Write process times | |||
| | |||
|- | |||
| [[w:touch (Unix)|touch]] | |||
| Filesystem | |||
| Change file access and modification times | |||
| Version 7 AT&T UNIX | |||
|- | |||
| [[w:tput|tput]] | |||
| Misc | |||
| Change [[w:terminal|terminal]] characteristics | |||
| System V | |||
|- | |||
| [[w:tr_(Unix)|tr]] | |||
| Text processing | |||
| Translate characters | |||
| Version 4 AT&T UNIX | |||
|- | |||
| [[w:trap (Unix)|trap]] | |||
| Process Management | |||
| Trap signals | |||
| | |||
|- | |||
| [[w:true (Unix)|true]] | |||
| Shell programming | |||
| Return true value | |||
| | |||
|- | |||
| [[w:tsort (Unix)|tsort]] | |||
| Text processing | |||
| Topological sort | |||
| Version 7 AT&T UNIX | |||
|- | |||
| [[w:tty (Unix)|tty]] | |||
| Misc | |||
| Return user's [[w:terminal|terminal]] name | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:type (Unix)|type]] | |||
| Misc | |||
| Displays how a name would be interpreted if used as a command | |||
| | |||
|- | |||
| [[w:ulimit|ulimit]] | |||
| Misc | |||
| Set or report file size limit | |||
| | |||
|- | |||
| [[w:umask|umask]] | |||
| Misc | |||
| Get or set the file mode creation mask | |||
| | |||
|- | |||
| [[w:unalias|unalias]] | |||
| Misc | |||
| Remove alias definitions | |||
| | |||
|- | |||
| [[w:uname|uname]] | |||
| Misc | |||
| Return system name | |||
| PWB UNIX | |||
|- | |||
| [[w:uncompress|uncompress]] | |||
| Misc | |||
| Expand compressed data | |||
| 4.3BSD | |||
|- | |||
| [[w:unexpand|unexpand]] | |||
| Text Processing | |||
| Convert spaces to tabs | |||
| 3.0BSD | |||
|- | |||
| [[w:unget|unget]] | |||
| SCCS | |||
| Undo a previous get of an SCCS file | |||
| | |||
|- | |||
| [[w:uniq|uniq]] | |||
| Text Processing | |||
| Report or filter out repeated lines in a file | |||
| Version 3 AT&T UNIX | |||
|- | |||
| [[w:unlink (Unix)|unlink]] | |||
| Filesystem | |||
| Call the unlink function | |||
| [[w:Version 1 AT&T UNIX|Version 1 AT&T UNIX]] | |||
|- | |||
| [[w:unset|unset]] | |||
| Misc | |||
| Unset values and attributes of variables and functions | |||
| | |||
|- | |||
| [[w:uucp|uucp]] | |||
| Network | |||
| System-to-system copy | |||
| | |||
|- | |||
| [[w:uudecode|uudecode]] | |||
| Network | |||
| Decode a binary file | |||
| 4.0BSD | |||
|- | |||
| [[w:uuencode|uuencode]] | |||
| Network | |||
| Encode a binary file | |||
| 4.0BSD | |||
|- | |||
| [[w:uustat|uustat]] | |||
| Network | |||
| [[w:uucp|uucp]] status inquiry and job control | |||
| | |||
|- | |||
| [[w:uux (Unix)|uux]] | |||
| Process Management | |||
| Remote command execution | |||
| | |||
|- | |||
| [[w:val (Unix)|val]] | |||
| SCCS | |||
| Validate SCCS files | |||
| | |||
|- | |||
| [[w:vi|vi]] | |||
| Text processing | |||
| Screen-oriented (visual) display editor | |||
| BSD | |||
|- | |||
| [[w:wait (command)|wait]] | |||
| Process Management | |||
| Await process completion | |||
| | |||
|- | |||
| [[w:wc (Unix)|wc]] | |||
| Text processing | |||
| Word, line, and byte or character count | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:what (Unix)|what]] | |||
| SCCS | |||
| Identify SCCS files | |||
| | |||
|- | |||
| [[w:who (Unix)|who]] | |||
| System Administration | |||
| Display who is on the system | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:write (Unix)|write]] | |||
| Misc | |||
| Write to another user's terminal | |||
| Version 1 AT&T UNIX | |||
|- | |||
| [[w:xargs|xargs]] | |||
| Shell Programming | |||
| Construct argument lists and invoke utility | |||
| PWB UNIX | |||
|- | |||
| [[w:yacc|yacc]] | |||
| C Programming | |||
| Yet another [[w:compiler|compiler]] compiler | |||
| PWB UNIX | |||
|- | |||
| [[w:zcat|zcat]] | |||
| Text Processing | |||
| Expand and concatenate data | |||
| | |||
|- | |||
|} | |||
=== Unix-like === | |||
Like [[w:Richard Stallman|RMS]] says, "GNU means GNU's Not Unix". Only [[w:Unix|Unix®]] is really Unix. [[Linux]] and the [[BSD]]s are definitely [[w:Unix-like|Unix-''like'']] though neither one is compliant with the above-mentioned "official" specification. What we present here is based on a set of tools that have been around for a long time. We will be looking at '''generalizations''' that behave in similar ways in ''most'' *nix environments. | |||
==== BusyBox ==== | |||
* | [[w:BusyBox|BusyBox]] is a good example of a more basic collection of utilities and are well suited to the novice. They can be found in [[w:Mini Linux|Mini Linux]] distributions, such as [[Tiny Core Linux]]. | ||
'''Exercise 1''' Go to [http://tinycorelinux.com/ TinyCoreLinux.com] and check it out. | |||
==== GNU Core Utilities ==== | |||
The [[w:GNU Core Utilities|GNU Core Utilities]] are much more extensive and not for the faint at heart. They are found on most full-sized [[BSD]] and [[Linux]] systems in their full glory. | |||
== Command line arguments == | |||
This section is under development. | |||
[[Category:Linux]] | [[Category:Linux]] | ||
{{?}} | |||
Latest revision as of 04:28, 19 August 2009
Unix-like operating systems require a working knowledge of several basic commands. Unix®, Linux, BSD and such use a ubiquitous set of these based on the Single UNIX Specification. Learning to operate a command line interface is a key skill in learning Linux and BSD.
Basic commands
| Name | Category | Description | First appeared |
|---|---|---|---|
| admin | SCCS | Create and administer SCCS files | |
| alias | Misc | Define or display aliases | |
| ar | Misc | Create and maintain library archives | |
| asa | Text Processing | Interpret carriage-control characters | |
| at | Process Management | Execute commands at a later time | Version 7 AT&T UNIX |
| awk | Text processing | Pattern scanning and processing language | Version 7 AT&T UNIX |
| basename | Filesystem | Return non-directory portion of a pathname | |
| batch | Process Management | Schedule commands to be executed in a batch queue | |
| bc | Misc | Arbitrary-precision arithmetic language | |
| bg | Process Management | Run jobs in the background | |
| break | Shell programming | Exit from for, while, or until loop | |
| c99 | C Programming | Compile standard C programs | |
| cal | Misc | Print a calendar | Version 5 AT&T UNIX |
| cat | Filesystem | Concatenate and print files | Version 1 AT&T UNIX |
| cd | Filesystem | Change the working directory | |
| cflow | C Programming | Generate a C-language flowgraph | |
| chgrp | Filesystem | Change the file group ownership | |
| chmod | Filesystem | Change the file modes/attributes/permissions | Version 1 AT&T UNIX |
| chown | Filesystem | Change the file ownership | Version 1 AT&T UNIX |
| cksum | Filesystem | Write file checksums and sizes | 4.4BSD |
| cmp | Filesystem | Compare two files | Version 1 AT&T UNIX |
| comm | Text Processing | Select or reject lines common to two files | Version 4 AT&T UNIX |
| command | Shell Programming | Execute a simple command | |
| compress | Filesystem | Compress data | 4.3BSD |
| continue | Shell programming | Continue for, while, or until loop | |
| cp | Filesystem | Copy files | Version 1 AT&T UNIX |
| crontab | Misc | Schedule periodic background work | |
| csplit | Text Processing | Split files based on context | PWB UNIX |
| ctags | C Programming | Create a tags file | 3.0BSD |
| cut | Shell Programming | Cut out selected fields of each line of a file | |
| cxref | C Programming | Generate a C-language program cross-reference table | |
| date | Misc | Write the date and time | Version 1 AT&T UNIX |
| dd | Filesystem | Convert and copy a file | |
| delta | SCCS | Make a delta (change) to an SCCS file | |
| df | Filesystem | Report free disk space | Version 1 AT&T UNIX |
| diff | Text processing | Compare two files | |
| dirname | Filesystem | Return the directory portion of a pathname | |
| dot | Shell programming | Execute commands in the current environment | |
| du | Filesystem | Estimate file space usage | Version 1 AT&T UNIX |
| echo | Shell programming | Write arguments to standard output | |
| ed | Text processing | The standard text editor | Version 1 AT&T UNIX |
| env | Misc | Set the environment for command invocation | |
| w:eval | Shell programming | Construct command by concatenating arguments | |
| ex | Text processing | Text editor | BSD |
| exec | Shell programming | Execute commands and open, close, or copy file descriptors | |
| exit | Shell programming | Cause the shell to exit | |
| expand | Text Processing | Convert tabs to spaces | 3.0BSD |
| export | Misc | Set the export attribute for variables | |
| expr | Shell Programming | Evaluate arguments as an expression | |
| false | Shell programming | Return false value | |
| fc | Misc | Process the command history list | |
| fg | Process Management | Run jobs in the foreground | |
| file | Filesystem | Determine file type | Version 4 AT&T UNIX |
| find | Filesystem | Find files | Version 1 AT&T UNIX |
| fold | Text processing | Filter for folding lines | |
| fort77 | C Programming | w:FORTRAN compiler | |
| fuser | Process Management | List process IDs of all processes that have one or more files open | |
| gencat | Misc | Generate a formatted message catalog | |
| get | SCCS | Get a version of an SCCS file | |
| getconf | Misc | Get configuration values | |
| getopts | Shell Programming | Parse utility options | |
| grep | Misc | Search text for a pattern | |
| hash | Misc | Remember or report utility locations | |
| head | Text processing | Copy the first part of files | PWB UNIX |
| iconv | Text processing | Codeset conversion | |
| id | Misc | Return user identity | 4.4BSD |
| ipcrm | Misc | Remove a message queue, semaphore set, or shared memory segment identifier | |
| ipcs | Misc | Report interprocess communication facilities status | |
| jobs | Process Management | Display status of jobs in the current session | |
| join | Text Processing | Relational database operator | |
| kill | Process Management | Terminate or signal processes | Version 3 AT&T UNIX |
| lex | C Programming | Generate programs for lexical tasks | |
| link | Filesystem | Call link function | Version 1 AT&T UNIX |
| ln | Filesystem | Link files | Version 1 AT&T UNIX |
| locale | Misc | Get locale-specific information | |
| localedef | Misc | Define locale environment | |
| logger | Shell programming | Log messages | |
| logname | Misc | Return the user's login name | 4.4BSD |
| lp | Text Processing | Send files to a printer | |
| ls | Filesystem | List directory contents | Version 1 AT&T UNIX |
| m4 | Misc | Macro processor | PWB UNIX |
| mailx | Misc | Process messages | Version 1 AT&T UNIX |
| make | Programming | Maintain, update, and regenerate groups of programs | |
| man | Misc | Display system documentation | |
| mesg | Misc | Permit or deny messages | Version 1 AT&T UNIX |
| mkdir | Filesystem | Make directories | Version 1 AT&T UNIX |
| mkfifo | Filesystem | Make FIFO special files | 4.4BSD |
| more | Text processing | Display files on a page-by-page basis | |
| mv | Filesystem | Move files | Version 1 AT&T UNIX |
| newgrp | Misc | Change to a new group | Version 6 AT&T UNIX |
| nice | Process Management | Invoke a utility with an altered nice value | Version 4 AT&T UNIX |
| nl | Text Processing | Line numbering filter | |
| nm | C Programming | Write the name list of an object file | |
| nohup | Process Management | Invoke a utility immune to hangups | |
| od | Misc | Dump files in various formats | Version 1 AT&T UNIX |
| paste | Text processing | Merge corresponding or subsequent lines of files | Version 32V AT&T UNIX |
| patch | Text processing | Apply changes to files | |
| pathchk | Filesystem | Check pathnames | |
| pax | Misc | Portable archive interchange | 4.4BSD |
| pr | Text processing | Print files | Version 1 AT&T UNIX |
| printf | Shell programming | Write formatted output | 4.3BSD-Reno |
| prs | SCCS | Print an SCCS file | |
| ps | Process Management | Report process status | Version 4 AT&T UNIX |
| pwd | Filesystem | print working directory - Return working directory name | |
| qalter | Batch Utilities | Alter batch job | |
| qdel | Batch Utilities | Delete batch jobs | |
| qhold | Batch Utilities | Hold batch jobs | |
| qmove | Batch Utilities | Move batch jobs | |
| qmsg | Batch Utilities | Send message to batch jobs | |
| qrerun | Batch Utilities | Rerun batch jobs | |
| qrls | Batch Utilities | Release batch jobs | |
| qselect | Batch Utilities | Select batch jobs | |
| qsig | Batch Utilities | Signal batch jobs | |
| qstat | Batch Utilities | Show status of batch jobs | |
| qsub | Batch Utilities | Submit a script | |
| read | Shell Programming | Read a line from standard input | |
| readonly | Misc | Set the readonly attribute for variables | |
| renice | Process Management | Set nice values of running processes | 4.0BSD |
| return | Shell Programming | Return from a function | |
| rm | Filesystem | Remove directory entries | Version 1 AT&T UNIX |
| rmdel | SCCS | Remove a delta from an SCCS file | |
| rmdir | Filesystem | Remove directories | Version 1 AT&T UNIX |
| sact | SCCS | Print current SCCS file-editing activity | |
| sccs | SCCS | Front end for the SCCS subsystem | |
| sed | Text processing | Stream editor | Version 7 AT&T UNIX |
| set | Misc | Set or unset options and positional parameters | |
| sh | Shell programming | Shell, the standard command language interpreter | Version 7 AT&T UNIX |
| shift | Shell programming | Shift positional parameters | |
| sleep | Shell programming | Suspend execution for an interval | Version 4 AT&T UNIX |
| sort | Text Processing | Sort, merge, or sequence check text files | |
| split | Misc | Split files into pieces | Version 3 AT&T UNIX |
| strings | C Programming | Find printable strings in files | |
| strip | C Programming | Remove unnecessary information from executable files | |
| stty | Misc | Set the options for a terminal | |
| tabs | Misc | Set terminal tabs | PWB UNIX |
| tail | Text processing | Copy the last part of a file | PWB UNIX |
| talk | Misc | Talk to another user | 4.2BSD |
| tee | Shell programming | Duplicate standard input | |
| test | Shell programming | Evaluate expression | |
| time | Process Management | Time a simple command | Version 3 AT&T UNIX |
| times | Process Management | Write process times | |
| touch | Filesystem | Change file access and modification times | Version 7 AT&T UNIX |
| tput | Misc | Change terminal characteristics | System V |
| tr | Text processing | Translate characters | Version 4 AT&T UNIX |
| trap | Process Management | Trap signals | |
| true | Shell programming | Return true value | |
| tsort | Text processing | Topological sort | Version 7 AT&T UNIX |
| tty | Misc | Return user's terminal name | Version 1 AT&T UNIX |
| type | Misc | Displays how a name would be interpreted if used as a command | |
| ulimit | Misc | Set or report file size limit | |
| umask | Misc | Get or set the file mode creation mask | |
| unalias | Misc | Remove alias definitions | |
| uname | Misc | Return system name | PWB UNIX |
| uncompress | Misc | Expand compressed data | 4.3BSD |
| unexpand | Text Processing | Convert spaces to tabs | 3.0BSD |
| unget | SCCS | Undo a previous get of an SCCS file | |
| uniq | Text Processing | Report or filter out repeated lines in a file | Version 3 AT&T UNIX |
| unlink | Filesystem | Call the unlink function | Version 1 AT&T UNIX |
| unset | Misc | Unset values and attributes of variables and functions | |
| uucp | Network | System-to-system copy | |
| uudecode | Network | Decode a binary file | 4.0BSD |
| uuencode | Network | Encode a binary file | 4.0BSD |
| uustat | Network | uucp status inquiry and job control | |
| uux | Process Management | Remote command execution | |
| val | SCCS | Validate SCCS files | |
| vi | Text processing | Screen-oriented (visual) display editor | BSD |
| wait | Process Management | Await process completion | |
| wc | Text processing | Word, line, and byte or character count | Version 1 AT&T UNIX |
| what | SCCS | Identify SCCS files | |
| who | System Administration | Display who is on the system | Version 1 AT&T UNIX |
| write | Misc | Write to another user's terminal | Version 1 AT&T UNIX |
| xargs | Shell Programming | Construct argument lists and invoke utility | PWB UNIX |
| yacc | C Programming | Yet another compiler compiler | PWB UNIX |
| zcat | Text Processing | Expand and concatenate data |
Unix-like
Like RMS says, "GNU means GNU's Not Unix". Only Unix® is really Unix. Linux and the BSDs are definitely Unix-like though neither one is compliant with the above-mentioned "official" specification. What we present here is based on a set of tools that have been around for a long time. We will be looking at generalizations that behave in similar ways in most *nix environments.
BusyBox
BusyBox is a good example of a more basic collection of utilities and are well suited to the novice. They can be found in Mini Linux distributions, such as Tiny Core Linux.
Exercise 1 Go to TinyCoreLinux.com and check it out.
GNU Core Utilities
The GNU Core Utilities are much more extensive and not for the faint at heart. They are found on most full-sized BSD and Linux systems in their full glory.
Command line arguments
This section is under development. ?