Home of The Linux Revolution
PicoSearch

Quick Links

 Home 
 Distros 
 Mandrake
 Slackware
 All
 Topics 
Linux 
What is
Linux?
Why Use
Linux?
 
GUI 
What
is X?
Scroll 
Mouse
 Commands 
Commands
Reference
.tar.gz
 GIMP 
Save As
GIF
Outlines
Links
(Coming Soon!)

Windows Info

Common Linux Commands Reference

Some of the more common Linux commands, their usage, a DOS equivalent (if any), an example of how to use the command, and an explanation of the command usage is displayed below.

This page is not meant to be an exhaustive command listing, only a listing of some of the most used Linux commands.

You can find more information on a command by typing "command --help" or "man command"


Jump Directly to a Command

Command Use Like DOS
Command Example  (Explanation)
 
apropos locate commands by keyword lookup No Equivalent
apropos copy  (displays commands that copy)
 
cal display a calendar No Equivalent
cal  (displays a calendar)
 
cd change directory cd
cd /  (changes to the root [/] directory)
 
chgrp modify file / directory group cacls
chgrp users /Public  (makes the users group owner of the /Public directory)
 
cat concatenate and write to the display type
cat file.txt  (shows the contents of file.txt)
cat file1.txt file2.txt > file3.txt  (combines the contents of file1 and file2 into file3)
 
chmod modify file / directory permissions cacls
chmod 777 file  (allows every read, write, and execute permissions to "file")
 
chown modify file / directory owner cacls
chown user1 file.txt  (changes the owner of file.txt to user1)
 
chsh changes the shell of the user No Equivalent
chsh user1  (starts change shell routine for user1)
 
clear clear the screen cls
clear  (clears the display)
 
cp copy file copy
cp file1.txt file2.txt  (copies file1.txt to file2.txt)
 
cpio copy file in and out of an archive No Equivalent
Many Options... Topic coming soon...
 
date displays current date and time date
date  (displays current time and date)
 
df show free space on mounted filesystems No Equivalent
df  (shows free space on filesystems)
 
dhcpcd / dhcpr
(depending on distro)
request ip configuration via DHCP ipconfig
dhcpcd eth0  (gets a dynamic IP for the first interface)
dhcpr eth0  (gets a dynamic IP for the first interface)
 
diff find differences between files comp
diff file1.txt file2.txt  (displays the differences between file1 and file2)
 
dig nameserver query nslookup
dig @10.10.10.1 www.TheLinuxRevolution.net  (queries the DNS server 10.10.10.1 for ip name information for www.TheLinuxRevolution.net)
 
du show how much space files / directories use No Equivalent
du -hs *  (shows size for every file / directory in this directory)
 
echo display to the screen echo
echo "This is a test"  (Displays 'This is a test' to the screen)
 
file display the file type No Equivalent
file file1.txt  (shows the type of file file1.txt is)
 
ftp use ftp ftp
ftp ftp.ftpserver.com  (begins an ftp session with "ftp.ftpserver.com")
 
groups display a user's group membership No Equivalent
groups user1  (displays the groups that user1 belongs to)
 
--help (after a command) help on a command /?
cp --help  (gives help info on the command "cp")
 
history display command history No Equivalent
history  (shows the command history with associated numbers)
!7  (runs history command number 7 [displayed in numbers from "history" command)
 
ifconfig show / configure settings for network interfaces ipconfig
ifconfig eth0  (displays the settings for the first network interface)
ifconfig eth1 192.168.0.1 netmask 255.255.255.0  (configures the addresses for the second network interface)
 
kill terminate a process No Equivalent
kill <ProccessID>  (kills the process with <ProccessID>)
 
less like more, but allows backward movement No Equivalent
less file1.txt  (allows upward and downward paging of file1.txt)
 
ls list files / directories dir
ls  (shows file and directory contents of the current directory)
 
man (before a command) show a command's manual page No Equivalent
man cp  (displays the manual page for the command "cp")
 
mkdir make directory mkdir
mkdir Dir1  (creates a directory named "Dir1")
 
mount mount No Equivalent
mount /dev/hdc /mnt/cdrom  (mounts the device /dev/hdc to the mountpoint /mnt/cdrom)
 
more page through text one screenful at a time more
more file1.txt  (pages forward through file1.txt)
 
mv move / rename file / directory move / ren
mv /home/user/file1.txt /file1.txt  (moves /home/user/file1.txt to the root directory)
mv file1.txt file2.txt  (renames file1.txt to file2.txt)
 
nice (before a command) run command at a lower priority No Equivalent
nice cp * /Copied/  (copies all files in the current directory to the directory "/Copied", but does not use a lot of resources if resources are needed for other processes. Nice can be used in front of most commands)
 
passwd change a password No Equivalent
passwd user1  (enters the password change routine for user1 [only root can change other's passwords])
 
ping send ICMP packets ping
ping 10.10.10.1  (pings 10.10.10.1 [press Ctrl + c to stop pinging])
 
ps show info on processes No Equivalent
ps -u user1  (shows processes running for user1)
 
pwd display the name of the current directory cd
pwd  (displays the "present working directory")
 
rm deletes files / directories del
rm file1.txt  (removes file1.txt)
rm -rf Dir1  (removes the directory "Dir1" and all files underneath it, without prompting for confirmation to delete each file)
 
sleep suspend execution for a specified interval No Equivalent
sleep 10  (waits for 10 seconds)
 
su temporarily run as super-user (root) runas
su  (prompts for root's password, processes can then be run as root)
 
sudo very temporarily run as super-user (root) runas
sudo cp file1.txt file2.txt  (prompts for root's password, then copies file1.txt to file2.txt as root)
 
tail show the last few lines of a file No Equivalent
tail file1.txt  (shows the last few lines of file1.txt [10 by default])
 
telnet start a telnet session telnet
telnet Server1  (begins a telnet session with Server1)
 
touch create blank file / update file No Equivalent
touch file1.txt  (creates a blank file named file1.txt, or updates its last accessed time if file1.txt already exists)
 
traceroute perform a traceroute tracert
traceroute www.google.com  (performs a traceroute to www.google.com)
 
umount unmount a filesystem No Equivalent
umount /mnt/cdrom  (unmounts the cdrom drive)
 
uptime show uptime info about the machine No Equivalent
uptime  (shows uptime information)
 
vi start the visual text editor edit
vi file1.txt  (edit [or create] the file file1.txt)
 
whereis locate a file No Equivalent
whereis cp  (gives the filesystem location of the "cp" command)
 
who show who is logged on to the machine No Equivalent
who  (displays all currently logged in users)
 
whoami display the currently logged on user No Equivalent
whoami  (displays the user you are currently logged in as [helpful with "su" sessions])
 

The Linux Revolution is looking for its next Linux topic. If you have a subject related to Linux that you would like to see here, please email "Topics <at> TheLinuxRevolution.net".


Home Linux Forums Linux Topics Linux Distros
Legal
All images, trademarks and copyrights herein
are property of their respective owners.
All else Copyright © 2004 The Linux Revolution
Linux is a registered trademark of Linus Torvalds.