General :: Get The Information From A Directory Full Of Files?

Apr 1, 2011

I want get the information from a directory full of files.

What I have so far is this:

Code:
find <path> -exec head {} ; | tail -2

My question is, how do I get that certain section from each file, since tail will only affect the last file. I've tried piping head and tail to sh but that's not available due to permissions.

View 3 Replies


ADVERTISEMENT

Software :: Uncompressing A Directory Structure Full Of Individual Gz Files

Jun 2, 2010

I have a file that I am attempting to use to restore a website for a client. The file is a drupal folder structure where all of the files in the folder (3000+) have been individually compressed into 3000+ individual gz files.

I have figured out how to uncompress all the files using WinRAR but it puts all the files into a single directory, i need the original folder structure maintained.

View 2 Replies View Related

General :: Can't Emacs On Mac OS X Find Information Directory Node / Why Is So?

Feb 15, 2010

The default Emacs on Mac OS X, 22.1, appears to have some problems with the info/help stuff.

When you hit C+h i, it says:

Can't find the Info directory node.

It works in AquaEmacs, but I downloaded the 23 version of emacs precompiled binaries from here and I still have the same problem.

View 2 Replies View Related

General :: Write A Script To Report Useful Information On Disk Utilization For Each User's Home Directory

Feb 27, 2010

I need to write a script to report useful information on disk utilization for each user's home directory.For each directory I need to show: 1. the long listing of that directory entry (but not the files in the directory), so that I can see the rights and owners of the directory.2. The amount of disk used by that directory, in human-readable format, including subdirectories. I need to have two lines for each user one after the other. For example:

/home/user1 directory info
/home/user1 disk usage
/home/user2 directory info
/home/user2 disk usage

The script will assume that all users, except user root, have their home directories in the /home directory (no need to do anything with the /etc/passwd file). And if the administrator adds or removes users, the script should still work correctly (so the script shows the information for all current users).

Here's what I do know. The command "ls -ld /home/user's_name" will give me the info I need for #1. And the command "du -hs" will give me the info I need for #2. What I don't know is how to grab each individual directory in order to apply the above commands to each of them in order. ???

View 14 Replies View Related

General :: Create A *one* Line Command That, Using Tar, Will Collect The Full /usr/local Directory?

Oct 6, 2010

