Pages

Subscribe: Bookmark and Share

Featured Posts

Thursday, January 31, 2013

How to display a list of recent commands

Linux has a rich command line experience that can sometimes be a little complicated for people changing over from Windows. Showing the list of recent commands is easy to understand, though:

    > history

    1 ps -ef
    2 kill 24188
    3 ps -ef
    4 tail logfile.log

If you want to get a command that you used before but you have a huge history list, you can quickly find it by passing it through grep. Let’s say we remember typing the ftp command, but can’t remember the domain name of the server:
    > history | grep ftp

    321 ftp ftp.cdrom18.com

Pretty simple stuff! What if we want to display the list of items that we use the most often?  We can use a much more complicated command like this:

    > history|awk ‘{print $2}’|awk ‘BEGIN {FS=”|”} {print $1}’|sort|uniq -c|sort -r

    114 ls
    105 ./runreports.sh
    97 cd
    24 uptime
    15 mysql
    13 vi

Saturday, January 14, 2012

File Manipulation Commands in Unix With GUI and CLI

Conqueror is a KDE utility for visualizing and navigating the file system. The location bar displays the directory whose contents are being displayed. The main window can be configured to display information in different ways. Directories and files can be manipulated through menu options, shortcut icons and context-sensitive menus (i.e. by right-clicking on an object).  File permission information can be accessed through the properties option (covered in more detail later).



Command Summary 1.

Command                           Description
startx                           start the graphical display
passwd                       change a user's password

Command Summary 2.

Command-line interface (CLI)
File manipulation with the CLI
Viewing file contents; text editors
File system security – users and groups
Shell job control

Understanding paths is important when using the CLI.  Absolute pathname: a path that describes the location of the file from the root directory, e.g. /home/Dilbert/admin/budget.doc.  Relative pathname: a path that described the location of the file from the current directory, e.g. admin/budget.doc.  A user is automatically placed in his home directory when logging in or opening a new terminal or shell. The command pwd prints the current working directory. Go to Linux Directory Hierarchy


Sunday, August 28, 2011

Linux Directory Hierarchy and Linux Tree Path


Linux Directory Hierarchy
  • Files are grouped into logical units into collections called
  • directories (known as folders in other OS's)
  • Directories may contain subdirectories, resulting in a
  • hierarchical structure
  • The top-most directory in this tree is called the root
  • directory, denoted by a /
  • Each user has a directory set aside for storing personal files
  • – this is called his home directory – uniquely identified by
  • the username e.g /home/dilbert
  • Users should create new directories in their home directories
  • to properly organise their files

Linux Directory Tree

Pathing

The location of a file in the file system is known as its
pathname

For example:
  • /home/dilbert/admin/budget.doc
  • /usr/bin/less

A pathname uniquely defines the path from the root directory to a file. Note that applications are also files in the file system and have their own pathnames.

Linux Desktop Environment and Linux Desktop Features


Linux Desktop Environment

A number of different desktops are available for Linux, each with different look & feel, and functionality. Currently, most popular free desktops are KDE and Gnome Both are distributed with the most popular Linux distributions. Graphical applications may be desktop-specific: e.g. k-tools for KDE. Non desktop-specific: e.g. OpenOffice, Mozilla

Linux Desktop Features

Main desktop area:

  • Application windows
  • Shortcut icons

Panel:

Application menu launcher, offering convenient access to commonly performed tasks.  Application shortcuts should be customized according to user's needs. Desktop switcher, to switch between virtual desktops, allowing the user to group applications logically without cluttering. Taskbar, allowing the user to manage currently running applications System information

 Useful Graphical Applications

  • Word processing / Spreadsheets / Presentations: OpenOffice.org
  • Writer / Calc / Impress
  • Drawing: OpenOffice.org Draw
  • Project management: MrProject
  • Image manipulation: GIMP
  • Web browsing: Mozilla firefox
  • Email: Evolution, Mozilla thunderbird
  • Text editor: Emacs
  • PDF reader: Adobe Acrobat reader, xpdf
  • Accounting: Turbocash, gnucash
  • IRC client: xchat

Saturday, August 20, 2011

Linux File System Basics


Files are entities for storing data in a computer system. There are many types of files: various data files and programs; even devices are represented as files. File name extensions are a convenience for the user – the operating system does not derive any meaning from it

Some common extensions include:

.bz2: File zipped with the bzip2 utility
.c: C source code file
.gif/.jpg/.png: Image files (GIF / JPEG / PNG)
.gz: File zipped with the gzip utility

Common extensions (cont.):

.html: Web page
.mp3: MP3 audio file
.pdf: PDF document format
.pl: Perl script
.rpm: RedHat software package
.odt: OpenOffice.org files (writer / calc / impress / draw)
.tar: Archive created with the tar utility
.txt: Plain text file
.zip: File compressed with the zip utility

Friday, August 19, 2011

What is Linux? and What are Linux Systems Used For?

What is Linux?

Linux began in 1980's as an effort to create a free Unix-like operating system. The project was called GNU and was run by the Free Software Foundation (FSF) created by Richard Stallman. Development began with system tools such as editors, a compiler and hundreds of other utilities. By early 1990's most of the components were written, but the operating system was missing a kernel. Coincidentally, Linux Thorvaldsen of Helsinki University had been working on a Unix-based kernel – the first version was
Completed in 1994.

  • A multitasking, multi-user operating system.
  • Informally refers to the operating system as well as the standard tools and applications distributed with it.
  • Specifically, Linux refers to the kernel which forms the core of the operating system.
  • The kernel is distributed with indispensable utilities and applications, such as compilers, editors, command interpreters, etc.
  • Most Linux software distributed under the GNU general public license (GPL).

What are Linux Systems Used For?

Linux systems often used for back end services:
  • Web servers, database servers, file servers, mail servers, ftp servers, firewalls, routers, print servers...
Linux is slowly moving onto the desktop:
  • Desktop, office suites, graphics manipulation
Growing commercial interest in Linux-based computing:
  • Reliable, secure IT systems.
  • Cost-effective solutions.
  • Support from traditional Unix companies such as Sun, HP, IBM, Novell.