Linux Commands – in alphabetical order – H to S

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.• halt – shut down system as root, without reboot, immediately
• hash – remembers the location of commands in the search path. This is a shell builtin.
• head – displays first part of a file
• history – command for viewing and manipulating the shell command history list
• host – look up host names using domain server
• hostname – used to get or set hostname. Typically, the host name is stored in the file /etc/HOSTNAME.
• hwclock – used to query and set the hardware clock
• hylafax – commercial fax program
• id – display userid and groupid
• inetd – daemon which starts up other daemons on demand. Configured in /etc/inetd.conf.
• ifconfig – display (as root) information on network interfaces that are currently active. First ethernet interface should be listed as eth0, second as eth1, etc. First modem ppp connection should be listed as ppp0, etc. The “lo” connection is “loopback” only.
• ifdown – shut down the network interface
• ifup [interface_name] – start up the interface
• info – display system information. This is the GNU hypertext reader.
• init – the mother of all processes, run at bootup, executes commands in /etc/inittab. Can be used (with root privileges) to change the system run level.
o usage: init run_level
• insmod – used (by root) to install modular device drivers
• installpkg – Slackware command to install one of the packages from the program sets
• intr – interrupt key, usually [Ctrl-C]
• ispell – checks files for spelling errors
o usage: ispell files
• jed – programmer’s file editor. Behaves like emacs. Has modes for TEX, FORTRAN, C, etc.
• jobs – displays list of current jobs in the background. This is a shell builtin.
• joe – simple WordStar-like text editor. It can be invoked in emacs emulation mode with jemacs and in WordStar emulation mode with jstar.
• jove – Joseph’s Own Version of Emacs. A simple emacs clone.
• kbd_mode – print current keyboard mode
• kernelcfg – GUI to add/remove kernel modules (as root in X terminal).
• kerneld – kernel daemon, a process that stays in memory and does all sorts of useful stuff, like automatic loading of device driver modules
• kikbd – a utility program that comes with KDE that allows users to switch on the fly among different international keyboards. It can be used under different window managers than kfm.
• kill – sends a signal to (especially to terminate) a job or process. This is a shell builtin in bash, tcsh and zsh.
• killall – kill processes by name. Kill all processes which are instances of the speciffied program. Also used to send signals to processes or restart them.
• killall5 – kill all processes except the ones on which it depends
• last – generate a listing of user logins
• lastlog – prints the last login times of all users
• latex – compile a LATEX file
• ldconfig – creates the necessary links and cache (for use by the run-time linker, ld.so) to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld.so.conf, and in the trusted directories (/usr/lib and /lib). Ldconfig checks the header and file names of the libraries it encounters when determining which versions should have their links updated. Ldconfig ignores symbolic links when scanning for libraries.
• ldd – list the shared libraries on which a given executable depends, and where they are located
• leave – display reminder at specified time
• less – Linux alternative to “more” command. Displays text files, one screenful at a time. When less pauses, there is a large number of available commands to tell it what to do next. One can scroll both forwards and backwards.
• let – evaluates a numeric expression. This is a shell builtin.
• lilo – installs boot loader on the boot sector of a hard drive, of a diskette, or in another location. My 486 has a hard drive that is too large for the machine’s BIOS, so I have to boot from a floppy. To create a boot diskette, I do the following (as root):
o /sbin/fdformat /dev/fd0H1440
o /sbin/mkfs.ext2 /dev/fd0
o mount -t ext2 /dev/fd0 /mnt/floppy
o cp -dp /boot/* /mnt/floppy
o /sbin/lilo -C /etc/lilo.flop
The -C option to lilo has lilo use the lilo.flop file instead of the default lilo.conf.
• linuxconf – interactive tool for configuring Linux system. Uses X if loaded. This is a Gnome tool. It comes with my Red Hat distribution, and is not included with Slackware. It would seem to be the easiest way to configure Linux under Slackware. Version 1.15 is available for Slackware. There is a pretty good introduction to the use of linuxconf in the Red Hat 5.2 installation manual, which is available online at their web site.
• ln – creates a link to a file. Used to create hard links and, with the -s option, symbolic links which can link files on different disk partitions. The syntax is
o ln [options] source [dest]
• locate filename – find the file name which contains the string “filename”. The syntax is easier than the find command.
• lock – temporarily lock terminal
• lockfile – create semaphore file(s), used to limit access to a file
• – log in to system
• logname – consult /etc/utmp for user’s login name
• logout – execute logout as individual user and bring up login: prompt
• look – look for strings in files
• lpq – show print jobs that are waiting
• lpr – send file to be printed
• lprm – cancel a job from print queue
• ls – list directory contents. To get colored directory listings under Red Hat, Mandrake, etc., use
o ls -color
To get this all the time, add
o alias ls=’ls -color=auto’
to .bashrc. The following command
o alias ls=’ls -Fskb -color=auto’
will give directory listings in color, with file sizes in kilobytes, and append a character to the file to indicate its type.
• lsattr – list attributes of files in ext2 file system
• lsmod – used (by root) to show kernel modules currently loaded
• lspci – utility to display information on pci buses and hardware devices attached to them. Part of the pciutils package that comes with many Linux distributions.
• lspnp – utility to display information about pnp devices. Part of the pcmcia or kernel-pcmcia package, depending on the distribution.
• m4 – an implementation of the traditional UNIX macro processor. It can be used with the sendmail configuration package in Red Hat (and Slackware) to generate a sendmail.conf configuration file without having to edit the configuration file directly.
• magicfilter – general purpose printer filter. See apsfilter above. apsfilter is the printer filter that comes with the Red Hat and Slackware distributions.
• mail – sends or reads electronic mail
• make – keeps a set of programs current. This is a utility that helps when developing a set of programs. It works by executing a script called makefile, Makefile or GNUmakefile in the working directory. It is very often used in combination with configure when compiling and installing noncompiled software packages.
• makebootdisk – command in Slackware to do just what the name says
• MAKEDEV – executable script to make device files on /dev
• makeswap – configures swap space
• man – displays information from online Unix reference manual
• manpath – attempt to determine path to manual pages
• mc – Midnight Commander file manager and visual shell
• mesg – enables/disables reception of messages
• minicom – terminal program
• mkdir – create a directory
• mkfs – create a file system (format) on a device or partition. Should be invoked after lowlevel formatting of the disk using fdformat. It has several versions which are all links to the basic program, such as mkfs.ext2 and mkfs.msdos.
• mkswap – creates a Linux swap space on the specified hard disk parition (root privileges neede)
o usage: mkswap device
• more – list file contents, stopping after each full screen
• mount -t [fstype] [device] [mountpoint] – mount device using filesystem of type [fstype] with device name [device] at the location [mountpoint] in the filesystem directory tree
• mount -a – mount all filesystems according to the specifications in /etc/fstab
• mouseconfig – mouse configuration utility under Red Hat. Located in /usr/sbin.
• mpage – print multiple pages per sheet on a Postscript printer. Can also be used to print a page in landscape mode.
• Mtools – package of MS-DOS utilities. Includes the following commands.
o mcd – changes working directory on DOS disk
o mcopy – copies DOS files from one directory to another
o mdel – deletes DOS files
o mdir – lists contents of DOS directories
o mformat – adds DOS formatting information to a disk
o mtype – displays contents of a DOS file
The default device for execution of these commands is /dev/fd0 and can be referred to as “a:”.
• mv – moves (renames) files
• netconf – used (as root) to set up network
• newaliases – rebuilds the /etc/aliases database used by sendmail. Must be rerun every time /etc/aliases is modified for the changes to take effect.
• newgrp – similar to login. Changes user’s identification
• nice program_name – sets the priority of the program “program_name”.
• nm – lists the symbols from object files objfile. If no object files are given as arguments, nm assumes `a.out’.
• nohup – runs a command that keeps running after logout. The command is in principle immune to hangups, and must have output to a non tty. According to Linux in a Nutshell, this is necessary only in the Bourne shell, since modern shells preserve background processes by default.
• ntsysv – run level editor under Red Hat. This is the equivalent of tksysv, but does not require a graphical interface.
• nxterm – color xterm program. The man page for nxterm under Red Hat brings up the same page as xterm.
• od – dumps contents of a file
• passwd – change login password
• paste – joins corresponding lines from files
• patch – updates source code. Attempts to update a file from a file of change information, or pathces, created by diff.
• pathchk – determine validity and portability of filenames
• pdflatex – part of the pdftex program suite. Produces pdf output from a LATEX file.
• pdftex – produces pdf output from a TeX file. See also pdflatex. This program is part of the tetex 0.9 distribution that is included with Red Hat 5.2 and above, and with Slackware 4.0 and above. It is also available as a separate program.
• perl – practical extraction and report language
• pg – display data one screenful at a time
• pico – simple screen oriented text editor. It is included as part of the Pine program.
• ping – check if Internet computer is responding. Can also measure the time it takes the queried computer to respond.
• pkgtool – Slackware tool to install, uninstall and query packages. Front end to installpkg, removepkg, makepkg. The cpkgtool is the ncurses graphical version of this program.
• popclient – retrieve mail via the Post Office Protocol. Supports POP2 and POP3.
• popd – pops the top directory of the directory stack and uses cd to change to that directory. This is a shell builtin.
• pr – paginates files for printing
• printenv – display list of environment variables
• printtool – run (as root) in an X terminal to configure your printer(s)
• ps – displays status of processes. Use the -a option for processes for all users. Use the -x option to include processes not attached to a terminal.
• pstree – display processes in the form of a tree structure. Killing a parent process will also kill all the children and their descendants.
• pushd – pushes the argument onto the top of the directory stack and uses cd to change to that directory. This is a shell builtin.
• pwd – print absolute path of working directory. This is a shell builtin.
• pwchk – checks the integrity of password and shadow files
• pwconv – converts passwords to the shadow password format
• pwunconv – unconverts passwords from the shadow password format. Generates a standard Unix password file.
• python – interpreted, interactive, object-oriented programming language
• rcp – copy one or more files to or from remote computer. The syntax is poorly explained in the documentation that I have, including the man pages. Usage is:
o rcp filename username@remotehost:path
The user’s home directory on the remote system must contain the file .rhosts with a list of users (preceded by the full domain name or exact IP address of their machine) with access privileges.
o localhostname username
• rcs – creates or changes the attributes of an RCS file. Stands for Revision Control System.
• rdev – query/set image root device, swap device, RAM disk size, or video mode in kernel
• read – reads line from standard input. This is a shell builtin.
• readonly – declares a variable to be read only. This is a shell builtin.
• reboot – in Slackware, reboots the system. Seems to be equivalent to shutdown -r now in generic Linux.
• renice program_name – resets the priority of process “program_name”.
• reset – used to reset the screen characteristics. This is useful if the screen gets messed up from, for example, trying to display a binary file in an xterm.
• return – exits from a function. This is a shell builtin.
• rlog – prints a summary of the history of an RCS file
• rlogin – log in to remote computer. The general syntax is as follows, using the UQAM Nobel machine as an example:
o rlogin -l userid nobel.si.uqam.ca
The remote computer must recognize the local user and the local machine. See the rcp command for how to set up the .rhosts file on the remote machine.
• rm – remove files or directories. With the -r (recursive) option (very dangerous!), can be used to remove the contents of a specified directory including all subdirectories.
• rmail – interpret and handle remote mail received via uucp
• rmdir – remove empty directories
• rmmod – used to remove modular device drivers
• route -n – show routing table. The n option returns numerical addresses rather than names.
• rpm – invokes the Red Hat package manager in command line mode. I often use this command in query mode to query packages about what files they contain and to find out which package owns a particular file. Examples are
o rpm -qil foo. Gives package information and a file list for the package foo.
o rpm -qfil foo. Gives package information and a file list for the package that owns the file foo. Foo must be in the working directory, or the full path to foo must be specified.
We need to find out about installing the rpm package on a Slackware box. It’s probably better to use a package converter such as alien.
• rpm2tgz – an extremely useful utility on Slackware systems that converts rpm packages to tgz format. They can then be installed using the installpkg command (or pkgtool).
• rsh – execute shell command on a remote computer. See rcp and rlogin.
• rstat – summarize host’s status: uptime, load averages, and current time
• ruptime – show host status of local machines
• rusers – list who is logged on local machines
• rwall – write to all users over a network
• rwho – show who is logged in on a LAN. The rwho service must be enabled for this command to run. If it isn’t, run “setup” as root. I don’t understand this last remark, which comes from “Linux Newbie Administrator Guide”.
• rxvt – a terminal program similar to xterm, but which has less features and uses less memory
• sed – edits a file (not interactively). Also a tool for processing text files.
• set – set or display value of shell variables. This is a shell builtin. The command
o set | less
prints the current user environment, giving the values of currently defined variables.
• setenv – set or display value of environment variables
• setserial – used by root to configure a serial port
• setterm – set terminal attributes for a virtual console
• setuid – set the id of a program when it is run. Used, for example, to give root privileges to a program run by an ordinary user. This is actually done by running the chmod program as root. See the chmod command for the syntax.
• setup – Slackware program to set up program sets and configure system. Setup devices and file systems, mount root file system
• sh – standard UNIX shell. On Linux, just another name for bash.
• shift – promotes each command-line argument. This is a shell builtin.
• showmount – show information about an nfs server
• shutdown – reboot or shut down system as root, after specified amount of time. With the -r option, reboot. With the -h option, halt the system.
o usage: shutdown -r minutes
• sleep – creates process that sleeps for specified interval
• sliplogin – attaches a SLIP interface to standard input. Used to allow dialin SLIP connections.
• sort – sorts and/or merge files
• split – split file into specified number of segments
• ssh – secure shell. Apparently has many of the same functionalities as rlogin, telnet, ftp, rsh, etc., with better security and encryption features. We may want to learn how to set this up and use it.
• startx – front end to xinit in Linux. This is a script which starts up X clients and shuts down the X server on exit from the window manager.
• startx — :1 – start the next X window session on the display 1 (the default is opened on display 0). One can switch between different graphical displays using [Ctrl][Alt][F7], [Ctrl][Alt][F8], etc.
• stty – sets or displays operating options for terminal
• su – log in as another user, including root
• sudo – allows individual users to have root permission to perform specified tasks
• swapoff – disables swap disk
• swapon – enables swap disk
• symlinks – provide list of and information about symbolic links
• sync – writes memory buffers to physical devices
• systat – query host for system information