Linux Archives
6 Tricks with AWK
Quickzi: Replace all spaces with a dot in vim
Here’s a quick tip on how to replace all spaces with a dot in vim:
:%s/[ \t]/./
And here’s how to remove all trailing spaces at the end of each line:
:%s/\s\+$//
Have any more vim quick tips? Let’s hear them in the comments.
Popularity: 1% [?]
Quickzi: Find files older than 5 days
Here’s a quick command line tip to find files older than 5 days, and execute an action on those files:
find /home/foo/* -mtime +5 -exec echo {} > oldfiles.txt \;
&& mail -s "files older than 5 days" foo@foogazi.com < oldfiles.txt
This command searches for files that are older than 5 days, and sends the output to oldfiles.txt, then an email is sent to foo@foogazi.com with a list of the old files.
Alternatively, you could search for files older than 5 days, then delete them using this command:
find /home/foo/* -mtime +5 -exec rm {} \;
Popularity: 1% [?]
Linux How To Reset Gnome Settings in Ubuntu
Have you ever messed around with your Ubuntu Gnome settings only to find out you broke something? Here is a quick write up on how to reset your gnome settings in Ubuntu.
In short, you basically need to delete these from your home directory: ~/.gnome ~/.gnome2 ~/.gconf ~/.gconfd ~/.metacity
Popularity: 2% [?]
How to boot into a specific Linux runlevel by default
If you don’t already know, a runlevel is what Linux uses as a mode of operation. A ‘runlevel’ defines the state of the operating system after power on.
Typically, Linux runlevels look like the following:
- 0 – Halt (shutdown)
- 1 – Single-User mode
- 2-5 – Full multi-user mode with console logins and display manager if it’s installed
- 6 – Reboot
On most Linux servers, the default runlevel will be set to runlevel 3. Multi-user mode and console logins only. Whereas, most Linux desktops, the default runlevel will be set to runlevel 5.
If you want to boot into a specific runlevel every time your computer turns on, all you need to do is edit the /etc/inittab. For this example, we will change the runlevel from 3 to 5.
# vi /etc/inittab
Modify the line that looks like this:
id:3:initdefault:
And change the number 3, to 5.
id:5:initdefault:
Save the file. Next time you reboot Linux will boot directly into your desktop window manager.
Popularity: 2% [?]
Awesome Linux Wallpaper Designs
Free Linux Backup Software: Lucky Backup
Jack Wallen has a great Linux how-to on using the Linux backup software, Lucky Backup, to backup and store your data.
I’ve used Lucky Backup in the past and can attest that it is very easy to use, and has all the features you need for a good backup system.
Some of the features include:
- Snapshot backups
- Sync directories
- Exclude directories/files
- Profiles
- Scheduling
- Logging
- Command line mode
Head over and read Jack’s how to. He does a great job showing just how easy it is to use.
Popularity: 2% [?]
Command line tool for the Google services
Today Google announced GoogleCL which is a tool designed to bring some of the Google services to the command line.
For most people using Ubuntu Karmic (9.10) or newer, installation should be very simple:
- sudo apt-get install python-gdata
- [download .deb package]
- sudo dpkg -i googlecl*.deb
Here are some example scripts:
- google calendar add "Dinner party with George today at 6pm" # add event to calendar
- google calendar today # List events for today only.
- google calendar list --date 2010-06-01,2010-06-30 # List events.
- google calendar delete --title "Dinner party with George" # Delete an event.
- google contacts add "J. Random Hacker, jrandom@example.com"
- google contacts list name,email --title "J. Random Hacker"
- google contacts delete --title "J. Random Hacker"
The possibilities of GoogleCL are definitely going to expand, and I can already think of some useful ways to incorporate these into some scripts of mine.
Popularity: 2% [?]
Dell says Ubuntu is safer than Windows – Then retracts the statement
Yesterday, as first reported by The VAR Guy, if you would have went to Dell.com/Ubuntu, you would have seen a “top 10″ list of “things you should know about Ubuntu.” The best one on the list at the time was number 6, which stated:
6) Ubuntu is safer than Microsoft Windows The vast majority of viruses and spyware written by hackers are not designed to target and attack Linux.
Today, if you visit the same Dell.com/Ubuntu, you’ll see the following change:
6) Ubuntu is secure According to industry reports, Ubuntu is unaffected by the vast majority of viruses and spyware.
Pretty comical huh? Many of us in the Linux industry are claiming that this is probably an evil doing of Microsoft pressuring Dell to ‘correct’ the statement. Which, really, would not surprise me the least bit.
I suppose I understand why Dell changed their tune, but in actuality, the first statement was nothing but a simple true fact.
What do you guys think? Should Dell have kept their ground?
Popularity: 2% [?]












