3
votes
2answers
2k views

How to write a script to execute files in multiple directories

How do I write a script to execute the files in multiple directories? The problem is this: I have many directories, and each has a data file to be read and analyzed by a python script (say, a.py). I ...
1
vote
2answers
2k views

How to configure Kate to always use 2 spaces for tabulation?

By default Kate inserts 2 spaces on Tab press but switches to real tabs starting from the fourth Tab level. Can I disable this and use spaces always, regardless to the depth? I want this because I ...
4
votes
1answer
112 views

What is this construct in bash? mycommand(){dosomething;}

I actually found following one-liner on commandfu.com: cmdfu(){ curl "http://www.commandlinefu.com/commands/matching/$@/$(echo -n $@ | openssl base64)/plaintext"; } I have not come across a similar ...
4
votes
1answer
86 views

When I schedule a command with 'at', can I change where the output is mailed to?

When I schedule a job/command with at to be executed in the future, the standard output and error of the command is "mailed" to the user that did the scheduling. So after my job runs, I get a message ...
28
votes
3answers
8k views

How to pass parameters to an alias?

For bash script, I can use "$@" to access arguments. What's the equivalent when I use an alias?
2
votes
1answer
4k views

What repositories do I need to install heartbeat and haproxy on RHEL?

So I am now managing two RHEL machines that I need to install haproxy and heartbeat on. When I follow instructions to do so I get the following: [admin@p2378442 ~]$ sudo yum -y install heartbeat ...
21
votes
3answers
38k views

How to merge all (text) files in a directory into one?

I've got 14 files all being parts of one text. I'd like to merge them into one. How to do that?
5
votes
1answer
122 views

apt-get - How to complain on failed upgrade?

I'm trying to write a script to upgrade a bunch of remote machines and would like to verify that one package in particular is upgraded. With yum, I could say yum upgrade specific-package, and it ...
11
votes
6answers
9k views

How to stop cursor from blinking

How do I make the cursor stop blinking when in a TTY? (or anywhere else). BONUS Points for one universal setting that stops the cursor blinking almost everywhere.
3
votes
1answer
3k views

Find the disk-space usage of a directory and all it's files [duplicate]

Possible Duplicate: How to know the size of a directory? If I run ls -lh then any given directory is just shown as 4.0K. How can I can make it consider the files the directory refers to ...
2
votes
1answer
5k views

Bacula + bat on Ubuntu Maverick

Okay, so I have a goal, and I'm unsure of the best steps to take to get there. Goal: Set up a Linux VM in VirtualBox (Host: Windows Server 2008 R2) Setup Bacula in a Linux environment Get Bacula to ...
11
votes
3answers
611 views

version control for /etc under *BSD

What turnkey solutions exist to put /etc under version control, under various unices? Turnkey doesn't necessarily mean part of the base install, but the following features would be nice: hooks into ...
23
votes
4answers
27k views

Understanding the exclamation mark (!) in bash

I used history | less to get the lines of previous commands and from the numbers on the left hand side I found the line I wanted repeated (eg. 22) and did !22 at the command prompt and it ...
1
vote
1answer
359 views

Using find to find symlinks that point to a certain pattern of files

I have several directories that all have various symlinks in them. I want find (or another program) to find based on where the symlinks point to. For example this is how it currently works: ...
3
votes
2answers
751 views

Forcing emacs to run with `-nw` when called from terminal

note: This question might have been asked before ( I think I saw it somewhere), but a quick search did not reveal anything. I would like to tell the difference when a command is run from a shell. ...
13
votes
1answer
6k views

Number of files per directory

I have a directory with about 100000 small files (each file is from 1-3 lines, each file is a text file). In size the directory isn't very big (< 2GB). This data lives in a professionally ...
2
votes
1answer
685 views

Why are updates pushed to Fedora's updates-testing repos initially invisible?

I follow various bugs on Red Hat Bugzilla, and I just received a notification from the Fedora Update System that a new package was available for testing that supposedly fixes a bug I was interested ...
5
votes
5answers
8k views

