Programming :: How To List Contents Of Directory And Exclude Any Subdirectories

Aug 2, 2010

I'm having trouble figuring out how to list the contents of a directory and exclude any subdirectories.

View 5 Replies


ADVERTISEMENT

Slackware :: Rsync Exclude Directory With All Subdirectories And Files

Dec 26, 2010

In reading the rsync man page and browsing a lot of websites, I ended up a bit confused, or maybe it was just too much eggnog. Anyway, to exclude a directory "videos" with everything in it, which is /home/user1/camera/videos and I'm rsyncing the whole user1 directory to an external drive

[code]...

View 1 Replies View Related

Software :: List Files/directory Names Without Directory Contents?

May 3, 2011

When I run "ls -al somedir*" (I use the "ll" shortcut, actually), Linux not only list files that match, but also the contents of directories whose name also happens to match.Is there a way to limit "ls" so that it will only show names (files and directories) and ignore the contents of the directories?

View 2 Replies View Related

General :: List The Contents Of Directory?

Mar 12, 2010

1 List the contents of directory, /dev using a detail listing format and page by page.

2Mount the CDROM to the directory, /media/cdrom.

3 Delete the file "/home/student/myfile" without any confirmation (Assume you have the required file permission to delete this file).

View 1 Replies View Related

General :: Find Files In Subdirectories And Copy Them To Another Directory With The Same Subdirectories?

Nov 18, 2010

This question is very similar to this one except that I want to maintain the file's original subdirectories.

For example if I had

/temp/a/a.txt
/temp/a/a.jpg
/temp/a/b.txt
/temp/b/c.txt
/temp/d/d.txt
/temp/d/d.jpg
/temp/d/e.txt
/temp/f.txt

[Code]...

View 2 Replies View Related

Fedora :: Corrupt .gvfs Directory - List The Contents Of /home/Razorblade Folder - Nothing

May 4, 2010

I installed Fedora 12 x64. Now everytime I start my Linux the .gvfs directory in my /home/Razorblade -dir is corrupted. So I have to reboot and start an Linux LiveCD, mount my home partition and delete this folder. After that I can login normally. Symptoms: I am able to login normally, start a browser, start my mail client, list the contents of subfolders of /home/Razorblade/... - everything fine. But as soon as I want to list the contents of my /home/Razorblade folder - nothing but this turning blue thing around the curser. The command line does nothing after "ll /home/Razorblade", sometimes even crashes and closes. As root I am able to do "ll /home/Razorblade" And this is what I get:

[Code]....

View 7 Replies View Related

Programming :: Get The Contents Of A Directory In C++?

Dec 27, 2010

How to get the contents of a directory in C++?I know about opendir(), but I wonder if there is a C++ way (that uses classes and exceptions).

View 1 Replies View Related

Fedora :: Exclude A User From The Greeter List?

May 12, 2010

I would like to be able to exclude a certain user name from the list presented by the Greeter. Is that possible? I tried adding:

In the custom.conf file, but it didn't work.

View 10 Replies View Related

Red Hat :: Backup Exec Default Exclude List?

Feb 4, 2010

