General :: Can Grep Exclude Symlinks?

Oct 15, 2010

I tried to run one grep that excludes symlinks and pipe it into a second that searches for my pattern but I continue to get the recursive directory loop error. As a result (I think) my grep is incomplete as the search just loops between directories symlinked together.

View 7 Replies


ADVERTISEMENT

Programming :: Variable String File Base - Output File Doest Not Exclude The Values In Grep -av

May 1, 2011

My script.

This is may script:

Code:

Problem: Output file doest not exclude the values in grep -av

View 3 Replies View Related

General :: Use Exclude Option In"rm" Command To Exclude Some Files/folders?

Feb 3, 2010

i have created on folder in my server to upload some regular states. I want that user can modify or upload already stored files. but, should not upload any unwanted files orfolders.for that i want to use "rm" command as auto scheduler (putting this in cron tab.so that all files will be removed except some required files / folders for which this upload facility is activated. users are using secure-shell for uploading data.

View 1 Replies View Related

General :: No Symlinks Allowed In Smb Share?

Feb 8, 2010

I have the following share setup on my Ubuntu machine

# From /etc/fstab
//192.168.1.13/media /home/USER/SHARE/media cifs username=USERNAME,password=PASSWORD,_netdev,uid=USER,gid=users 0 0

[code]....

View 1 Replies View Related

General :: File Permissions Apply To Symlinks?

Jun 27, 2011

Let's say you have this structure:

+ directory
-- file1
-- file2
-- file3 -> /tmp/file3

file3 is a link to another file3 somewhere else on the system.

Now let's say I chmod 777 the directory and all contents inside it. Does my file3 in /tmp receive those permissions? Also, let's say we have the same situation but reversed.

/tmp/file3 -> /directory/file3

If I apply the permissions on the file being linked to, how does that effect the link?

View 2 Replies View Related

General :: Linux And Windows Symlinks Interchangeability

Apr 10, 2010

This question is about windows 7. I want the "C:program Files" folder to be a symlink to a directory on another partition. I can't do this from within windows because it locked the Program Files Folder. Will a linux live CD do the trick?

View 1 Replies View Related

General :: Resolving Symlinks Mounted Via Samba On Windows?

Feb 11, 2010

I have a samba mount in Windows, mounted from a local Linux devbox. The projects on this mount contain a lot of symlinked directories. They all work fine and look like normal directories to Windows. What I'd like to do is figure out for a given file what its real UNIX path is.The context is: in my editor I have a script that runs the Perforce open command, to which I pass the file location.p4.exe edit FILE_LOCATION

However, perforce will not understand this FILE_LOCATION, if on the Linux side part of the path is a symlink. It needs to know the real path.What I need is something along the lines of the Linux readlink command, which resolves symlinks in paths.

View 1 Replies View Related

General :: Moving Symlinks Into A Folder Based On Id3 Tags?

Apr 3, 2010

I'm trying to get my music folder into something sensible. Right now, I have all my music stored in /home/foo so I have all of the albums soft linked to ~/music. I want the structure to be ~/music/<artist>/<album> I've got all of the symlinks into ~/music right now so I just need to get the symlinks into the proper structure. I'm trying to do this by delving into the symlinked album, getting the artist name with id3info. I can do this, but I can't seem to get it to work correctly.

for i in $( find -L $i -name "*.mp3" -printf "%h
")
do
echo "$i" #testing purposes

[code]....

I'm trying to mv The Trance Mix 3 Wanderlust - DJ Exortius [TRANCE DEEP VOCAL TECH]@ into the real directory DJ Exortius. DJ Exortius already exists, so it's just a matter of moving it into the correct directory that's based on the id3 tag of the mp3 inside.

PS: I've tried easytag, but when I restructure the album, it moves it from /home/foo which is not what I want.

View 2 Replies View Related

General :: Copy Symlinks To Target As Normal Folders?

Nov 30, 2010

i have a folder with symlinks:

marek@marek$ ls -al /usr/share/solr/
razem 36
drwxr-xr-x 5 root root 4096 2010-11-30 08:25 .

[code]....

i want to copy it to ~/solrTest but i want to copy files from symlink as well when i try to cp -r /usr/share/solr/ ~/solrTest i will have symlink here:

marek@marek$ ls -al ~/solrTest
razem 36
drwxr-xr-x 5 root root 4096 2010-11-30 08:25 .
drwxr-xr-x 358 root root 12288 2010-11-26 12:25 ..

[code]....

View 4 Replies View Related

General :: How To Exclude Last Several Characters?

Aug 17, 2010

any tips from you guys on how to filter my awk output?I want to exclude last 5 characters using awk in my tcpdump result.I don't want to include ".443:" in my tcpdump using awk.

View 6 Replies View Related

General :: How To Exclude Sub Directories From ZIP CLI

Jul 22, 2010

I'm trying to create backup/archive my Ubuntu 10.04 system files (so I can restore it in case my system get corrupted). More specifically, I'm trying to zip the important files in my root directory not including my home directory (which includes my documents which I backup separately/more frequently) to an external hard drive attached via USB (called 'My Book').Since File Roller didn't give me quite the level of control I was looking for, I created a script that I could execute to backup and archive regularly.

View 1 Replies View Related

General :: Exclude NFS In Find

Jan 20, 2010

I want to search files excluding the NFS find / -mount -name 'filename' restricts the search only in the root disc partition,but the file can be in other partitions also.Is there any way to exclude the NFS only...

View 7 Replies View Related

General :: Rsync - Exclude-from Qns ?

Jan 8, 2011

I'm trying to do a sync of the root home directory to a folder call backup and excluding some files.

This is wat i executed:

rsync -a /root/ --exclude-from '/root/rules.txt' /root/backup/

My rules.txt is as below:

- anaconda-ks.cfg

Somehow it doesnt read the rules.txt and it will always include the anaconda-ks.cfg file.

View 3 Replies View Related

General :: Gnome-terminal: Preserve Symlinks Of Working Directory When Opening New Tab?

Aug 31, 2010

If I'm using gnome-terminal in a working directory whose path includes symlinks and I open a new tab, the symlinks will be expanded to their destinations in the working directory of the new tab.

Is there any way to preserve the symlinks when opening a new tab?

View 1 Replies View Related

General :: Exclude Does Not Work With Tar Command

Jul 6, 2011

I don't know why --exclude doesn't work when I use tar command. Please see this code
Code:
mahmood@pc:~$ l a/
1.txt 2.txt 3.txt b/
mahmood@pc:~$ tar cvjf compressed.tar.bz2 --exclude=/home/mahmood/a/b/ a/
a/
a/2.txt
a/1.txt
a/3.txt
a/b/
mahmood@pc:~$
As you can see although I excluded b/ but tar command ignored that.

View 2 Replies View Related

General :: Exclude Dir From Find Command

Feb 5, 2011

i have this find command to find modified files and copy them.Code:find $SRC_DIR -type f -ctime -1|xargs -i cp --parents {} $BACKUP_DIR/$DAY/and it works good but it want to exclude files that exist in some folders like $SRC_DIR/cash and $SRC_DIR/woks/tmp

View 3 Replies View Related

General :: How To Exclude Multiple Directories

May 10, 2011

I am trying to exclude multiple directories when using tar. I can do it for just one directory with exclude= directory.I can also do it for multiple directories by typing that code again and again.As you can see im trying to call this variable that has endless amounts of directories in it seperated by a space.. but when run it doesnt work! It will however work if i just put one directory in the variable. Any ideas?

View 2 Replies View Related

General :: Tar File With Exclude A Directory?

Mar 2, 2010

[ --exclude FILE ] [ -X, --exclude-from FILEI tar to tar some directory and exclude a directory , I tried tar -cvf /tmp/test.gz ./* --exclude ./temp but not work , and the parameter --exclude seems exclude file only not directory , can advise what can i do

View 1 Replies View Related

General :: Include And Exclude In Rsync

May 26, 2011

I'm trying to copy files from my local directory to a remote site using rsync.I want to include in the copy all the java files and exclude all the .svn directories, but I can't do it.

View 4 Replies View Related

General :: Using Find To Exclude Some Files

Dec 7, 2010

I'm trying to find all java files in bash that contains the method "assign()".I would like to retrieve the same list except without the Test* files. How can I do that?

View 3 Replies View Related

General :: Exclude Rsync Excludes From Delete?

Jul 9, 2010

im using rsync to sync files across multiple machines.

using the following:

rsync -az -e "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
--delete --delete-excluded --force --exclude=.git --exclude=.bundle
--exclude=tmp --exclude=log/* --exclude=*.log --exclude=*.pid
user@host:/path/to/src/ /var/build/dest

I want to exclude all log files from being transferred from the src to dest and delete all existing ones on the destination so im using --exclude=*.log with --delete-excluded which works great ...

but i want to keep a certain log file intact on the destination. I want a --exclude-from-delete option

Is this possible with rsync?

View 1 Replies View Related

General :: Restore A Tar File And Exclude A Directory?

Jan 25, 2010

I am trying to restore a tar file that contains a directory I cannot nor want to restore. How can I explicitly state the name of the directory? command I am using:tar -xzvPXf <tar file name>.tgz exclude-file=<directory>I have tried it with the exclude-file before the tar file name and same results. No restore.

View 3 Replies View Related

General :: How To Exclude Multiple Directories In Awk With Find?

May 20, 2010

I found a script on webmaster world that mostly does what I need it to, but have been making modifications to tailor it to my specific needs.I know that //..*/ tells awk to ignore hidden directories, how do I define more directories to ignore? (i.e. temp, var, etc)? I've tried playing with prune before the awk command with limited success...I know that there are many ways to do the same thing and keep running into brick walls.

View 11 Replies View Related

General :: Format A Harddisk Into JFS And Exclude All Bad Clusters That Are Defect?

Jun 3, 2010

I have tried mkfs.jfs but well not working.... The hardisk is bit getting old ...

I have tried gparted but it doesnt do that.

View 4 Replies View Related

Programming :: Input File - Grep Within Grep

Nov 22, 2010

I need to kind of grep within grep. My input file would be something like:

[Code]....

and I need to find the first occurrence of hello before MY PATTERN (hello 9008 in this case), so the output should be:

[Code]....

View 4 Replies View Related

General :: Midnight Commander - Exclude Some Directories / Patterns When Doing Search

Apr 7, 2011

In Midnight Commander, is it possible to exclude some directories/patterns/... when doing search? (M-?) I'm specifically interested in skipping the .hg subdirectory.

View 1 Replies View Related

General :: 'find' Command Regex To Exclude Hidden Files?

Jun 28, 2010

I have the following command which finds all files that have changed in the last day and lists them. How can I exclude hidden files like .bash_history?

View 3 Replies View Related

General :: How To Use Grep

Apr 7, 2011

I need to find file from ls - l by using grep and certain regexp.

In particular I need greep to see certain file ending, like let's say .txt but only using regex.

So it should be something like

ls -l | grep '^.+.txt$'

But that doesn't seem to work for me.

View 1 Replies View Related

General :: Use Regexp In Diff / Exclude Lines That Contain The String "[skipthisline]"?

Feb 10, 2011

I need to compare 2 files using diff. The problem I've encountered is that I need to exclude certain lines that contain certain phrases. I know that diff supports the -I switch but no matter how I try to form the regexp it doesn't seem to work the way I expect it to. If anyone has used the -I switch before could you please post some examples of how it is used.

diff -I "[skipthisline]" file1 file2 > output.diff

I need to exclude lines that contain the string "[skipthisline]" but I have no idea what syntax is used after the -I switch. Is is supposed to be included in quotes or slashes /[skipthisline]/ or entered without either? I need to include a backslash before each bracket so that it's not interpreted as a set of characters like [a-z] but is instead interpreted as a string. Do I need to use 2 backslashes? "\[skipthisline\]"

Is it sufficient to simply type the string I want to match or do I need to match the entire line in order to exclude it from the output?

.*[skipthisline].*

or

^.*[skipthisline].*$

View 2 Replies View Related

General :: GREP On Words With 2 Or More Z's?

Dec 21, 2010

I need to grep a dictionary file.Only the words that contain 2 or more z's and only 1 b needs to be listed.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved