Just deleted tons of stale, unsused user accounts. Here are some KSH shell basics and special shell variable. I need to Google them up myself to get reminded that ‘$?’ is the output variable for script execution. That is, it’s 0 for successful execution and 1 if there is any error.
Category: Unix
When we say or mention the word Web Server, the first thing that comes to our mind is Apache, right? (if you don’t then what are you doing here reading this?
)
Apache is the most well known open source web server there is! Open source?? Make that the most wildly used webserver on the internet, period!
It is believed (and i know they made a survey or study about it) that Apache takes 90% of all web servers in the internet. Most web hosting company, and I’ve once worked in one, use Apache.
This post will talk about how to setup Apache for Virtual Hosting
Who in heaven is Arlo Gilbert? Yep, using ‘heaven’ is perfect for describing this man for he do sometimes tries to conquer heaven. He’s into planes you see.
Anyway, you’re probably Googling about Arlo Gilbert as you read this post. Well, let me save you a few minutes and introduce you to Mr. Gilbert in one fast minute.
He is the following:
- The Man is from Austin, Texas
- Arlo Gilbert is a high school drop out… and a proud one (don’t do that boys and girls)
- A family man! So there’s a Mrs. Gilbert and two little Arlo Gilberts (daughters)
The reason why we feature this brilliant man is that he has successfully launched online startups and been doing it for 10 years now. Remember, high school dropout and no training in marketing or any business related studies… Brilliant indeed.
What caught my attention while reading his ‘About’ page was his current project – the iCall. It’s a VOIP startup company. I was wondering if iCall was developed by Arlo Gilbert or if it uses Asterisk?
.
.
.
Yep, this is a dummy’s reference… I keep on forgetting the syntax so I might as well put it here for my own reference…
vi is the one, if not the most popular text editor available for a System Administrator on a UNIX and UNIX-like machines.
It has two modes, command and editor mode.
Here are some syntax in using the Search and Replace in ‘vi’.
Search:
The most basic and most easily remembered command for searching is vi is slash or ‘/’ followed by the character being searched. That’s for forward searching. For backward, vi use ‘?’ followed by the string being searched.
To go to the next occurrance of the string being searched, vi use ‘n’ command. Doesn’t matter if your searching forward (from up, down) or backward, from down to top.
Example:
(you have to be in command mode… press ESC first)
/search_string
?search_string
Search and Replace
For search and replace, use the syntax
:%s/original/replaced/g
Make sense?
Any command that begins with a “:” is called a line mode command and performs its duty on the line the cursor is currently on.
The above syntax serves my purpose now… If I want to replace text in certain ranges.. syntax can be found here
/proc is a pseudo-filesystem used to access process information from the kernel. It doesn’t use any storage space and uses little memory. On Linux, you can sometimes make modifications to the running kernel by modifying “files” in /proc.
If / is full, run a command similar to the following to sort all files in the / file system by size:
find / -xdev -ls | sort -n -k 7
“-xdev” limits the find command to the root file system.
This will only look for files found in the root and will not includes those partitions that are defined in /etc/vfstab | /etc/fstab file, those listed when `df -k` is executed:
/dev/md/dsk/d0 2058319 1016097 980473 51% /
/dev/md/dsk/d3 2058319 1801793 194777 91% /var
etc .. etc..
Thanks Brandon!
Brandon H. – Senior UNIX Systems Engineer for an application services provider in Minneapolis, MN.
NFS, DNS, NIS and NIS+… that’s a lot of acronyms!
Network File System
NFS is Sun’s Networked File System, and by now, more or less, the de facto method of sharing file systems between computers.
Domain Name Service
DNS is the Domain Name Service, which is the way information about hostnames and addresses are shared across the Intenet.
Network Information (Name) Service
NIS stands for Network Information Name Service. It was original called Yellow Pages, which is why many of the commands for NIS start with yp (such as ypbind, ypcat, etc.) NIS was developed by Sun, and is, like NFS, more or less the default way of sharing system information between UNIX machines.
NIS+
NIS+ is Sun’s re-implementation of NIS. It attempts to address some of the problems with NIS, but the implementers of NIS+ have made a series of bad choices in the design of NIS+, so it has seen only limited usage compared to the other types of services you asked about.
This tip is a give away. Everyone knows this, but for those who doesn’t or forgot… here’s refresher…
Here’s a typical output of a file listing using `ls -l` on a directory:
[root@unix-box icons]# ls -l | more
total 636
-rw-r–r– 1 elizar root 246 Aug 26 2005 a.gif
-rw-r–r– 1 elizar root 242 Aug 26 2005 alert.black.gif
-rw-r–r– 1 elizar root 279 Aug 26 2005 alert.black.png
-rw-r–r– 1 elizar root 247 Aug 26 2005 alert.red.gif
-rw-r–r– 1 elizar root 298 Aug 26 2005 alert.red.png
-rw-r–r– 1 elizar root 2326 Aug 26 2005 apache_pb.gif
-rw-r–r– 1 elizar root 1385 Aug 26 2005 apache_pb.png
-rw-r–r– 1 elizar root 293 Aug 26 2005 a.png
When using the -l (dash ‘el’) option of ls, the output will display a more detailed listing of the files. Here you’ll see the file properties/permission (-rw-r–r–) the number of links, the owner of the file, the group of the user, file size, the date/time stamp and finally the file name. That’s 7 column.
Changing The Time Stamp Of A File
To change the time stamp of a file (the 6th column in the `ls -l` listing), we use the UNIX command touch.
From the Man Pag:
NAME
touch – change file timestampsSYNOPSIS
touch [OPTION]… FILE…
touch [-acm] MMDDhhmm[YY] FILE… (obsolescent)
There are many options for the touch command, but the one I use fairly often is the -t option
-t STAMP; use [[CC]YY]MMDDhhmm[.ss]
Example:
[root@unix-box icons]# touch -t 200607161201 a.gif
[root@unix-box icons]# ls -l | more
total 636
-rw-r–r– 1 elizar root 246 Jul 16 2006 a.gif
-rw-r–r– 1 elizar root 242 Aug 26 2005 alert.black.gif
Other options that you may find useful are -a (change access time only) -m (modification time only) and others. Consult the man page for more details
Cheers!