Linux: Display / Show File Contents (tabs, line breaks, non-printing characters)

I write before guide, howto create file on Linux shell / command line without text editor (with cat command) and this is guick tip howto display / show file contents (tabs, line-breaks, non-printing characters (ASCII control characters: octal 000 - 037)) and display all on Linux shell / command line. This is very useful when you want to know the entire contents of the file. Example file I use /tmp/testing.txt example file on this guide. File is created simply with following...

Linux: Create Text File on Linux Shell / Command Line

This is a very typical case, the need to create a temp file on the command line quickly. Opening editor, writing content, save file and quit editor is not the fastest possible way. A faster way is to use the cat command with the name of the file and write contents of the file and give the end-of-file character (Ctrl-D). This is guide, howto create (or append to) text file without text editor on Linux shell / command line. Create Text File Without Text Editor on Command Line #...

Microsoft Word doc documents handling on Linux command line with Antiword

Sometimes it is convenient and necessary to deal with Microsoft Word doc documents directly on Linux command line. MS Word documents handling directly from the Linux command line is possible with Antiword program. Anti-Word is a small, easy to use and lightweight command line program that can convert Microsoft Word documents to PDF, PostScript, and XML. For example, the following situations Antiword is a very useful tool: MS Word document can be read from a remote server easily and...

Linux Tip: How to handle a files with a dash as first character from command line

Sometimes you maybe have to handle files with a dash (-) as first character from Linux command line. It can be difficult, because the script "thinks" the marks after the dash are parameters. So files which name begins with dash (-) can not be dealt with directly by typing the command and the file name, such as the following: less -file-with-a-dash-as-first-character Files which name begins with dash (-) can be used as follows: less ./-file-with-a-dash-as-first-character Real...

Google search from Linux and UNIX command line

Today I started thinking that how cool is do some Google searches straight from command line. First I try to find some ready tricks from the Internet, but I couldn't find quickly anything good. So I decide do a simple Bash function that can take Google search as parameter and open Firefox Browser (tab) with Google search. Sounds easy... :) (more…)

Delete files securely on Linux – Journaled file systems

Few days ago I write about shred, which work fine for old systems, like EXT2, but not so nice with journaled file systems. Modern file systems need something more robust, like dd and srm (a secure replacement for rm). Unlike the standard rm, srm overwrites and rename the files before unlinking them. This makes it very hard to recovery of the data. Create test file: echo "secure content" > /tmp/secure.txt (more…)

Add Hostname, Date, Time, Uptime, Load Average to Linux Terminal Title

This tip is really useful if you need/want to monitor multiple servers at the same time. This Tip works, as the tip, by which you can add the date and time the title of the Linux terminal, but it adds more usefull info to terminal title. Following bash one liner add hostname, date, time, uptime, users and load Average to Linux Terminal Title and updates it every second. This trick works at least following terminals: Gnome Terminal, xterm, urxvt, rxvt. Add hostname, date, time, uptime,...

YUM History (list, info, summary, repeat, redo, undo, new)

Yum (Yellowdog Update Modified) is RPM Packet Management system for Fedora, CentOS, Red Hat, OpenSuse etc. Yum history (list, info, summary, repeat, redo, undo, new) commands is added on 3.2.25 version. So this works every Linux Distros, which uses yum 3.2.25 or newer. Yum history command is a really useful in situations where the need to example rollback latest yum activity or undelete some deletes or just see what is updated lately. Yum history and Yum history list yum history lists...

Linux: Enable Laptop Touchpad Vertical Scrolling and Tapping from Command Line

I noticed that the Fedora Linux with KDE desktop, has reasonably poor support for laptop touchpad adjustment. For example, the KDE > System Settings > Keyboard & Mouse > Mouse options will not be able to enable vertical scrolling and touchpad tapping. So I decided to write this short guide, howto enable Touchpad vertical scrolling and tapping from command line without any GUI. Enable Laptop Touchpad Vertical Scrolling (more…)

Howto Install KDE 4.4 or Update to KDE 4.4 on Fedora 12 Linux

Updated 26.2.2010, Read First Currently, the latest version of the KDE desktop in Fedora is 4.3.5. I had some problems with its stability, so I decided to try out, how will work KDE 4.4.0 the latest stable version of KDE. At first I tried to install KDE 4.4 from Rawhide repository, but it failed to install from there. Here is instructions on how to install KDE 4.4 successfully using RPMFusion and KDE Packaging Project Repositories. It may be that RPMFusion repository is redundant, but KDE...

List tar/tar.gz/tar.bz2 Contents – List all files in archive.tar

This is quick tip, howto list contents of tar, tar.gz and tar.bz2 files without unpacking file. This is very useful on server environment where any graphical tool is not available. This method is also very useful when tar, tar.gz or tar.bz2 packages are really big, something like hundreds of megabytes or gigabytes (for example backups). Overall, the key is the tar command with -t option. List the Contents of tar File List tar contents short command tar -tvf archive.tar List...

PHP Script to Generate PostgreSQL Table Partitioning (Part 2)

As Part 1 (Howto create PostgreSQL table partitioning) shows, making of PostgreSQL partitioning needs a lot of SQL commands. So this Part 2 explains how SQL commands for PostgreSQL partitioning can be made with a simple PHP script. This example script make SQL for child tables, indexes, trigger function and parent table trigger. This example script can make PostgreSQL table partitioning with using Date ranges. Script can be configured with following configuration section: Initial...

Delete files permanently with shred command in Linux – Remove absolutely

Sometimes need to delete files whose contents should disappear absolutely, completely and safely. Linux command rm just remove file and it is still possible to dig out from the disk. Fortunately for Linux can be found in shred program that removes the files permanently. Shred command is easy and quickly to use cases when files need to deleted forever. Shred command usage Create test file: echo "testing testing" > /tmp/test.txt Delete file with shred command: shred -v -n 25 -u...
1 2
Close