I am currently interning at a place and my job is to essentially learn UNIX. My supervisor gives me problems here and there to help guide me with my learning but for the most part I'm doing this all by self-teaching myself. Needless to say I have run into a few obstacles...for instance-Create a *one* line command that, using tar, will collect the full /usr/local directory (you need to run this as root again) and copy the whole /usr/local structure under /optFor example /usr/local/bin/hello will become /opt/local/bin/hello, etc. I want this as follows:1. /usr/local is collected by tar, but the output of this tar command is its stdout.. what you get from the previous stdout, you compress with gzip and send it to stdout again 3. get this output and decompress with gzip.. get this output and pipe to tar in a way that will extract the tree under /opt.If anyone knows how I could go about doing this, please let me know, or at the very least point me in the right direction. What I've got so far (which could be completely wrong) is:tar cvf - usr/local/ | gzip -c - | gunzip -c - | tar xvf -in theory I feel like this should work (except for extracting the tree under /opt...i'm kinda stuck there)

View 3 Replies View Related

General :: Perform A Long Directory Listing Of All Files In The /bin Directory That Have Exactly Three Characters In Their Name?

Jan 18, 2010

How do you perform a long directory listing of all files in the /bin directory that have exactly three characters in their name?

View 1 Replies View Related

General :: Files Created In A Directory Owned By Directory Group?

Jan 29, 2010

Is there a way, on Linux, to cause all new files created in a directory to be owned by the directory's group instead of the creating user's group?

View 2 Replies View Related

General :: Cronjob Directory / Send An Email If Directory Contains More Than Ten Files?

Oct 13, 2010

I want to run a cronjob every 15 minutes that checks a directory for files. If the directory contains more than ten files I want it to send an email to me.

All I have is this...

*/15 * * * * ls -l | wc -l | [filename] | mail -s "This is just a test" [email address]

I would rather not write a bash script. Is there an easier way to do this? I was looking into some commands like find and grep.

View 6 Replies View Related

General :: Find Directory Older Than X And Mv Directory With Sub Files Command?

Jul 13, 2011

I'm quite new to linux but I have configured a simple ftp server and it's working great. I have a FTP-Shared folder with upload and download subfolders. Under upload's and download's I have identical category subfolders like mp3's, movies, software etc. in both. As the guy's upload, I would like to create a line crontab where I can move all the content under /FTP-Shared/upload/mp3/* older than 14 day's to FTP-Shared/downloads/mp3/ recursively (Like in cp command), but the timestamp must be searched on the first directory and not sub files example: /mp3/Club Dance/CD1/Hallo world.mp3This is how far I got:[root@clients ~]# /usr/bin/find /FTP_Shared/upload/Mp3s/ -depth -mindepth 1 -mtime +14 -type d -exec mv -f {} /FTP_Shared/download/Mp3s/ ;This command moves the directory and files, but it is not recursively

View 4 Replies View Related

General :: No Files On The Disk But 'df -h' Show It's Full?

Apr 21, 2010

Code:
server:/home/mal # cd /backup/
server:/backup # du -hc *
17G export
4.0K lost+found
20M rman
8.0K sqlnet.log
4.0K test.sh

[Code]...

View 7 Replies View Related

General :: Symlink Each Of The Files In One Directory To Another Directory?

Feb 11, 2011

If I have a directory /foo with a few files in it, how do I symlink each entry in /foo into /bar/? For instance, if /foo has the files a, b and c, I want to create three symlinks:

/bar/a -> /foo/a
/bar/b -> /foo/b
/bar/c -> /foo/c

View 3 Replies View Related

General :: Disk Full Deleted Files But No Space Available

May 3, 2010

My main storage partition got full, so I'm deleting files to make room. However, df -k keeps reporting no space available on that partition (/disk). Here's the output of the command several minutes apart while another process is deleting a 30G of space:What can I do to make the space available immediately?

View 4 Replies View Related

General :: Get Full Permission To All Files And Folders In Ubuntu?

May 2, 2011

I am basically Linux/Ubuntu illiterate.(just in case the question itself did not make that clear)

View 14 Replies View Related

Ubuntu :: Copying Files To A Directory And Skip The Files That Already Exist In The Directory?

Jun 30, 2011

How would i go about copying files to a directory, yet skip the files that already exist in the directory, and also remove the files that are in the directory. For example:

Code:

$ls /dir1
img001.jpg
img002.jpg

[code]....

Now i would like to copy from dir1 to dir2, but the contents of dir2 would be:

Code:

$ls /dir2
img003.jpg

View 7 Replies View Related

Programming :: Deleted Files In Directory With So Many Files Without Deleting Directory Itself

Nov 14, 2010

There are millions of files in many directories. Wherenver i try rm * or find or use xargs, they say 'argument list too long' and exit. How can i deleted files in a directory with so many files without deleting the directory itself.

View 3 Replies View Related

Ubuntu :: After Files Deleted Still Shows Up As Full - Shown In Hidden Trash Files

Mar 9, 2011

I have a Kingston 8gb Datatraveler that has been giving me troubles lately. For some reason after I delete files from it it still shows up as full and the files are shown in the hidden trash files. How do I get rid of these files? I can't delete them as they just show back up. Also, I tried to format the drive with gparted and it won't unmount. When I right click and select information, at the bottom it says: Unable to find mount point. Unable to read the contents of the file system. Because of this, some operations may be unavailable.

View 1 Replies View Related

General :: Can't Copy Files From Directory With "&" Symbol In Directory Name

Mar 18, 2010

I am using my media server as my podcast collector. I am in the process of learning the ins and outs of NFS so i can mount a NFS directory and transfer my podcasts from server to player. For now i am using scp to transfer podcasts from server to desktop then to player. The problem is the path to the directory of one of the podcasts is /home/user/gpodder-downloads/The BILL&TIMMY Show Podcast.

whenever i try and run my scp command it fails because it thinks that TIMMY is a script i want to run in the background. I have tried to back-slash escape the character, i've tried single quoting and double quoting the character and i still get the same problem. as it sits now i have to move all podcasts to another directory and then transfer them to my desktop...but i would like to transfer the podcasts without un-necessary steps.

View 8 Replies View Related

CentOS 5 Networking :: Determining IP Information For Wlan0...SIOCSIFFLAGS: No Such File Or Directory

Oct 18, 2009

i wanted to learn linux, so i just installed Centos on a thinkpad x200. my wireless will not work. when i try to activate it i get this error:

Determining IP information for wlan0...SIOCSIFFLAGS: No such file or directory
SIOCSIFFLAGS: No such file or directory
# lspci
00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07)

[code]....

View 5 Replies View Related

General :: Make NIS User Information Override Local User Information On Client Systems?

Jul 30, 2011

How would you make NIS user information override local user information on client systems? This is what I think is right? Add nis on the passwd registration file on the second line Is this correct?

View 1 Replies View Related

General :: Write A Shell Script Which Will Simultaneously Collect OS User Information And Write In An Individual Text Files?

Feb 17, 2010

I want to write a shell script which will simultaneously collect OS user information and write in an individual text files.Can anyone tell me the syntax of the script.N.B. The user name will be mentioned in an array within the shell script.

View 8 Replies View Related

General :: Copy Files From Directory Of One User To Directory Of Another User?

Apr 15, 2011

Is it possible to copy files from directory of one user to directory of another user in linux?

View 7 Replies View Related

Networking :: Folders In The Directory /home Full On NFS Servers

Jan 28, 2010

we connected the new hard disk in the folder /home /newhdd it has alot of files and we gave access to the folder /home via NFS When we attach a folder on the remote computer is on a remote computer folder newhdd empty, while the other folders in the directory /home full like on NFS servers.

View 1 Replies View Related

Server :: How To Free Up Space On Directory (100 Percent Full)

May 5, 2010

I am using Redhat Linux 4 as I checked space and foud that / is 100% full. Like below:

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda3 2316536 2179008 19852 100% /
/dev/hda2 101107 9324 86562 10% /boot
/dev/hda6 1683960 70256 1528160 5% /home
none 192012 0 192012 0% /dev/shm

How to create more space on / directory? or decrease size in / directory.

View 2 Replies View Related

General :: How Long Are Files Kept In /var/tmp/, And How To Use The Directory

Jul 26, 2010

I'm always hesitant to use /var/tmp/, because I never quite know exactly how long the files are kept there for, or even what the directory is used for. What determines when a file gets removed from /var/tmp/, and how is the directory intended to be used?

View 2 Replies View Related

General :: Delete Files In A Directory - RM?

Jun 17, 2010

I have a USB drive that I boot using SysLinux. I think select one of several options to complete a task. I do not have access to edit those Kernels. I need to add a option from the Syslinux menu where I can delete all the files from a specific directory.

View 3 Replies View Related

General :: Deleting All Files From Directory Except For Two

Nov 25, 2010

I'm writing a Perl script which performs linux commands.I have a directory with a load of files.

Code:exec_cmd('rm $(ls * | grep -v file1)');
This command will delete all except for file1. How can I modify this to delete all files except for file1 & file2?

View 2 Replies View Related

General :: Copy Files From Directory ?

Dec 22, 2009

I have four directories and i want to copy only the files in the directory to a single directory, how can i do it with the cp command.

The directories names are dir1, dir2, dir3 and dir4 and i want only the files from these directories to a single directory called mainDir.

View 3 Replies View Related

General :: How Many Files Are In Lab07 Directory?

Jun 18, 2010

So I am taking an half online/ half go to school class. I am working on an assignment that is due tonight by midnight. I am kind of confused on this question and am waiting on an email from my instructor but only have 2.5 hrs left til it's done. Here is the question.Use file globbing to copy all the files in the /labs/data directory that end with a .out to the lab07 directory. How many files are in the lab07 directory?when I ls -l into this directory. I don't see any files with that extension. Is there an easier way that I am missing such as. cp /labs/data *.out > lab07 ??? Someone help?

View 6 Replies View Related

General :: Sorting Files In A Directory?

Jan 6, 2010

I have some files in a directory like

file1.txt
file10.txt
file2.txt

[code]...

View 5 Replies View Related

General :: Tar Command For Directory With Files

Feb 24, 2011

Using tar command. All I need the usage, and basic explanation. Let's assume I have a directory with files that I need to tar, how do I go about it.

View 14 Replies View Related







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