How to do a print screen or capture an area of the screen

Is there an equivalent of the Window's Print Screen + Paste (or better yet the Mac OS Cmd+Shift+4, Space) in gnome?
7
votes
3answers
9k views

/etc/cron.daily/foo : Send email to a particular user instead of root?

I'm running CentOS 5.5. We have several cronjobs stored in /etc/cron.daily/ . We would like the email for some of these cronjobs to go to a particular email address, while the rest of the emails in ...
3
votes
2answers
360 views

Getting the number and names of windows in Xvfb

I am currently working with Xvfb to grab the screenshots of my programs. Is there a way to determine the number and the names of the windows that are currently "displayed" in Xvfb? Where can I find ...
1
vote
2answers
310 views

forwarding DHCP packets

I've got this configuration: WRouter ->(by wifi) Computer1 And I want to add another computer (computer2) connected by cable to computer1. Is it possible then to configure computer1 to forward ...
1
vote
1answer
240 views

No sound from cli apps or from zsnes

Some programs don't have sound, in particular ZSNES and anything I run from the command line. So my question has two parts: How can I diagnose this problem? (I'm thinking of a command like lspci ...
1
vote
1answer
443 views

How to get touchpad functional, again?

I messed something up and can't get my touchpad functional at all on GNOME 2.30 any more. I looked at Mouse Preferences on the Touchpad tab, and can't find the magic switch. The touchpad works on the ...
3
votes
2answers
3k views

How do I see what symlinks exist for a given directory?

I want to do some housekeeping in a directory, and I want to see if a given directory has any symlinks pointing to it. I can easily enough see what directory a symlink points to, but now I want to see ...
2
votes
1answer
1k views

How to uninstall RHEL from a dual-boot system?

I had RHEL 5 and WinXP on dual-boot and then from WinXP I deleted those partitions which were allocated to RHEL. Now I am not able to start my computer. The booting process stops at grub. I tried ...
2
votes
2answers
749 views

How to turn off permanent highlighting of all braces (not just pairs) in vim

I have no idea how I modified vim such that all braces are highlighted, not just matching ones, but I want to turn it off now. How do I do that? The usual highlighting of matching braces works fine.
3
votes
2answers
433 views

I need help with a cronjob to watch for runaway processes and kill them

I have an interesting situation, I have a runaway ruby process - I know exactly how I trigger it. Point is, it got me thinking about runaway processes (CPU usage or memory usage). How would one ...
9
votes
4answers
1k views

GRUB on USB Drive — adding OSes

