ulimit -a tells me I have a limit of 1024 open files, which is the default on my distro. Is there a way to show how many of these are currently used, or how many are remaining?
I'm trying to get the end result to have the same format as this as well:
1 bin 2 daemon 67 erozner
[code]....
Where the numbers are the number of processes being run by the user (the name right next to it).if I input the command egrep myFile into the terminal, it should look for every line with the letter x in myFile, right?
I tried to come up with a thread title that was specific without being too long or cryptic. Don't think I succeeded. In my PHP error log I keep getting this error over and over again:
Code:
EntityRef: expecting ';' at line 565, column 81
It's very odd to me that it doesn't contain any sort of stack trace or file info. I know which of my virtual hosts and therefore which directory it's coming from, and it's happened now on half a dozen different servers that this site has lived on. So obviously I'm trying to track it down and add the missing ';' to the right file. This directory has dozens of sub-directories and hundreds of files though.
This is the best I've managed to come up with so far:
Code:
find . -type f -iname "*.php" -print -exec awk 'NR==565' {} ; (I've run it both with and without the -iname filter.)
I get a very large list of files, and some of them display the contents of line 565 after them. I've checked through a number of them there, but haven't found the culprit. Is it possible to limit my "find" command to only files that have at least 565 lines? Is it possible to have it only print matches from line 565 that has at least 81 columns? How would I modify that to print perhaps 5 lines on either side (in case the error reporting is pulling a slightly different line.)
time() API gives the number of seconds since 1970 Jan 1st 00:00:00 without considering leap seconds. How to get the number of leap seconds which needs to be considered in the value returned by time()..(gmtime will convert time_t to struct tm* and considers leap seconds. I am trying to write an API which will do the same function as gmtime)
I don't know how to explain this but the free space indicator in folders shows a different number than in Gparted. The Picture pretty much shows it all.
On windows I really only used Notepad++ as my text editor, it had two features that I loved.What I need to accomplish is what I would do with Notepad++ column editor.I could have like 100 lines, and place the cursor at a column, and goto edit>column editor, and I could insert an incrementing number. (I could also pad the incrementing number with 0s, this was GREAT for making batch files among other things.)So each line at that column had a number higher than the previous line.The other feature that I used sometimes was a search/replace with regex patterns.Does anyone know of an editor that has those features for linux? I am mostly after the column editor insert feature but if you know of one with both features that would rock.
Trying to install on a: Dell Precision T3500 OpenSuse 11.3 keeps showing the following message:
"Make sure CD number 1 is in your drive"
I ordered the DVD from the OpenSuse site, so they ARE NOT burned copies. I also tried burning images, the same problem happens. No matter what I do, it does not go beyond this message.
Each time I start my Ubuntu 10.10, I notice this messages in dmesg:
[Code]...
Each time the inode number is different. I made SMART tests on the disk, and all went fine. Do I have to worry? Could it be something related to a wrong shutdown? Update: I have just ran an fsck at boot, but when I logged in, the same orphan_cleanup was in dmesg.
I have been having a lot of trouble lately with installing from CD/DVD. The DVD reader/writer on this laptop is new. Nevertheless, trying to install Ubuntu onto an exernal HD, I get 'input output error on sr0 logical block (a large number) After a long time the booting proceeds to a point, but I never get the actual installation started, and have to shut down manually.
The CD is fine, says the Ubuntu-checker. I just installed using my sons laptop, and there was no trouble. Question: does this indicate a motherboard failure? A memory block damaged? Do you know of a diagnostic tool I can use to check the reading of a CD/DVD?
I need to get the max number from the name of a file
Formant of the file name: [a-zA-Z]*_[0-9][0-9]_[A-Z][A-Z].log Delimiter as underscore '_'
[code]....
known part in the above file name will be GA.log A give directory may or may not contain files in the above format or may contain file other then the above format if so then ignore it.
cmd=> ls *[0-9][0-9]_GA.log 2> /dev/null | awk -F_ '{ print $2}' | sort -nr | head -n1 | awk 'BEGIN { if ($1 >0 ) x=0; else x=1 } END {printf "%02.0f ", $1+1}'
output=> 01
if there are no files the output should be 01 and if file(s) found the output should be next highest number+1, In the above example it is 06 My cmd is bit lenghty. reduce my cmd and it should be in one line.
I have just created a usb boot disk so that I can install Fedora 14.I used the following which was successfully. However, I am left wondering what does the bs parameter actually does. I know it mean bytes and copies these at a time. But how do I know what to set it to?dd if=F14-Live-i686.iso of=/dev/sdb bs=8MIn the above example it is set to 8MB. However could I set this to any value that I want?
I asked this question yesterday with Linux, but I realized I need to get it working in both Linux and OS X. Link to earlier question: Get folder with largest number at the end of the name in Linux. I have some folders r1, r2, r3, etc. and I want to get the name of the folder with the largest number at the end. How do I get the name? The ls -v solution looks promising, but I want to exclude all folders that don't follow the pattern r[0-9]*
I was wondering what is the maximum number of partition on an GPT-partitionned drive under Linux. The GPT partition table can contain up to 128 partitions, but the device nodes for /dev/sda? (as described here, block device of major number 8) only allow /dev/sda1 up to /dev/sda15. Does that means that there cannot be more that 15 partitions on a drive, even on a GPT-partitionned drive?
I'm currently trying to design a small, simple enough shell program for area codes. I have a list of area codes in a database, and I am trying to write a program that will have a user input an area code, and then have the program print out information that immediately follows that area code in my database. I assume I need to use a find or locate command, but I'm not sure if I should be searching for a string or the number itself. The number could possibly occur at some other point in the file, though the way I have the file set up it only occurs once at the newline.
what function I should use and how I should go about it? As is I only have the absolute bare-bones beginning of having an echo for the prompt to input an area-code, and the read once it's input. Without the find I'm not sure how much farther I can get. Also, would it make it easier if I added some character such as a ! to the end of the number at the newline to make it easier to search for? With a macro that would be easy enough to do.
im using CentOS 5.2 and cant change my default ssh port number. I have edited /etc/ssh/sshd_config to this
Code:
#$OpenBSD: ssh_config,v 1.21 2005/12/06 22:38:27 reyk Exp $ # This is the ssh client system-wide configuration file. See # ssh_config(5) for more information. This file provides defaults for # users, and the values can be changed in per-user configuration files
[code]....
I have then restarted ssh by typing (as root) "sbin/service sshd restart" and it restarts fine but still is on 22 and not 222.
I created a group, and after adding the users into this group, they have a /home/worksharing that is shared
Code:
addgroup teamnight --gid 2578
So that everyone of the teamnight can read/write data of the /home/worksharing , how can this folder be forced, so that all from it e.g. subdirectories, directories, files,... will take the GID group number 2578 of teamnight?
I want to generate random name for email file name to prevent overwriting but $RANDOM ENV VARs does not work in it what can I do? this is my procmailrc:
Quote:
SHELL=/bin/bash SUBJECT=`formail -xSubject:` FROM=`formail -xFrom:` SUBJECT=`echo $SUBJECT | sed -e 's/ /-/g'` FROM=`echo $FROM | sed -e 's/.*<//g' | sed -e 's/>//g' | sed -e 's/@/AT/g'` STOREFILE=20`date +%y-%m-%d_%H-%M-%S`_${FROM}_${SUBJECT}_${RANDOM}${RAMDOM}
it works fine except ${RANDOM}${RAMDOM} and I do not want to use mktemp command .
Not only that but I need tons and tons of them generated, and I need it to be totally random each time.
Code: matthew@mvm:/h/misc> cat a #!/bin/bash for i in {1..5}; do echo $RANDOM
[Code]....
There you can see that it is the same number. It does that every time!! Grrr. The strange thing is each time I manually type [or copy & paste] it into the terminal, it gives random [not static, like I am getting from my script] results.
The reason I want this is because I am making a script where this line will randomly go up or down [depending on if the random number is 1 or 0].
I just found in kernel-2.6.35.3, in file arch/x86/kernel/irq.c:
unsigned int __irq_entry do_IRQ(struct pt_regs *regs) { struct pt_regs *old_regs = set_irq_regs(regs); /* high bit used in ret_from_ code */ unsigned vector = ~regs->orig_ax;
[Code]...
Does any body know the relationship between the vector number and irq number?
How do I find a string in files in a directory. And these file names begin with letter a. I also want to get the number of occurrences of this string from the grep I run. I tried this: cat * | grep -c string but it searches all files. I just want to search files that begin with letter a
I really need to know this for a linux server, but since it also applies to client OSes, I figured the question should be posed here instead of server fault.