I am looking for a default, or starting "exclude list" for system backups. We are currently using Symantec Backup Exec, but I also do not think that is important to this question. I would think that the Oracle "lock" files and the /var/run/*.pid files can be excluded from the backup, and probably the dell file also. Can some provide a list of files/directories that can be excluded (from backup) for RHEL 5?

View 1 Replies View Related

Programming :: List Only Hidden Files In Current Directory?

Feb 15, 2010

How to list only hidden files in current directory ?

View 2 Replies View Related

Programming :: PHP - List Directory - Choose A File - Change Its Name

Mar 16, 2011

Im looking to use PHP to list a directory. When I click on a filename, I'd like it to automatically remove the first 16 characters off of the filename and save it to the filesystem.

View 6 Replies View Related

Ubuntu Networking :: Sharing Directory, And It's Subdirectories?

Oct 20, 2010

I've been doing some file-sharing with Ubuntu. And I've noticed that the files only in the immediate directory is shared, the rest of the folders are shown in other PCs but access is denied. How can I share all the subdirectories in a folder without having to them manually?

View 6 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 :: Find All First Level Subdirectories Under The Current Directory?

Jan 24, 2011

1. How can you find all first level subdirectories under the current directory?
2. How will you show the last 100 lines of the file "foo.log"?
3. How will you Stream the contents of a the log file "foo.log" as it gets written to?
4. How can you grep for a pattern on a gzip'ed file? e.g., find "foo" in bar.gz
5. Find all lines in the file "foo" which DON'T have the pattern "bar"
6. Your web server is running very slowly. If you can login to the server, what command will you run to find out cpu and memory use?
7. Extract the file foo which is a part of the tar'ed, gzip'ed file bar.tar.gz
8. You attach a usb disk to your linux desktop, but it does not show up. How can you get more information about the error?
9. What is the secure way to login to remote systems?
10. What is the difference between TELNET and SSH?
11. Given a file 'a' with the following permissions -rwxrwxrwx 1 rohit rohit 0 2011-01-24 13:30 a Change its permissions such that it is only readable and writable by its owner, not accessible by anybody else in the group and only executable by the world
12. Difference between using ' and " for quoting a string / command in a shell
13. In the attached text file (test.txt) replace all occurrences of 'red' with 'yellow' without using an editor (i.e. from the command line)
14. How would you suppress output written to stderr by a command
15. Meaning of the #! notation in scripts e.g. #!/bin/sh
16. What is the output of the attached shell script test.sh Scripting questions, all based on the attached file access.log. Use one of perl, python, ruby, or shell scripts to solve these questsions. If any answer is obtained using just the command line, please include those commands as well.
17. How many accesses were made between 10am and 11.30am on Jan 24, 2011?
18. How many unique IP addresses accessed this server?
19. For every IP address which accessed this server, output a report showing number of hits for every type of HTTP status. For e.g., IP 192.168.1.20 has 164 hits with status 404 and 1690 hits with status 200.

View 8 Replies View Related

General :: Copy All .jpg Images In Subdirectories To A Specific Directory?

Aug 5, 2010

I have .jpg files in many subdirectories from where I need to copy all the images from all the sub directories and paste them to a specific directory.I have used `cp -rf *.jpg media/sik/` which only copies the .jpg files of the directory in which I was working.

View 5 Replies View Related

General :: Trying To Display Count Of Number Of Subdirectories In Directory

Feb 7, 2011

I am a noob and I am trying to display a count of the number of subdirectories in a directory. I have been able to use find -type d to list directories and subdirs but I want a numerical value of dirs and subdirs. I know ls -l gives a count but when I try ls -l -d all it shows is "." I also have tried a combination with the -R option but nothing seems to be working for me.Please forgive my ignorance but I am working on a script for class and this is the first step.

View 3 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 :: Recursively Remove Subdirectories And Files But Not The First Parent Directory?

Feb 11, 2010

I'm able to use the following to remove the target directory and recursively all of its subdirectories and contents. find '/target/directory/' -type d -name '*' -print0 | xargs -0 rm -rf

However, I do not want the target directory to be removed. How can I remove just the files in the target, the subdirectories, and their contents?

View 4 Replies View Related

Ubuntu :: Move Music Files From All Subdirectories To Parent Directory?

Mar 1, 2010

I've found several posts discussing how to do this in with the terminal, but none exactly fit what I am trying to do. And since I'm still very new, I was hoping for some help.

I have a parent directory called "Music." The subdirectories all start with "artist", some go further as in "artist/album/cd1". So right now the structure varies in the following ways code...

How can I move all the files (or the file types that I choose) to the parent directory "music"?

(By the way, for any who are interested, this is so that I can use an external hd with a PS3. ("playstation 3"--for anyone who was in my predicament searching the threads)

View 7 Replies View Related

Ubuntu :: Find Last Modified File In Current Directory And All Subdirectories?

May 28, 2010

I need to write a script that is given a directory as an argument, and it prints the last modified file from that directory and all its subdirectories.

for example:

$ newest /usr/etc
--> /usr/etc/httpd/httpd May 28 12:16

If I had to do it only for the current dir, it would be easy...I'd probably use "ls -lt" and then show only the first line...

View 1 Replies View Related

General :: Giving User Write Access To Directory And Subdirectories

Aug 10, 2010

I need to give a user write access to /var/www and its subdirectories. The current directory permissions are as follows:rwx r-x r-x root root

I added the user to the root group but that didn't seem to help.I read I could chmod -R to change the access to write for the www directory and subdirectories but I don't want to change things and mess up the website. How can I give the user access to write to the www directory and subdirectories without messing anything up? Would changing the www directory group owner to his group cause an issue anywhere?

View 3 Replies View Related

General :: Script To Open All Subdirectories Of A Single Directory And Then Run A Command?

Mar 24, 2010

I am trying to write a very simple script that will go to every subdirectory of a single directory and run a command (lets call it make_ndx).I know I can write this the long way with in a text document with something like:

cd /"the directory"/"the 1st subdirectory"
make_ndx
cd ..
cd "the 2nd subdirectory"
cd ..

Alternatively, I also tried: for i in 'find /path/somemorepath -type d -mindepth 1'; do cd $i; make_ndx -f *.gro; done which returns me with the error cd: find: no such file or directory. But if I run the find command by itself to test if I am calling the right directories, it gives me the exactly the output I am looking for. Any ideas? Should I just write the find results to a file and loop through the contents of the file (which seems a little bit like overkill) or am I just making a simple typographical mistake and I am just not seeing it?

View 7 Replies View Related

General :: Allow Normal Users To Mount Tmpfs Under Subdirectories Of Their Home Directory?

Oct 11, 2010

How can I allow normal users to mount a tmpfs under any subdirectory owned by them?

View 3 Replies View Related

Server :: Backup A Single Directory And It's Subdirectories On Lucid To A Freenas Box Across Network

Jul 20, 2010

This should be a quick one. I'm trying to backup a single directory and it's subdirectories on my Lucid Server to a freenas box across my network. This is what I'm using to do that..

rsync -r -a -v -z * --delete freenas:dSIBackups It almost works perfectly except for one problem. When a file is deleted at the source, this command doesn't seem to delete it on the receiving end. I assumed that the --delete would do that but aparently not. Can anyone think of a reason that this would happen?

View 3 Replies View Related

General :: Command Line - Automating A Task - Copy All Subdirectories And Files From One Directory To Another

Jun 10, 2010

I need to copy all subdirectories and files from one directory to another ever 5 minutes or so, with the old data automatically being overwritten with the new data. I'd also like this to run at startup. Is there any way this can be done? If so, what program would I need to schedule the automation and what is the command line I would need.

View 2 Replies View Related

Ubuntu :: List Folder Contents ?

Jul 20, 2011

I know that you can use ls to list the files in a folder, but is there anyway to list the contents of the other folder? Like, say I have a folder labelled "Records", and inside is 12 folders, one for each month. Is there any way to list the contents of the 12 subfolders without just going into each one with cd and using ls?

View 3 Replies View Related

General :: List/find All Regular Files In All Subdirectories Excluding Binary Files

Oct 5, 2010

I know I can do find . -type f, but that includes binary file and I couldn't find a way to exclude them with find

View 4 Replies View Related

OpenSUSE Network :: Setup An Apache Server On Computer Which Will Allow Browsing Of Files In A Specific Directory And Subdirectories?

Jun 13, 2011

I'm trying to setup an Apache server on my computer which will allow browsing of files in a specific directory and subdirectories, without needing any sort of authentication.

I've got the Apache2 server up and running through yast, and everything works fine as long as I try to point it to the /www/htdocs folder. However, I want to point it at another folder, which is on another partition. This partition is formatted as NTFS, if that matters at all (here's some background on some permissions issues I had with the NTFS partitions recently).

When I change the "Directory" setting in the Yast http server configuration utility to the directory on the NTFS partition I wish to use, attempting to access the server results in the following error:

Code: Access Forbidden: You don't have permission to access the requested directory. There is either no index document or the directory is read-protected. If you think this is a server error, please contact the webmaster.

Error 403
192.168.1.100
Mon Jun 13 23:43:29 2011
Apache/2.2.17 (Linux/SUSE)

View 4 Replies View Related

Ubuntu :: Bash: List Contents Of Folders

Dec 1, 2009

how I sould do the following?

I have a folder called "Downloads" and among its contents there are a bunch of files with "flv" extension.

If I do

Code:
ls path/to/Downloads/*flv
I will get something like this:

[Code]....

(The reason I want something like that has to do with a small script I'm trying to write).

View 5 Replies View Related

General :: List Contents Of All Files Recursively?

Jan 22, 2011

What I would like to do is to print the contents of all text files in a particular directory, recursively. Problem being that there are directories and possibly binaries scattered around in the filesystem as well.

Trying cat * works as long as there are no directories in there, but when there are it gives an error instead and prints nothing.

I'm sure it's easy using file -f or something but I can't figure it!

View 8 Replies View Related







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