Recent Articles

Reconsidering The Value Of OSS Indemnification
With Microsoft agreeing not to sue Novell SLES Support Subscription customers for patent infringement issues, maybe it's time to reconsider the value of OSS indemnification?

Vi in a Nutshell
The unix text editor vi probably has more features than Microsoft Word yet I've only been using about 5 of them. Recently I've been learning a bit more about it.

A List of Amazon S3 Backup Tools
In an effort to replace my home backup server with Amazon's S3, I've been collecting a list of Amazon S3 compatible backup tools to look at.

Apple's Unix To Surpass Linux?
Tom Yager dusted off his crystal ball this morning in order to answer the question "where will Linux thrive?"

Red Hat Choice Academic To Colleges
The company announced a trio of universities would adopt Red Hat Enterprise Linux and Red Hat Network solutions for some of their computing needs.

Centrify Boosts Unix Access To Active Directory
The company announced at the LinuxWorld Conference & Expo that its DirectControl Suite now supports a number of UNIX and Linux platforms.

Filepro Conversion
In years past, I did a lot of Filepro work. This goes way, way back: I worked on the first Tandy Xenix version when it was still beta - so beta that it couldn't even do floating point math reliably!

Legacy ISA
I found a professed "competent" student at the local university who spent a couple of hours destroying the setup in one of the machines. We now have one...


11.14.06


The 15 Commands Essential For Unix

By Pete Freitag

Learning UNIX is a seemingly daunting task, there are thousands of commands out there, each with hundreds of options. But in reality you only need to know a few of them.

I use unix quite a bit, usually either on one of our Linux servers, or on my Powerbook with OS X. And these are the 15 commands that I use most. If you can memorize these 15 commands, you can do quite a bit on a unix operating system, and add unix as a skill on your resume.

The 15 Most Important UNIX commands

1. man - show manual for a command, example: man ls hit q to exit the man page.

2. cd - change directory, example: cd /etc/

3. ls - list directory, similar to dir on windows. example: ls /etc, use ls -l /etc to see more detail

4. cp - copy a file or directory, example: cp source dest if you want to copy a directory use the -R option for recursive: cp -R /source /dest

5. mv - move a file, example: mv source dest

6. rm - remove a file, example: rm somefile to remove a directory you may need the -R option, you can also use the -f option which tells it not to confirm each file: rm -Rf /dir

7. cat - concatenate, or output a file cat /var/log/messages

8. more - outputs one page of a file and pauses. example: more /var/log/messages press q to exit before getting to the bottom. You can also pipe to more | more from other commands, for example ls -l /etc | more

9. scp - secure copy, copies a file over SSH to another server. example: scp /local/file user@host.com:/path/to/save/file


10. tar - tape archiver, tar takes a bunch of files, and munges them into one .tar file, the files are often compressed with the gzip algorithm, and use the .tar.gz extension. to create a tar tar -cf archive.tar /directory, then to extract the archive to the current directory run tar -xf archive.tar to use gzip, just add a z to the options, to create a tar.gz: tar -czf archive.tar.gz /dir to extract it tar -xzf archive.tar.gz

11. grep - pattern matcher, grep takes a regular expression, or to match a simple string you can use fast grep, fgrep failure /var/log/messages, I'm usually just looking for a simple pattern so I tend to use fgrep more than regular grep.

12. find - lists files and directories recursively on a single line, I usually pipe grep into the mix when I use find, eg: find / | fgrep log

13. tail - prints the last few lines of a file, this is handy for checking log files tail /var/log/messages if you need see more lines, use the -n option, tail -n 50 /var/log/messages you can also use the -f option, which will continuously show you the end of the file as things are added to it (very handy for watching logs) tail -f /var/log/messages

14. head - same as tail, but shows the first few lines the file

15. vi - text editor, there are several text editors such as emacs, and nano, but vi is usually installed on any server so its a good one to learn. To edit a file type vi file to edit a line press Esc i then to save changes and exit use Esc wq, or to quit without saving use Esc q!. There are a million other commands, but that will enable you to edit files at a basic level.

Once you learn these commands, and are comfortable with them, you shouldn't stop there, there are lots of other commands that can make your life easier.

Did I miss any commands that you think are essential to using a UNIX based operating system?

* Originally published at Pete Freitag's Homepage


About the Author:
Pete Freitag is a software engineer, and web developer located in central new york. Pete specializes in the HTTP protocol, web services, xml, java, and coldfusion. In 2003 Pete published the ColdFusion MX Developers Cookbook with SAMs Publishing. Pete owns a Firm called Foundeo that specializes in Web Consulting, and Products for Web Developers.

About UnixProNews
UnixProNews is a collection of news and commentary designed to keep you in step with the ever evolving landscape of Unix environments. News and Advice for Unix Professionals

UnixProNews is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
LinuxProNews.com WirelessProNews.com
CProgrammingTrends.com ITCertificationNews.com


-- UnixProNews is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2006 iEntry, Inc. All Rights Reserved Privacy Policy Legal

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article


News and Advice for Unix Professionals UnixProNews News Archives About Us Feedback UnixProNews Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact