Explore

Loading

Wednesday, February 15, 2012

Unix commands-displaying files with less,directory access


1.4. Displaying a File with less
Run less less filename
Next line RETURN
Next Page SPACE
Previous line k
Previous Page b
1.5. Directories
Change Directory cd directory
Make New Directory mkdir directory
Remove Directory rmdir directory
Print Working (Show Current) Directory pwd

Tuesday, February 14, 2012

Unix Commands

1. Files

1.1. Filename Substitution
Wild Cards ? *
Character Class (c is any single character) [c…]
Range [c-c]
Home Directory ~
Home Directory of Another User ~user
List Files in Current Directory ls [-l]
List Hidden Files ls -[l]a
1.2. File Manipulation
Display File Contents cat filename
Copy cp source destination
Move (Rename) mv oldname newname
Remove (Delete) rm filename
Create or Modify file pico filename
1.3. File Properties
Seeing Permissions ls -l filename
Changing Permissions chmod nnn filename
chmod c=p…[,c=p…] filename
n, a digit from 0 to 7, sets the access level for the user
(owner), group, and others (public), respectively. c is one of:
u–user; g–group, o–others, or a–all. p is one of: r–read
access, w–write access, or x–execute access.
Setting Default Permissions umask ugo
ugo is a (3-digit) number. Each digit restricts the default
permissions for the user, group, and others, respectively.
Changing Modification Time touch filename
Making Links ln [-s] oldname newname
Seeing File Types ls -F

Monday, February 13, 2012

Slackware 13.37 is released

It's true! Slackware 13.37 has been released. Nearly a year in the making, you will appreciate the performance and stability that can only come with careful and rigorous testing. Slackware 13.37 uses the 2.6.37.6 Linux kernel (hence our new $SLACKWARE_VERSION.$KERNEL_VERSION naming system used for this release ;-), and also ships with 2.6.38.4 kernels for those who want to run the latest (and also includes configuration files for 2.6.35.12 and 2.6.39-rc4). The long-awaited Firefox 4.0 web browser is included, the X Window System has been upgraded (and includes the open source nouveau driver for nVidia cards). The venerable Slackware installer has been improved as well, with support for installing to btrfs (for those who would like to try a new copy on write filesystem), a one-package-per-line display mode option, and alienBOB's big surprise: an easy to set up PXE install server that runs right off the DVD!

That's right, another stable release of Slackware is finally ready to go. Slackware 13.1 is available in both 32-bit x86 and 64-bit x86_64 editions, and brings with it many major improvements, like KDE SC version 4.4.3, the 2.6.33.4 Linux kernel, a new toolchain, updated libraries, and major applications such as Firefox and Thunderbird. 


Slackware for ARM

Slackware has a new official port for the ARM architecture, by the name of ARMedslack, which has recently released the port of Slackware version 12.2.
ARMedslack began in 2002 by Stuart Winter, with the primary goal of providing a full Slackware port for ARM desktop machines - initially targeting the Acorn StrongARM RiscPC, and later embedded devices.
Slackware ARM now supports native installation using the regular Slackware installer on the ARM Versatile board (via the QEMU emulator) and the recently announced embedded device: the Marvell SheevaPlug

Slackware ARM version 12.2 is built for armv4, little endian, "legacy" ABI. A new port to the EABI is already underway and expected to be available in "-current" form within a few months.

Browsers in linux


The first thing that people think about when they hear the word Internet is “surfing the net”. Or looking at websites using a web browser. This is probably by far the most popular use of the Internet for the average user.
Slackware provides popular graphical web browsers in the “XAP” series, as well as text mode browsers in the “N” series. We'll take a quick look at some of the most common options below.
lynx is a text-based web browser. It is a very quick way of looking up something on the Internet. Sometimes graphics just get in the way if you know exactly what you're after.
To start lynx, just type lynx at the prompt:
% lynx
Figure Lynx default start page


You may want to specify a site for lynx to open to:
lynx prints the command keys and what they do at the bottom of the screen. The up and down arrow keys move around the document, Enter selects the highlighted link, and the left arrow goes back to the previous page. Typing d will download the currently selected file. The g command brings up the Go prompt, where you can give lynx a URL to open.
There are many other commands in lynx. You can either consult the man page, or type h to get the help screen for more information.
Just like lynx, links is a textmode web browser, where you do all the navigation using the keyboard. However, when you press the Esc key, it will activate a very convenient pulldown menu on the top of the screen. This makes it very easy to use, without having to learn all the keyboard shortcuts. People who do not use a text browser every day will appreciate this feature.
links seems to have better support for both frames and tables, when compared to lynx.
Figure Links, with the file menu open


wget
wget is a command line utility that will download files from a specified URL. While not an actual web-browser, wget is used primarily to grab whole or partial web sites for offline viewing, or for fast download of single files from HTTP or FTP servers instead. The basic syntax is:
% wget <url>
You can also pass options. For example, this will download the Slackware web site:
% wget --recursive http://www.slackware.com
wget will create a www.slackware.com directory and store the files in there, just as the site does.
wget can also download files from FTP sites; just specify an FTP URL instead of an HTTP one.
% wget ftp://ftp.gnu.org/gnu/wget/wget-1.8.2.tar.gz
--12:18:16--  ftp://ftp.gnu.org/gnu/wget/wget-1.8.2.tar.gz
           => `wget-1.8.2.tar.gz'
Resolving ftp.gnu.org... done.
Connecting to ftp.gnu.org[199.232.41.7]:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.   ==> PWD ... done.
==> TYPE I ... done. ==> CWD /gnu/wget ... done.
==> PORT ... done.   ==> RETR wget-1.8.2.tar.gz ... done.
Length: 1,154,648 (unauthoritative)

100%[==================================>] 1,154,648     209.55K/s    ETA 00:00

12:18:23 (209.55KB/s) - `wget-1.8.2.tar.gz' saved [1154648]

wget has many more options, which make it nice for site specific scripts (web site mirroring and so forth). The man page should be consulted for more information.


List of graphical browsers

Abaco
Amaya
Arena
Arora
Beonex
Camino
Conkeror
Chromium
Dillo
Epiphany
Flock
Galeon
GNU
iCab
Iceape
Kazehakase
Kirix
Konqueror
Midori
Mothra
Mozilla
NetSurf
OmniWeb
Opera
Rekonq
Safari
SeaMonkey
Shiira
Swiftfox
Swiftweasel
TenFourFox
tkWWW

credits:http://en.wikipedia.org/wiki/List_of_web_browsers_for_Unix_and_Unix-like_operating_systems

Sunday, February 12, 2012

DNS Tools in linux


