Basic Linux Commands

ls - List files, show directory, in alphabetical order

logout - Logs off system

mkdir - Make a directory. Make Directory. Example: mkdir /tmp/myfiles/

rmdir - Remove Directory (rm -r to delete folders with files). Remove Directory. Example: rmdir /tmp/myfiles/

rm - Remove files. Delete a file. Example: rm /tmp/mp3files.txt

cd - Change current directory. “Change Directory”. When typed all by itself, it returns you to your home directory.

man - Shows help on a specific command

pico - Easy to use text editor to edit files. Just like vi

more - Views a file, pausing every screenful

telnet - Connect to another Internet site

ftp - Connects to a FTP site

lynx - A textual World Wide Web browser

chsh - change the shell you log into

grep - search for a string in a file

tail - Display the last few lines of a text file. Example: tail /etc/services

who - shows who is logged into the local system

w - shows who is logged on and what they're doing

df - shows disk space available on the system

du - shows how much disk space is being used up by folders

chmod - changes permissions on a file

gzip - best compression for UNIX files

zip - zip for files

tar - combines multiple files into one or vice-versa

pwd - “Print Working Directory”. Shows the current location in the directory tree.

file - Find out what kind of file it is. For example, “file /bin/ls” tells us that it is a Linux executable file.

cat - Display the contents of a text file on the screen. For example: cat mp3files.txt would display the file we created in the previous section.

head - Display the first few lines of a text file. Example: head /etc/services

cp - Copies a file from one location to another. Example: cp mp3files.txt /tmp (copies the mp3files.txt file to the /tmp directory)

mv - Moves a file to a new location, or renames it.

ps - Lists currently running process (programs).

id - Print your user-id and group id's

top - Displays CPU processes in a full-screen GUI. A great way to see the activity on your computer in real-time. Type “Q” to quit.

free - Displays amount of free and used memory in the system.

clear - Clear the screen

echo - Display text on the screen. Mostly useful when writing shell scripts. For example: echo “Hello World”

grep - Search for a pattern in a file or program output.

sort - Sort a file or program output. Example: sort mp3files.txt

nl - Display file contents with line numbers

ln - Link files

less - Page through files

od - View binary data

xxd - View binary data

gv - View Postscript/PDF files

xdvi - View TeX DVI files

emacs - Text editor

vim - Text editor

umask - Set default file protections

soffice - Edit Word/Excel/PowerPoint docs

abiword - Edit Word documents

gnumeric - Edit Excel documents

stat - Display file attributes

wc - Count bytes/words/lines

touch - Change file timestamps

chgrp - Change file group

chattr - Change advanced file attributes

lsattr - List advanced file attributes

find - Locate files

slocate - Locate files via index

which - Locate commands

whereis - Locate standard files

grep - Search text for matching lines

cut - Extract columns

paste - Append columns

tr - Translate characters

sort - Sort lines

uniq - Locate identical lines

tee - Copy stdin to a file andto stdout simultaneously

gzip - Compress files

compress - Compress files (Unix)

bzip2 - Compress files (BZip2)

zip - Compress files (Windows Zip)

diff - Compare files line by line

comm - Compare sorted files

cmp - Compare files byte by byte

md5sum - Compute checksums

df - Show free disk space

mount - Make a disk accessible

fsck - Check a disk for errors

sync - Flush disk caches

mt - Control a tape drive

dump - Back up a disk

restore - Restore a dump

tar - Read/write tape archives

cdrecord - Burn a CD

rsync - Mirror a set of files

lpr - Print files

lpq - View print queue

lprm - Remove print jobs

look - Look up spelling

aspell - Check spelling interactively

spell - Check spelling in batch

uptime - View the system load

top - Monitor processes

xload - Monitor system load

free - Display free memory

kill - Terminate processes

nice - Set process priorities

renice - Change process priorities

sleep - Wait for some time

watch - Run programs at set intervals

at - Schedule a job

crontab - Schedule repeated jobs

uname - Print system information

hostname - Print the system’s hostname

ifconfig - Set/display network information

host - Look up DNS

whois - Look up domain registrants

ping - Check if host is reachable

traceroute - View network path to a host

ssh - Securely log into remote hosts

telnet - Log into remote hosts

scp - Securely copy files between hosts

sftp - Securely copy files between hosts

ftp - Copy files between hosts

wget - Retrieve web pages to disk

mesg - Prohibit talk/write

grip - Play CDs and rip MP3s

xmms - Play audio files

cdparanoia - Rip audio

audacity - Edit audio

xcdroast - Burn CDs