Followings are the Principal Linux Command line in alphabetical order. Hopefully this will meet your linux command need. If not please report to me. Thanks in advance.• date – displays or sets date and time
o usage: date
o or: date date
• dd – direct copy of file from one device to another. Can be used to make copies of boot or root diskettes for installing Linux. It can be used, for example, to make and exact copy of a floppy disk, as follows. First, place the diskette to be copied in the floppy drive. Then,
o dd if=/dev/fd0 ibs=512 > floppy.copy
o Replace the diskette with a fresh diskette.
o dd if=floppy.copy bs=512 of=/dev/fd0
The ibs and bs options specify the block sizes for input and for both input and output. A boot disk image can be directly copied to a floppy using the second of the two dd commands above.
• declare – declares attributes for a variable (same as typeset). This is a shell builtin.
• df – displays capacity and free capacity on different physical devices such as hard drive partitions and floppy drives that are mounted on the file system. Gives free space in blocks. With the (undocumented) option -h, the program gives free space in Mb or Gb. This is useful for those accustomed to thinking of the capacity of a high-density 3.5 inch diskette as 1440k.
• diff – displays differences between two files
o usage: diff file1 file2
• diff3 – compares three files and reports on differences
• dip – used to set up a SLIP or PPP connection. It can be used to set up an outgoing SLIP connection or an incoming connection.
• diplogin – used for setting up incoming dip connections. See the man page for dip.
• dir – a variation of the GNU ls command that defaults to printing file names in columns
• dircolors – set colors for GNU ls command. In Slackware, this command is run by the /etc/profile script. Then, whenever xterm is run with the -ls (login shell) option, ls displays different colors for different types of files. Typical usage is eval `dircolors -b`. In Red Hat and Mandrake, I get color directories by aliasing the ls command (see below).
• display – set display for output of programms under X Windows. Can be used to run a program on a remote machine while displaying the output on a local machine. The remote machine must have permission to send output to the local machine. This is actually an environment variable. See the more detailed discussion in connection with the xhost command below.
• dmesg – displays messages from /var/log relative to the most recent boot
• dos – invoke the DOSEMU DOS emulator
• du – displays information on disk usage. The command
o du / -bh | less
will display detailed disk usage for each subdirectory starting at root, giving files sizes in bytes.
• dumpkeys – print information about the keyboard driver’s translation tables to standard output
• dvilj – send a dvi file to a Laserjet printer. There are specialized versions for individual models of Laserjet printer.
• dvilj2p – specialized version of dvilj for the IIp series of printers. See above.
• dvips – send a dvi file to a Postscript printer, to a Postscript capable Laserjet printer, or to a file (with the -o option). There is a switch to print only a subset of the pages, and another switch to print in landscape mode. Use -t landscape, which is one of the arguments to the paper type switch. If you have one page of a document that is a wide table, and you wish to print this in landscape mode, use
o dvips filename -pp pagenumber -t landscape
• e2fsck – check an ext2 filesystem. The syntax is
o e2fsck /dev/devicename
where the filesystem is on /dev/devicename. The device should not be mounted, and this program must be run as root.
• echo – write arguments to standard output. One use is to print out information about environment variables, as in
o echo $PATH – list paths to search
o echo $HOME or echo ~ – list name of home directory
This is a shell builtin.
• editres – a dynamic resource editor for X Toolkit applications. Allows the user to change X resources for individual applications.
• efax – fax program
• efix – convert between fax, text, bit-map and gray-scale formats
• egrep – search files for lines that match regular expressions. Runs faster than grep and fgrep.
• elm – an interactive mail system
• elvis – a version of the vi text editor
• emacs – screen oriented text editor
• env – desplay the current environment or set a variable equal to a new value
• eval – scans and evaluates the command line. See dircolors command. This is a shell builtin.
• ex – interactive command-based editor. The man page lists it as being the same as vim, an improved version of vi.
• exec – system call which creates a subshell to execute a binary or a script. This is a shell builtin.
• execve – a variation of the exec command.
• exit – exit a shell. This is a shell builtin.
• expand – convert tabs in files to spaces and write to standard output
• expect – a program that “talks” to other interactive programs according to a script. Following the script, Expect knows what can be expected from a program and what the correct response should be. An interpreted language provides branching and high-level control structures to direct the dialogue. In addition, the user can take control and interact directly when desired, afterward returning control to the script.
• export – place the value of a variable in the calling environment (makes it global). This is a shell builtin.
• expr – utility evaluates an expression and displays the result
• f2c – FORTRAN to C translator
• f77 – FORTRAN 77 compiler
• false – null command that returns an unsuccessful exit status
• fax – simple user interface to efax and efix programs
• fc – views, edits, and executes commands for the history list. This is a shell builtin.
• fdformat – low level format of a floppy device
• fetchmail – retrieve mail from a remote mail server and pass it to local SMTP agents on the local machine
• fdisk – used to partition hard drives
o usage: fdisk device
• fg PID – bring a background or stopped process with pid “PID” to the foreground. This is a shell builtin. If only one process is running in background mode, fg with no argument is sufficient to bring it to the foreground
• fgrep – search for patterns in files
• file – displays classification of a file or files according to the type of data they contain
• find – find files according to a large variety of search criteria. The find command that I use the most is
o find . -name filename -print
in order to find files matching a particular name on the working directory and all subdirectories. Find can be incredibly powerful, but it is incredibly obscure.
• finger – display information about a specified userid or userids
• fmt – simple text formatting utility. Tries to make all nonblank lines nearly the same length.
• fold – break lines of specified files so they are no wider than a specified lengths
• fortune – available in the bsdgames package in Slackware and other distributions. Put a call to fortune in /etc/profile and get something inspirational or amusing every time you fire up an xterm as a login shell.
• free – gives used and free memory on system along with other useful information
• fromdos – takes a DOS text file from stdin and sends a UNIX file to stdout.
• fsck – file system check and repair
• ftp – file transfer over network
• g++ – C++ compiler
• g77 – GNU Fortran 77 compiler
• gawk – GNU awk, mostly for processing delimited text files
• gcc – invoke C, C++ compiler
• getipts – parses arguments to a shell script. This is a shell builtin.
• getkeycodes – print kernel’s scancode-to-keycode mapping table
• ghostscript – set of printing utilities. It seems to be obligatory to have this if a TEX installation such as teTEX is installed. How they communicate with one another is somewhat obscure.
• ghostview – Aladdin ghostscript interpreter/previewer
• gimp – image manipulation and paint program
• glint – Red Hat graphical front end for the rpm package installer and manager.
• grep – used to find a string within a file. The -i option returns matches without regard to case. The -n option means that each line of output is preceded by file name and line number. The -v option causes non-matched lines to be printed.
o usage: grep pattern files
o or: grep -i pattern files
o or: grep -n pattern files
o or: grep -v pattern files
• groupadd – create a new group on the system
• groups – shows which groups you are in
• grub – Gnu grand unified bootloader. Can be used instead of lilo to boot multiple operating systems. I encountered a couple of snafus trying to install grub on my home machine after installing Mandrake 8.0 and choosing the lilo bootloader during the initial install. The Mandrake installation program set up /boot/vmlinuz as a symlink to the actual kernel, vmlinuz-2.4.3-20mdk. It took me a while to figure out that grub doesn’t understand symbolic links. The documentation suggests installing grub on a diskette using the “dd” command. This refused to work, but
o grub-install ‘(fd0)’
did work. The single quotes are necessary. The files necessary to run grub are normally located in /boot/grub. Once the file menu.lst has been edited and appropriated entries added to boot the different operating systems on one’s hard disk(s), the following sequence of commands can be used to install grub in the master boot record (MBR) sector of the hard disk:
o root (hd0,x)
o setup (hd0)
Here, the x should be replaced by the partition where the /boot/grub directory is located, which is probably the root partition of the Linux system. Note that grub has its own conventions for naming devices and numbering partitions, so that for example a partition which is called hda6 under Linux will be called (hd0,5) by grub.
• grub-install – command to install grub on the hard drive (or floppy drive).
• gunzip – used to uncompress files compressed with gzip
• gv – PostScript and PDF previewer, based on ghostview
• gvim – see vi
• gzexe – compresses executables
• gzip – used to compress or decompress files
Linux Commands – in alphabetical order – D to G
– November 10, 2008