UNIX Command Reference

From HaFrWiki
Revision as of 13:04, 12 November 2012 by Hjmf (talk | contribs) (Created page with "{{CompactTOC}} UNIX <ref name="unix">UNIX is a computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including K...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

UNIX [1] command line reference links to explanations.


A

Command Description Extra
admin Administer SCCS files. NCyg
apt Package managing system NCyg
ar Maintain, modify, and extract from archives. Now largely obsoleted by tar. Cyg
as GNU assembler tool. Also known as Gas. Cyg
at Single-time command scheduler Cyg
awk Pattern scanning and processing language Cyg

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


B

Command Description Extra
banner Creates ascii art version of an input string for printing large banners Cyg
basename Returns the final component of a path Cyg
batch Runs jobs when the system load level permits NCyg
bc An arbitrary precision calculator language with syntax similar to the C programming language. Cyg

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


C

Command Description Extra
cal Displays a calendar NC
cat Concatenates files to standard output.
Example:cat fileIn | sort -u > FileOut.uniq
Cyg
cc C-compiler Cyg
cd Changes the directory Cyg
chmod Change the permissions of a file or directory Cyg
chown Change the owner of a file or directory Cyg
cksum Print the CRC checksum and bytecount of a file (see also MD5) Cyg
clear Clears the content of the screen Cyg
cmp Compares two files byte for byte Cyg
comm Sorts two files and compare them line for line Cyg
cp Copies a file or directory to another location.
To copy directories recursive use: cp -r xxx yyy
Cyg
crontab Schedules commands to be executed periodically. NC
crypt Crypts or decrypts a data NC
csh C shell (csh) is a Unix shell developed by Bill Joy for the BSD Unix system. NC
csplit csplit separates a file into sections and place the sections into files names xx00 through xx99. Cyg
ctags Generate tags file summarising location of objects in source files. NC
cut cut extract a certain range of characters from a line, usually from a file. Cyg

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


D

Command Description Extra
date Print or set the system date and/or time Cyg
dbx (System V and BSD) Symbolic debugger. NC
dc Reverse-Polish desk calculator which supports unlimited precision arithmetic Cyg
dd Converts and copies a file (Disk Dump) Cyg
df Displays the amount of disk space used and available on the filesystems accessible to a user. Cyg
diff Reports the line difference between 2 files. Cyg
diff3 Compares three files and report the differences. Cyg
dircmp Compares the contents of files between two directories Cyg
dirname Strips non-directory suffixes from a path Cyg
du estimate the file space usage Cyg

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


E

Command Description Extra
echo Print to standard output Cyg
ed Standard text editor. See also ex. NC
env Show environment variables; run a program with altered environment variables Cyg
eqn Part of the troff suite of Unix document layout tools, eqn is a preprocessor that formats equations for printing. A similar program, neqn, accepted the same input as eqn, but produced output tuned to look better in nroff. eqn was created by Brian Kernighan and Lorinda Cherry. Cyg
ex Advanced version of the standard Unix editor ed, Cyg
expr Evaluates an expression Cyg

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


F

Command Description Extra
factor (num) Produce the prime factors of num. Cyg
fc Processes the command history list Cyg
fgrep Simplified pattern matching (synonym for "grep -F") Cyg
file Determine the type of a file, (See also stat) Cyg
find Search for files through a directory hierarchy.
One of the most complicated UNIX commands, See also GNU Find.
An alternative GUI find is SearchMonkey.
See also xargs, and the Examples.
Cyg
finger Displays data about one or more users, including information listed in the files. Also the shell you are currently using (finger -m <username>) Cyg
fit fmt fills and joins text, producing lines of roughly the same length. Cyg
fold Fold breaks the lines of the named files so that they are no wider than the specified width. Cyg
ftp ftp transfers files to and from remote network site hostname. Cyg

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


G

Command Description Extra
Gedit gedit is the official text editor of the GNOME desktop environment. Is also available for Windows, MacOS. Ubuntu
getopts Retrieves options and option-arguments from a list of parameters. Cyg
gprof Display call-graph profile data of C programs. Cyg
grep grep takes a regular expression on the command line, reads standard input or a list of files, and outputs the lines containing matches for the regular expression. Cyg
groups Show the groups that user belongs to (default is your groups). Groups are listed in /etc/passwd and /etc/group. Cyg

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


H

Command Description Extra
head Output the first parts of a file. Cyg
help Display helpful information about builtin commands. Cyg
hostid Print the hexadecimal ID number of the host machine. Cyg

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


I

Command Description Extra
iconv Convert the encoding of the specified files Cyg
id Prints the UID of the account of which the program is executed by. Cyg
install Install] copies files and set attributes Cyg
ipcrm Removes a message queue, semaphore set or shared memory id. Cyg
ipcs Provides information on IPC facilities Cyg

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


J