Some Background: Coming from a largely Windows background (though I'm familiar with Ubuntu, etc.) and using a Windows 7 machine to complete this task Have gotten GRUB installed successfully to the ...
7
votes
2answers
1k views

red-green color blindness compatible vim theme

I am looking for a vim theme accessible to users with red green color blindness. In particular, the red text on a dark terminal background all but disappears. Do any of you know of a good theme? Or ...
5
votes
8answers
5k views

Find out if the OS is running in a virtual environment

Is there any way to find out if the OS I'm running (actually installing) is running in a VMWare machine. I need to disable ntp settings if the automated install is done on a virtual machine but keep ...
9
votes
2answers
826 views

What's the + in find /path/ -exec command '{}' + do?

What's the + in find /path/ -exec command '{}' + do? as opposed to find /path/ -exec command '{}' \;
6
votes
3answers
845 views

Deleting lots of files

I accidentally created 8 million files and every time I'm trying to delete them the server almost dies because of the rm process eating all disk IO (the server is remote without console). Should ...
7
votes
4answers
5k views

How can I get a base64 encoded shaX on the cli?

sha1sum outputs a hex encoded format of the actual sha. I would like to see a base64 encoded variant. possibly some command that outputs the binary version that I can pipe, like so: echo -n "message" ...
5
votes
2answers
3k views

How do I delete all files with a given name in all subdirectories?

I want to delete all files with a given name in all the subdirectories of my home directory. I tried: rm -r file in my home directory, but it didn't work because that file doesn't exist in that ...
2
votes
1answer
646 views

immutable-like flag for perms

Is there any chattr flag that would allow me to lock a file's unix permissons, and not change them without resetting the flag? The file itself should still be modifiable, I just want to prevent ... ...
5
votes
2answers
2k views

What file do I have to edit to make static DNS server in CentOS?

Almost every distro I know will wipe /etc/resolv.conf on reboot (I think DHCP does this) and thus the place to add static DHCP entries varies per distro. How do I add static DNS servers to a CentOS ...
1
vote
1answer
268 views

Recording and charting boot process information in Linux

I need to write a command line tool that records the boot process information in Linux, and then renders it in a chart format (a textual chart would do). How do I programmatically obtain the this boot ...
1
vote
4answers
142 views

Linux compability file system

I need to develop a file system for Linux for my diploma work. Where can I find infomation about this theme? How can I test it and other?
6
votes
1answer
535 views

Emacs and windows manager keyboard shortcuts without “Super” key

I found a classic M-series keyboard and I want to use it. However, it does not have the "Windows" key (a.k.a "Super"), only the Shift, Control and Alt modifiers. My keyboard shortcuts are cluttered ...
4
votes
2answers
546 views

How does file descriptor re-assigment work?

In a way this question is a extension of another question. In bash you can do pretty neat stuff with file descriptors. Like { command > /dev/null } 2>&1 | grep filter; to grep on stderr ...
1
vote
3answers
188 views

back-up database in Linux partition from windows partition!

Hello I am in a very embarrassing situation, I was trying to upgrade to ubuntu 10.04 from ubuntu 9.10 yesterday and while updating I forgot to put my laptop on charger and the battery ran out. Since ...
3
votes
2answers
4k views

making ssh hosts global to all the users on the computer

So SSH has these files that configure settings for a specific user. ~/.ssh/authorized_keys ~/.ssh/config ~/.ssh/id_rsa ~/.ssh/id_rsa.pub ~/.ssh/known_hosts I'd like to globalise some of these ...
5
votes
5answers
518 views

Would it be possible to jump between prev/next command prompts?

I'm using zsh in OS X Terminal.app and for quite a while, I've been longing for a way to jump back and forth between prev/next prompts in the terminal's output. One convenience with this would be to ...
4
votes
2answers
2k views

Why am I getting a syntax error with my Shell arithmetic?

I have a problem with a linux shell script (sh). I'm trying to write a script that calculates combinations, but I think I get overflows when trying to calculate faculties. So, I'm trying another ...
1
vote
0answers
143 views

How can I list only the directories present in a directory using ls? [duplicate]

Possible Duplicate: Is there any option with 'ls' command that I see only the directories? I have a directory with a lot of files but only a few directories. To get a list of only ...
2
votes
0answers
317 views

How can I check which shell I am currently using? [duplicate]

Possible Duplicate: How to test what shell I am using in a terminal? An echo $SHELL will only display the value of the SHELL variable which would indicate the default shell on the system. ...
3
votes
2answers
2k views

What does file version mean: lsattr -v

lsattr -v gives me the "version number" of given file(s). What does this mean? On Redhat 7.3, I could've sworn all the version numbers were 1 except those I changed with chattr -v. On Fedora 11, ...
6
votes
2answers
2k views

Will the system make sure that mdadm is sync-ed before completing a reboot?

This is a follow up to my crazy mdadm problem. I'm trying to figure out what might have caused sda to get out of sync in the first place. The only thing I can think of is that I had just run a bunch ...
3
votes
1answer
3k views

what does the “a” in chattr +ia do?

what does the a in chattr +ia <filename> do? and why would you add the a in combination with the i? note: I know the i is for immutable
8
votes
1answer
2k views

How do I view the IO priority of a process?

How can I view the IO priority of a process? like to see for example if something has been ionice-ed.

15 30 50 per page