≡ Menu

linux command

Linux: HowTo Copy a Folder [ Command Line Option ]

I'm a new Linux user. How do I copy a directory or folder under Linux operating system using command line options and bash shell?
[click to continue…]

HowTo: Linux / Unix Move Directory Up One Level

I would like to move a directory one level up into the root directory. I've all html files located in /home/apache2/www/html directory, and I'd like to move /home/apache2/www/html to one level up at /home/apache2/www/. How can I accomplish this over the ssh session?
[click to continue…]

Linux Command: Show Linux Version

What command I need to type to display Linux kernel version and other information such as Linux distribution name? How do I check Linux kernel version number?
[click to continue…]

Bash Shell: Ignore Aliases and Functions When Running A Command

How do I ignore bash shell aliases or functions when running a command without removing alias or function from memory or current shell session on a Linux or Unix-like systems?
[click to continue…]

Debian / Ubuntu Linux Install tracepath / traceroute6 / tracepath6 commands

Q. I'm not able to run tracepath or tracepath6 under Debian Linux. tracepath is default under CentOS Linux. How do I install tracepath command under Debian Linux 4.x server? How do I find out what package owns the command under Debian / Ubuntu Linux?
[click to continue…]

Unix Create a Symbolic Link

How do I create a symbolic links under Linux or Unix like operating systems using command line options?
[click to continue…]

How do I find a Unix / Linux command?

Q. How do I find UNIX / Linux command for particular task?
[click to continue…]

Explain Usage Of The Linux Left Bracket /usr/bin/[ Command

Q. I see [ command in /usr/bin directory. What is the /usr/bin/[ command used for?
[click to continue…]

HowTo: Find Out Hard Disk Specs / Details on Linux

Can you tell me a Linux command to find out information about my hard disk such as description, product name, bus type, size, and cache memory size under Linux operating systems using command line options?
[click to continue…]

Squid Proxy Sever View logs / log files

Q. How do I view squid proxy server log files under CentOS Linux server 5.0?

A. squid is a high-performance proxy caching server for web clients, supporting FTP, gopher, and HTTP data objects. Unlike traditional caching software, squid handles all requests in a single, non-blocking, I/O-driven process.

/var/log/squid/ log file directory

The logs are a valuable source of information about Squid workloads and performance. The logs record not only access information, but also system configuration errors and resource consumption (eg, memory, disk space). There are several log file maintained by Squid. Some have to be explicitely activated during compile time, others can safely be deactivated during.

  • /var/log/squid/access.log : Most log file analysis program are based on the entries in access.log. You can use this file to find out who is using squid server and what they are doing etc
  • /var/log/squid/cache.log : The cache.log file contains the debug and error messages that Squid generates. If you start your Squid using the default RunCache script, or start it with the -s command line option, a copy of certain messages will go into your syslog facilities. It is a matter of personal preferences to use a separate file for the squid log data.
  • /var/log/squid/store.log : The store.log file covers the objects currently kept on disk or removed ones. As a kind of transaction log it is ususally used for debugging purposes. A definitive statement, whether an object resides on your disks is only possible after analysing the complete log file. The release (deletion) of an object may be logged at a later time than the swap out (save to disk).

How do I view Squid Log files / logs?

You can use standard UNIX / Linux command such as grep / tail to view log files. You must login as root or sudo command to view log files.

Display log files in real time

Use tail command as follows:
# tail -f /var/log/squid/access.log
$ sudo tail -f /var/log/squid/access.log

Search log files

Use grep command as follows:
grep 'string-to-search' /var/log/squid/access.log

View log files

Finally you can use text editor such as vi to view log files:
# vi /var/log/squid/access.log