Command Description Extra
join Joins lines of two files on a common field Cyg

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


K

Command Description Extra
kill Sends a message normaly a termination signal (message) to a program Cyg
ksh Korn shell, standard shell on many proprietary Unix systems, powerful successor to the Unix Bourne shell (sh), written by David Korn, NC

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


L

Command Description Extra
ld Program linker Cyg
less Shows the content of a file on the terminal screen. Cyg
ln Creates symbolic links. Cyg
login Logs in to the system Cyg
logname Logname prints the user login name Cyg
lp Prints a file (on a line printer) NC
ls Lists segments or lists files (directories). Examples:
  • Show symbolic links: ls -l . | grep ">"
  • Alias example for showing all information: alias la='ls -al '
  • Alias example for shwing alias lr='ls -l | wc'
Cyg

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


M

Command Description Extra
mail Unix standard mail client.
Examples Mail
NC
mailx Improved mail client NC
make Automates builds Cyg
man Displays extensive documentation on commands Cyg
mkdir Makes a (sub)directory Cyg
more Displays the named files on a terminal, one screenful at a time. Cyg
mv Moves a file or directory from one place to another. Cyg

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


N

Command Description Extra
nice maps to a kernel call of the same name. Cyg
nl Numbers the lines of a file. Cyg
nohup Run a command with immunity to hangups outputting to non-tty Cyg

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


O

Command Description Extra

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


P

Command Description Extra
Process Status displays the currently-running processes. Example to show if cron is running:
ps -el | grep cron
 

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


Q

Command Description Extra

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


R

Command Description Extra
replace
KSH replaces characters/text in a string. This KSH option is a feature of the shell. See the kWh manual.
Examples are:
  • Replaces 1st occurrence of text in string: ${string/find/replace}
  • Replaces all occurrences of text in string: ${string//find/replace}
KSH Only.
rm Removes a file (file list).  

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


S

Command Description Extra
sh Bourne shell, the standard Unix shell  
scp Secure Copy or SCP is a means of securely transferring computer files between a local and a remote host or between two remote hosts, using the Secure Shell (SSH) protocol.
  • scp SourceFile user@host:directory/TargetFile
  • scp user@host:folder/SourceFile TargetFile
See also Secure copy for secure copy without Password.
Split a large file into smaller parts. Examples:
  • split -b 22 newfile.txt new
    Split the file "newfile.txt" into three separate files called newaa, newab and newac each file the size of 22.
  • split -l 300 file.txt new
    Split the file "newfile.txt" into files beginning with the name "new" each containing 300 lines of text each
  • split -b 720mb file.zip parts
    Split the file "file.zip" into files beginning with the name "parts" each containing 720Mb.

In windows combine the file using:

  • copy /b file1+file2 result
 
strings Shows all string in a binary dump.
  • strings dd_onbz.dmp | less -f
 
sudo The sudo command is a program for some UNIX and Unix-like computer operating systems that allows users to run programs with the security privileges of another user (normally the superuser, or root).
See also: Sudo manpage, Ubuntu Karmic sudo manpage and SuDo Home Page [2].
 
sysv-rc-conf sysv-rc-conf gives an easy to use interface for managing etc/rc{runlevel}.d/ symlinks. The interface comes in two different

flavors, one that simply allows turning services on or off and another that allows for more fine tuned management of the symlinks. It’s a replacement for programs like ntsysv(8) or rcconf(8).
See also Linux startup process.

Ubuntu

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


T

Command Description Extra
tail Tails to see and follow (-f) the lines of a logfile. Cyg
tr Translate, squeeze, and/or delete characters from standard input, writing to standard output.
Example: tr -cs "[:alpha:]" "[\n*]" < input > output
Cyg

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


U

Command Description Extra
uptime Print how long the system has been running  

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


V

Command Description Extra
vi vi is a family of screen-oriented text editors. See the internal wiki page on vi. Cyg
visudo visudo edits the sudoers file in a safe fashion, analogous to vipw.

Visudo locks the sudoers file against multiple simultaneous edits, provides basic sanity checks, and checks for parse errors. If the sudoers file is currently being edited you will receive a message to try again later.

Ubuntu

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


W

Command Description Extra
wc Unix Word Count, showing the number of lines, words and bytes. Example

wc foo bar

Cygwin

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


X

Command Description Extra
xargs reads items from the standard input, delimited by blanks or newlines and executes the command one or more times.
xargs is useful when passing large number of arguments to a command. See also Find and the examples.

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


Z

Command Description Extra

Contents: Top - 0–9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


See also

top

Reference

top

  1. UNIX is a computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna. Today the term Unix is used to describe any operating system that conforms to Unix standards, meaning the core operating system operates the same as the original Unix operating system. (Wikipedia).
  2. Sudo Home Page contains information, documentation and downloads of the SuDo command and usage.