Domain Name Service (DNS for short) is that magical protocol that allows your computer to turn meaningless domain names like www.slackware.com into meaningful IP address like 64.57.102.34. Computers can't route packets to www.slackware.com, but they can route packets to that domain name's IP address. This gives us a convenient way to remember machines. Without DNS we'd have to keep a mental database of just what IP address belongs to what computer, and that's assuming the IP address doesn't change. Clearly using names for computers is better, but how do we map names to IP addresses?
host can do this for us. host is used to map names to IP addresses. It is a very quick and simple utility without a lot of functions.
www.slackware.com is an alias for slackware.com.
slackware.com has address 64.57.102.34
But let's say for some reason we want to map an IP address to a domain name; what then?
nslookup is a tried and true program that has weathered the ages. nslookup has been deprecated and may be removed from future releases. There is not even a man page for this program.
% nslookup 64.57.102.34
Note:  nslookup is deprecated and may be removed from future releases.
Consider using the `dig' or `host' programs instead.  Run nslookup with
the `-sil[ent]' option to prevent this message from appearing.
Server:         192.168.1.254
Address:        192.168.1.254#53

Non-authoritative answer:
www.slackware.com       canonical name = slackware.com.
Name:   slackware.com
Address: 64.57.102.34
The meanest dog in the pound, the domain information groper, dig(1) for short, is the go-to program for finding DNS information. dig can grab just about anything from a DNS server including reverse lookups, A, CNAME, MX, SP, and TXT records. dig has many command line options and if you're not familiar with it you should read through it's extensive man page.
% dig @192.168.1.254 www.slackware.com mx

; <<>> DiG 9.2.2 <<>> @192.168.1.254 www.slackware.com mx
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26362
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;www.slackware.com.             IN      MX

;; ANSWER SECTION:
www.slackware.com.      76634   IN      CNAME   slackware.com.
slackware.com.          86400   IN      MX      1 mail.slackware.com.

;; AUTHORITY SECTION:
slackware.com.          86400   IN      NS      ns1.cwo.com.
slackware.com.          86400   IN      NS      ns2.cwo.com.

;; ADDITIONAL SECTION:
ns1.cwo.com.            163033  IN      A       64.57.100.2
ns2.cwo.com.            163033  IN      A       64.57.100.3

;; Query time: 149 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Sat Nov  6 16:59:31 2004
;; MSG SIZE  rcvd: 159
This should give you an idea how dig works. “@192.168.1.254” specifies the dns server to use. “www.slackware.com” is the domain name I am performing a lookup on, and “mx” is the type of lookup I am performing. The above query tells me that e-mail to www.slackware.com will instead be sent to mail.slackware.com for delivery.
finger(1) will retrieve information about the specified user. You give finger a username or an email address and it will try to contact the necessary server and retrieve the username, office, telephone number, and other pieces of information. Here is an example:
% finger johnc@idsoftware.com
finger can return the username, mail status, phone numbers, and files referred to as “dot plan” and “dot project”. Of course, the information returned varies with each finger server. The one included with Slackware returns the following information by default:
·         Username
·         Room number
·         Home phone number
·         Work phone number
·         Login status
·         Email status
·         Contents of the .plan file in the user's home directory
·         Contents of the .project file in the user's home directory
The first four items can be set with the chfn command. It stores those values in the /etc/passwd file. To change the information in your .plan or .project file, just edit them with your favorite text editor. They must reside in your home directory and must be called .plan and .project.
Many users finger their own account from a remote machine to quickly see if they have new email. Or, you can see a user's plan or current project.
Like many commands, finger has options. Check the man page for more information on what special options you can use.
Someone once stated that telnet was the coolest thing he had ever seen on computers. The ability to remotely log in and do stuff on another computer is what separates Unix and Unix-like operating systems from other operating systems.
telnet allows you to log in to a computer, just as if you were sitting at the terminal. Once your username and password are verified, you are given a shell prompt. From here, you can do anything requiring a text console. Compose email, read newsgroups, move files around, and so on. If you are running X and you telnet to another machine, you can run X programs on the remote computer and display them on yours.
To login to a remote machine, use this syntax:
% telnet <hostname>
If the host responds, you will receive a login prompt. Give it your username and password. That's it. You are now at a shell. To quit your telnet session, use either the exit command or the logout command.
* Telnet does not encrypt the information it sends. Everything is sent in plain text, even passwords. It is not advisable to use telnet over the Internet. Instead, consider the Secure Shell(PKE). It encrypts all traffic and is available for free.
Now that we have convinced you not to use the telnet protocol anymore to log into a remote machine, we'll show you a couple of useful ways to use telnet.
You can also use the telnet command to connect to a host on a certain port.
% telnet <hostname> [port]
This can be quite handy when you quickly need to test a certain service, and you need full control over the commands, and you need to see what exactly is going on. You can interactively test or use an SMTP server, a POP3 server, an HTTP server, etc. this way.
In the next figure you'll see how you can telnet to a HTTP server on port 80, and get some basic information from it.
Electronic mail is one of the most popular things one can do on the Internet. In 1998, it was reported that more electronic mail was sent than regular mail. It is indeed common and useful.
Under Slackware, we provide a standard mail server, and several mail clients. All of the clients discussed below are text-based. A lot of Windows users may be against this, but you will find that a text based client is very convenient, especially when checking mail remotely. Fear not, there are many graphical e-mail clients such as KDE's Kmail. If you wish to use one of those check its help menu.
pine is not elm. Or so the saying goes. The University of Washington created their program for Internet news and email out of a need for an easy mail reader for their students. pine is one of the most popular email clients in use today and is available for nearly every flavor of Unix and even Windows.
elm
elm is another popular text-based email client. Though not quite as user friendly as pine, it's definitely been around a lot longer.
By default, you are placed in your inbox. The messages are listed with the message number, date, sender, and subject. Use the arrow keys to highlight the message you want. Press Enter to read the message.
To compose a new message, type m at the main screen. The d key will flag a message for deletion. And the r key will reply to the current message you are reading. All of these keys are displayed at the bottom of the screen with a prompt.
The man page discusses elm in more detail, so you will probably want to consult that before using elm.
“All mail clients suck. This one just sucks less.” mutt's original interface was based on elm with added features found in other popular mail clients, resulting in a hybrid mutt.
Some of mutt's features include:
·         color support
·         message threading
·         MIME and PGP/MIME support
·         pop3 and imap support
·         support for multiple mailbox formats (mbox, MMDF, MH, maildir)
·         highly customizabl
nail is a command line driven mail client. It is very primitive and offers pretty much nothing in the way of user interfaces. However, mailx is handy for times when you need to quickly mail something, scripting a bulk mailer, testing your MTA installation or something similar. Note that Slackware creates symbolic links to nail at /usr/bin/mail and /usr/bin/mailx. Any of these three commands executes the same program. In fact, you will most likely see nail referred to as mail.
The basic command line is:
% mailx <subject> <to-addr>
mailx reads the message body from standard input. So you can cat a file into this command to mail it, or you can just type text and hit Ctrl+D when finished with the message.