<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.slackwiki.com/index.php?action=history&amp;feed=atom&amp;title=Common_Commands</id>
	<title>Common Commands - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.slackwiki.com/index.php?action=history&amp;feed=atom&amp;title=Common_Commands"/>
	<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Common_Commands&amp;action=history"/>
	<updated>2026-04-08T01:02:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Common_Commands&amp;diff=81&amp;oldid=prev</id>
		<title>Erik: Copy from old</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Common_Commands&amp;diff=81&amp;oldid=prev"/>
		<updated>2009-06-02T03:22:38Z</updated>

		<summary type="html">&lt;p&gt;Copy from old&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Here is a list of common commands and some descriptions:&lt;br /&gt;
&lt;br /&gt;
  cd &lt;br /&gt;
: Changes the directory. Example: &amp;lt;code&amp;gt;cd /&amp;lt;/code&amp;gt;&lt;br /&gt;
  rm &amp;lt;i&amp;gt;options filename&amp;lt;/i&amp;gt;&lt;br /&gt;
: Removes Files. Example: &amp;lt;code&amp;gt;rm &amp;lt;i&amp;gt;filename&amp;lt;/i&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
::Options: -R - Removes all files and subdirectories (very dangerous). Example: &amp;lt;code&amp;gt;rm -R /home/bill/public_html/&amp;lt;/code&amp;gt;&lt;br /&gt;
  rmdir &amp;lt;i&amp;gt;directory&amp;lt;/i&amp;gt;&lt;br /&gt;
: Removes an Empty Directory. Example: &amp;lt;code&amp;gt;rmdir /home/bill/emptydir&amp;lt;/code&amp;gt;&lt;br /&gt;
  mount &lt;br /&gt;
: Mounts filesystems and partitions, etc&lt;br /&gt;
::Example: &amp;lt;code&amp;gt;mount /mnt/cdrom&amp;lt;/code&amp;gt; &amp;lt;--Only useable if &amp;lt;code&amp;gt;/mnt/cdrom&amp;lt;/code&amp;gt; is listed in [[Fstab|/etc/fstab]]&lt;br /&gt;
::Example: &amp;lt;code&amp;gt;mount -t iso9660 /dev/hdc /mnt/cdrom&amp;lt;/code&amp;gt;&lt;br /&gt;
  ls &amp;lt;i&amp;gt;options optional_directory_path&amp;lt;/i&amp;gt; (if no directory path is given, the current directory is listed)&lt;br /&gt;
: Lists files and directories. Example: &amp;lt;code&amp;gt;ls&amp;lt;/code&amp;gt;&lt;br /&gt;
::Options:&lt;br /&gt;
:::-a - Lists ALL files and directories, even hidden ones. Example: &amp;lt;code&amp;gt;ls -a&amp;lt;/code&amp;gt;&lt;br /&gt;
:::-l - Lists files and directories with details (e.g. permissions) Example: &amp;lt;code&amp;gt;ls -l /home/bill/&amp;lt;/code&amp;gt;&lt;br /&gt;
:::-la - Lists ALL files and directories, even hidden ones with details. Example: &amp;lt;code&amp;gt;ls -la &amp;lt;/code&amp;gt;&lt;br /&gt;
  gunzip &amp;lt;i&amp;gt;filename&amp;lt;/i&amp;gt;&lt;br /&gt;
: Uncompresses gzip'd files.  Example: &amp;lt;code&amp;gt;gunzip somefile.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
  tar &amp;lt;i&amp;gt;options filename&amp;lt;/i&amp;gt;&lt;br /&gt;
: Extracts files from .tar files.&lt;br /&gt;
::Options&lt;br /&gt;
::: -xvf - extract file.tar &amp;lt;code&amp;gt;tar -xvf file.tar&amp;lt;/code&amp;gt;&lt;br /&gt;
::: -zxvf - uncompress and extract from a gzip'd tar archive (*.tar.gz or *.tgz) &amp;lt;code&amp;gt;tar -zxvf kernel-2.6.7.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
::: -jxvf - uncompress and extract from a bzip2'd tar archive (*.tar.bz2) &amp;lt;code&amp;gt;tar jxvf kernel-2.6.7.tar.bz2&amp;lt;/code&amp;gt;&lt;br /&gt;
  mc&lt;br /&gt;
: Console File manager&lt;br /&gt;
  pico &lt;br /&gt;
: Easy console text editor.  NOTE: Pico is in the PINE package.  If you didn't install Pine, you won't have pico.  (You CAN install pico as a stand-alone binary). An alternative to Pico is [http://www.nano-editor.org/ GNU Nano]. It has many features, including syntax highlighting.&lt;br /&gt;
  vi, vim, elvis&lt;br /&gt;
: Console text editors - depending on your setup, one of these is accessed as 'vi'. Vim &amp;amp; Elvis are Vi clones (with a few more features). Between Vim and Elvis, Vim is more featureful, but elvis is in /a and installed by default. You can install vim (or xvim/gvim, gui-enabled versions) instead of, or in addition to elvis.&lt;br /&gt;
  find&lt;br /&gt;
: Program to find files. Example: &amp;lt;code&amp;gt;find / -name lilo.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
  cat&lt;br /&gt;
: Shows what is currently in a text file. Example: &amp;lt;code&amp;gt;cat /proc/cpuinfo&amp;lt;/code&amp;gt;&lt;br /&gt;
  grep&lt;br /&gt;
: Searches for strings. Example: &amp;lt;code&amp;gt;grep &amp;quot;model name&amp;quot; /proc/cpuinfo&amp;lt;/code&amp;gt;  Add the option '-i' if you don't want your search to be case-insensitive&lt;br /&gt;
  less&lt;br /&gt;
: You can control using arrow keys what is displayed in a text file. Example: &amp;lt;code&amp;gt;less /etc/lilo.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
  man&lt;br /&gt;
: Manual pages for commands. Example: &amp;lt;code&amp;gt;man bash&amp;lt;/code&amp;gt;&lt;br /&gt;
  apropos&lt;br /&gt;
: Searches a whatis type database. Example: &amp;lt;code&amp;gt;apropos ftp&amp;lt;/code&amp;gt;&lt;br /&gt;
  which&lt;br /&gt;
: Shows the first match of a program in your path. Example: &amp;lt;code&amp;gt;which bash&amp;lt;/code&amp;gt;&lt;br /&gt;
  whereis&lt;br /&gt;
: Shows man pages, binaries, etc of a program. Example: &amp;lt;code&amp;gt;whereis bash&amp;lt;/code&amp;gt;&lt;br /&gt;
  file&lt;br /&gt;
: Determines the file type. Example: &amp;lt;code&amp;gt;file /usr/bin/bash&amp;lt;/code&amp;gt;&lt;br /&gt;
  dmesg&lt;br /&gt;
: Displays the kernel ring buffer information&lt;br /&gt;
  route&lt;br /&gt;
: Configures the IP routing (used for setting the default gateway, etc.).&lt;br /&gt;
  ifconfig&lt;br /&gt;
: Network interface configuration tool (used to bring the NIC up and down and set the IP).&lt;br /&gt;
  ssh&lt;br /&gt;
: Secure SHell, allows you to login to remote machines.&lt;br /&gt;
  startx&lt;br /&gt;
: A simple script to start X-Windows&lt;br /&gt;
  iwconfig&lt;br /&gt;
: This is for configuring wireless cards&lt;br /&gt;
  chmod&lt;br /&gt;
: Edits permissions on a file or directory (see [[Permissions and Umasks]])&lt;br /&gt;
  netconfig&lt;br /&gt;
: A tool to help you configure a network card on Slackware&lt;br /&gt;
  df&lt;br /&gt;
: Shows the free space on your partitions. Example: &amp;lt;code&amp;gt;df -h&amp;lt;/code&amp;gt;&lt;br /&gt;
  du&lt;br /&gt;
: Calculates disk usage. Example: &amp;lt;code&amp;gt;du -hc&amp;lt;/code&amp;gt;&lt;br /&gt;
  bunzip2&lt;br /&gt;
: Uncompresses .bz2 files. Example: &amp;lt;code&amp;gt;bunzip2 file.bz2&amp;lt;/code&amp;gt;&lt;br /&gt;
  sort&lt;br /&gt;
: Sorts data.  A very useful option is '-f', which makes the sort case-insensitive (i.e. AaBbCc rather than ABCabc).  Another useful option is '-n', which sorts by numbers.  Try &amp;lt;code&amp;gt;du | sort&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;du | sort -n&amp;lt;/code&amp;gt; to see the difference.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Piping&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can mix commands to do certain things. &lt;br /&gt;
&lt;br /&gt;
  dmesg | grep hd&lt;br /&gt;
&lt;br /&gt;
That will search dmesg and try to find the string &amp;quot;hd&amp;quot;. Now piping is extremely useful. Another example of a pipe:&lt;br /&gt;
&lt;br /&gt;
  dmesg | less&lt;br /&gt;
&lt;br /&gt;
Now this command you can see the dmesg fully and is easier to read. &lt;br /&gt;
&lt;br /&gt;
Redirection:&lt;br /&gt;
&lt;br /&gt;
This will save the dmesg information in your home directory in the file log.txt&lt;br /&gt;
&lt;br /&gt;
  dmesg &amp;gt; ~/log.txt&lt;br /&gt;
&lt;br /&gt;
You can also redirect only the [[standard output|stdout]] by using '1&amp;gt;' or only the [[error messages|stderr]] by using '2&amp;gt;'.&lt;br /&gt;
&lt;br /&gt;
For instance, if you want to run a command that gives a lot of junk as output, and you just want to see any errors, you can redirect the output to the null device (&amp;lt;code&amp;gt;/dev/null&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
  mplayer /path/to/movie.avi 1&amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&amp;lt;i&amp;gt;Section on piping moved to [[Piping]]. --sinope&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Tips]]&lt;/div&gt;</summary>
		<author><name>Erik</name></author>
	</entry>
</feed>