General :: How Would Syntax Of Reverse Find Be
Jun 9, 2010how would the syntax of reverse find be..i want to type a name and then find it and delete it from a file i have?
View 2 Replieshow would the syntax of reverse find be..i want to type a name and then find it and delete it from a file i have?
View 2 RepliesI have a project directory that contains source code and subdirectories of source code. I want to use the Unix program find to search recursively for the names of files of certain extensions. The versions of find on Linux and Mac OS X behave differently.
# Works in Linux
find . -type f -regex ".*.(py|html)$"
# Neither of these works in Mac OS X
find . -type f -regex ".*.(py|html)$"
find . -type f -regex ".*.(py|html)$"
How do I write this command so that it will run on Mac OS X (and hopefully on Linux too)?
exec, a option of find command, takes a odd format as followsfind ... -exec command {} ;Is there any explaination about why it takes this kind of format, orsome obscure implication?
View 3 Replies View RelatedWhen ever i open vim, i get the error that the following error: E484: Can't open file/abcd/configFiles/vim/syntax/syntax.vim There was a .vimrc file in my home folder that i have removed.
Still i keep getting the same error. Presently in my home folder there is no .gvimrc or .vimrc file.
But still i keep getting the same error. I am not too sure where this file is mentioned.
Background info: The SHELL has been changed from tcsh to bash Earlier i had created a .vimrc file in tcsh, i have removed the .vimrc in bash SHELL.
I am a Novell (now defunct) CNE tring to learn Linux and am having a lot of trouble finding out where the WB 6-6 is wrong in the syntax for adding local4... the the syslog-ng config file. In the instructions there are discrepancies between commas and simi-comma, they are both in the statements in no particular order. there is no pattern to them. Here is what the book shows:
filter f_local4debug { level(debug) and facility(local4); };
When I try to input this in the Gnome terminal window to try and find out where it goes wrong I get the following: -bash: syntax error near unexpected token "(" If I can get the correct syntax I belive I can use the info to get past the rest of this portion of the lesson. I am desperate to learn Linux as the only jobs out there for a Novell CNE are migrations to MS, which really sucks, since MS really really sucks.
I'm trying to find all the files in a specified directory that do NOT end in .archived or .error and are older than 30 mins. Currently I have: Code: find /opt/edi/incoming -type f ! ( -name "*.archived" -name "*.error" ) -cmin 30 But I keep returning files that end in those extensions and I'm not sure if I'm using -cmin correcty? If there is a better way to do this (perl, etc) I'm open to options, this is for a nagios check.
View 2 Replies View RelatedI am using RHEL5. These are my config files:
Code:
options {
listen-on port 53 { 127.0.0.1; 192.168.14.54; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
[code]....
The touch screen works but when I touch the top it goes to the bottom. Touch left it goes right. How can I reverse the action?
View 3 Replies View RelatedWrite a program in any language you choose, to reverse a file.
View 8 Replies View RelatedI have a file consisting of unique IP addresses - one per line I want to find the name of the host for each address. I tried the following:
Quote:
nslookup < file_name
This worked except it gives me a lot of extraneous information such as the servers providing the answers. This is too much information for me and would simply like each line of IP numbers to be replaced with a domain name. I tried using the same strategy using host and hostname and dig but I must have given the wrong command as I had no results.
I have a html page and I would like to search for the occurance of a given string as an anchor. Then I would like to search backward for a the first match to a given regular expression. As a result I would like to output the text between the two points.
Please note that I would like to have the output up to the first regex match before the ANCHOR point.What is the best tool to solve this?
So unfortunately I live in a place that will not let me have a static IP, so I have been setting up access to my home computer via reverse SSH tunnels that run on an micro amazon ec2 instance. I have gotten SSH to work fine, but I cannot figure out port forwards.Here is a small infographic I made to help illustrate (i felt the question was clearer with a diagram of what I was trying to do. Here are the commands listed in the graphic:I the following on my home computer: ssh -R 1337:localhost:22 -i .ssh/tokyoMinekey.pem ec2-user@ec2serveraddressand I run this on the ec2 server: ssh -L6600:localhost:6600 -Nf localhost -p 1337
View 2 Replies View RelatedI have a question regarding the possibility of streaming video using an Apache web server configured as a reverse proxy. Suppose I have a local web server and areverse proxy that is abroad. I want users that are nearer the reverse proxy to be served by it and not my local web server. I know in general how to configure this and there is a lot of documentation. But can it be configured to support video file streaming without saving all the media content in the reverse proxy disk?
View 6 Replies View RelatedThe full screen console is brought up by ctrl+alt+F1. How do you get back to the windows display manager? Is it necessary to reboot?I am running Ubuntu 9.10 with Gnome.
View 3 Replies View RelatedI'm trying to sanitize this output from it's metadata to plug this output into GreekTools, but I am getting stuck on sed.
View 2 Replies View RelatedI have a requirement to check the following conditions..If my folders are not A and B then list files in the directory else no listing the filesso my if loop is some thing like this.
Code:
if [ $dirName = "C" && $dirName != "A" && != "B" ] then
ls -la
[code]....
I have a couple of files which follow this syntax:
*_yyyy-mm-dd_hhhmmm.*
Example:
*_2010-01-01_00h10m.*
*_2010-01-01_01h10m.*
*_2010-01-01_02h10m.*
[Code].....
and delete the others. or maybe move them to a subdirectory to be safe...
For some commands the command synopsis (syntax) is given like this:
command [a|b] [args ...]
I take mplayer (perhaps not GNU) to illustrate the point:
mplayer [cdda|cddb]://track[-endtrack][:speed][/device] [options]
mplayer [dvd|dvdnav]://[title|[start_title]-end_title] [options]
An item inside square brackets is optional. The pipe sign is the 'or' logical connective (disjunction). But then, what is [cdda|cddb]?
If optional, I can omit it: it makes no sense because there are more the one possible synopsis for the command line.
What is wrong with the following ldif file :
Code:
dn: dc=mydomain
objectclass: dcObject
objectclass: organization
o: My Ldap
dc: mydomain
dn: cn=Manager,dc=mydomain
objectclass: organizationalRole
cn: Manager
Because I get following output :
Code:
[root@1 ~]# /usr/bin/ldapadd -x -D "cn=Manager,dc=mydomain" -W -f /etc/openldap/basic.ldif
Enter LDAP Password:
adding new entry "dc=mydomain"
ldapadd: Invalid syntax (21)
additional info: objectclass: value #0 invalid per syntax
I'm working on reorganizing my .bashrc. I moved my aliases to .bash_aliases (which is sourced by .bashrc, but I can't figure out how to enable syntax highlighting for this file. vim seems unable to figure out what language the file is in. It works fine for .bashrc.
View 2 Replies View RelatedMental note: ignore start-up process scroll.
Okay, now MySQL is just being (even more) difficult. Prior to boot's starting MySQL, I notice the line
Code:
/etc/rc2.d/S19mysql: line 132: syntax error near unexpected token ')'
Near?? Line 132 consists of
Code:
'stop')
Which is proper, and identical to all the other /etc/rc#.d/S19mysql scripts that don't result in errors. C'mon...!
find /opt/postfix/mail/email.com/~spam/~quarantine/ ( -iname * -o -iname .* ) ! -type p -exec grep -i -c admin@email.com {}; -xdev -print
When I do this command I receive this error message:
-bash: syntax error near unexpected token `('
I wrote a script to start portal.
Its start portal (not a problem)
Only getting following message:
This is the else before second logic
I understand how to get a file from an another computer using the sftp syntax
So i can get the file abc from comp2 to comp1
But how can I send a file cba from comp1 to comp2 using the sftp(I am still using comp1)
Recently I edited sudoers file and did typing error. Now neither I can do sudo nor change it.
Code:
sudo visudo -c
>>> sudoers file: syntax error, line 8 <<<
How I can get correct the sudoers file?
I'm trying to install the Sun Java plugin to use in Chrome. The installation seems to have gone well, but I have hit an error trying to create a symbolic link of the libnpjp2.so library in the plugins directory of Chrome.
When typing in "in -s /opt/java/jre1.6.0_26/lib/i386/libnpjp2.so" I get "Syntax error near unexpected token `in' ". I'm not sure what could be wrong, I'm in the right directory.
The following line is in the /etc/bashrc file. It's fedora 8. I know this is meant to configure the prompt but I don't know what the syntax is specifically doing.PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}07"'I think that 33 is the ASCII character for ESC but not sure what ]0 does or anything after the HOSTNAME variable. Are these xterm control characters? All of my Google search results fail to explain it in any kind of meaningful detail.
View 3 Replies View RelatedI am writing a simple shell script where it checks the condition using if condition.
Code:
if [ $name == "JOHN" ] then admin='YES'; fi
if I use like this I am getting below error
[code]....
I'm scratching my head over a very simple netcat-based heartbeat monitoring script i wrote.
here we go:
Code:
echo `date --utc "+%Y-%m-%d %H:%M:%SZ"` script started
[code]...
On this Red Hat Box that I am using there is no .vimrc file for the user root. So, I created one and entered only one line to highlight syntax with colors when I am writing scripts in PHP and Bash. But it is not working.
Code:
[root@localhost ~]# cat ~/.vimrc
syntax on
[code]....