General :: Delete Oldest Directory And File Using Ncftp Commands?

Aug 17, 2010

i use ncftp for some bash script action. how to delete oldest directory and oldest file using ncftp commands?

View 3 Replies


ADVERTISEMENT

CentOS 5 :: Command To Delete The Oldest File In A Folder/directory?

Oct 13, 2009

I am trying to add a command to my backup script to delete the oldest file in the destination folder before adding a new .tar.gz file.I found this information at .html which I thought would work fine and added the following line to my backup script:ls -t -r -l /backups/Scalix_Backup* | head --lines 1 | xargs rmHowever when I tried this I get an error:rm: invalid option -- wTry `rm --help' for more information

View 7 Replies View Related

General :: Creating A Script That Removes The Oldest Files On /tmp Directory?

Nov 17, 2010

I'm trying to configure a script the deletes the file and directories with more than 10 weeks on my /tmp directory, this is what i'm trying to do:

Quote:

#!/bin/bash
#Script para borrado de ficheros y PDFs de /tmp
### Directorios/PDFs a borrar

[code]....

View 6 Replies View Related

General :: Debian Without Basic Commands: 'No Such File Or Directory'?

Nov 10, 2010

My new VPS is running Debian 5.0 (bash 3.2.29), and some commands seems to be missing. For example the ps command is not here, neither is ls (but dir works). Is there a package missing or what's the deal?

:~# type ps
ps is hashed (/bin/ps)
:~# ps

[code]....

View 1 Replies View Related

Programming :: Sort Oldest 5 Files In A Directory Tree Recursively Based On Timestamp?

Jun 3, 2010

I have a directory listing with many subdirectories having many files. I want to recursively search for the oldest 5 files starting from the base directory and not 5 from each subdirectory. I am writing a shell script which sorts them using ls -lRtur|egrep "txt|jpg" > /tmp/file1 Now from this /tmp/file1 file I want to sort the files same as what the ls -ltr command does that is oldest file time to newest file time first. How do I sort based on Linux time stamp? The files itself also have Linux timestamps embedded in them So I can sort based after extracting them as well if it is easier.
My /tmp/file1 has entries like below.

-rw-rw-r--. 1 usr1 usr1 705 2010-01-22 17:25 sample20100603173659.jpg

I want to get the 5 oldest files and then delete them.

View 1 Replies View Related

General :: 'su ' Error "No Such File Or Directory I Cannot Delete That Entry From /etc/passwd As I Cannot Login As Root"

May 15, 2010

[Code]....

Password: su: /bin/bash:/sbin: No such file or directory i cannot delete that entry from /etc/passwd as i cannot login as root.

View 11 Replies View Related

Fedora Servers :: Cannot Delete Directory 'foo': File Exists

Jan 17, 2009

I was transferring some files from my laptop (running FC6) to a server at my work (don't know what kind) with "scp -rpC" and it stalled, don't know why.
Now when I try to delete the files from the server so I can start again I get the following error message

Code:
rm -r Single_injections/
rm: cannot remove directory `Single_injections/195320/400mA/010': File exists
rm: cannot remove directory `Single_injections/195320/400mA': File exists
rm: cannot remove directory `Single_injections/195320': File exists
rm: cannot remove directory `Single_injections': File exists

[Code].....

View 6 Replies View Related

General :: Delete Bash Terminal History Upto Certain No. Of Commands?

Jan 12, 2010

i want to delete some say 10 previous commands in bash shell!

View 3 Replies View Related

Programming :: Delete Gaps In Directory In A Ext2 File System?

Nov 1, 2010

Directories(-entries) are in a EXT2 file system
managed in a singly linked list.
Delete files in the directory causes Gaps or holes to appear in
the linked list of the directory.How does a C-source code look like,
which would reorganize this list and remove the gaps or Holes.

View 5 Replies View Related

General :: Possible To Shorten My Directory Commands In Ubuntu?

Jun 20, 2011

When working on a rails app I like to open all of my files through the command line like so
CD my_app
gedit app/views/user/show.HTML.erb
Is there a way that I could shorten this so that I could just write something like
gedit user_views/show.HTML.erb

I would like the console to stay in the main directory, I just don't like having to type out app/controller/user_controler.rb every time I want to open the user controller. I know that I could just open the file with my mouse, but I feel like moving from keyboard to mouse breaks my focus a little bit. When I can just tap away at the keyboard it seems like I have a more smooth workflow.

View 7 Replies View Related

General :: Make Ncftp Hold The Connection Open Longer Than The Default ?

Jan 18, 2011

Is there a way to make ncftp hold the connection open longer than the default? a ping every 10 sec or something? I feel like after I push a change up to the server before I can verify everything is working as expected and get back into ncftp the connection is closed by the remote host.

View 1 Replies View Related

General :: Delete The Parent Directory With Rm -rf?

May 15, 2011

I have a FAT32 SD card with a file on it, that, viewed in Windows the filename consists of a long string of nonsense. Viewed in my Android phone's Linux terminal, ls -a shows nothing in the directory. When I try to delete the parent directory with rm -rf deleteme, it fails with "Directory not empty". When I try to delete/move in Windows 7, it says the filename would be too long and/or Explorer crashes. Windows disk check doesn't find anything wrong. How can I delete this?

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 :: Can I Delete Files Created By Others In A Directory I Own

Jul 23, 2010

I created a directory somewhere with permissions rwxrwxr-x so that other users in my group can create files and directories in it.

I do need to be able to delete the contents in this "public" directory, but it seems that while I am able to remove any files in this directory I cannot remove and subdirectories under it.

Is there a way to remove such subdirectories owned by others under a directory owned by me?

View 3 Replies View Related

General :: Delete Protected Directory In Samba?

Dec 20, 2010

How to create a directory in samba share in which user can write read files but neither can create more directories tree nor delete any directory.

suppose
[Share]
comment = NRshare
path = /home/share
browseable = yes

[Code].....

I know user cannot delete share directory here. But user can create any number of directories of files in share.

I would like to create directories in share which cannot be added or deleted.

View 2 Replies View Related

General :: How To Delete All Files In Directory Without Deleting?

Feb 9, 2010

I know that rm -i will prompt wether you want to delete each file.But rm -i -r will prompt for each file in each subdirectory recursively. How to make it prompt just for the directory itself, and then delete its contents without asking?How to delete all the files in a directory without deleting . and ..?How to recursively delete all tilde files in a directory?How to GUI file managers delete files to Trash? Where is this "Trash" located? Can you delete to trash in the command line?

View 14 Replies View Related

General :: Delete All Files In A Directory Except The 7 Latest Ones?

Dec 4, 2010

Here is how i am isolating the 7 latest files

Code:
ls -ltr | tail -7

is there a way to give that negated list to the rm command? or should i be using the find command with an exec {}?

View 14 Replies View Related

General :: Rm Non-interactive Command - Delete A Directory With Its Files

Sep 28, 2010

I wanna delete a directory with its files and I wanna do that as follows: rm -r dirToDelete Unfortunately, I always get asked for EACH single file if I wanna delete this because it is write protected.... Is there a way to suppress this feedback message so that just the whole directory with its contents disappears?

View 5 Replies View Related

General :: Delete A Line With Certain Format From Files In A Directory?

Sep 21, 2010

I need a PHP script to delete a line with certain pattern from all filesin a directory. The Directory contain files with extensions .js,.html and.php. Do any body give a working code snippet to Read all files in a directory with above extension and delete that line from the files.

View 1 Replies View Related

General :: Script To Compress A Directory And Then Delete Older Than 7 Days

Feb 3, 2010

I have been trying to write a script that will take a directory, for example /accounts compress it into a .tar file with the filename containing the date of compression, for example accounts030210.tar and then place that file into a directory called /archive

I also want the script to delete files in /archive that are older than 7 days.

View 3 Replies View Related

General :: Find Folders With ONLY One Specific File In And Delete File And Folde

Oct 21, 2009

Many folders within a subdirectory some of which have lots of data in and some of which have only one specific file called produkt.fil inside.I need a command to find and delete those folders that contain ONLY the file produkt.fil - if other files exist (doesnt matter what they are) then they should be left alone. Note: produkt.fil exists in all of the folders always.

View 5 Replies View Related

General :: Remove Write-Protected File - Will It Actually Delete The Password File?

Jul 30, 2010

When I ls -l /etc/passwd, -rw-r--r-- 1 root root /etc/passwd When I login as myself, and rm /etc/passwd, it asks: rm: remove write-protected file '/etc/passwd'? If I say yes, will it actually delete the passwd file?

View 1 Replies View Related

Ubuntu :: Server Directory Can't Delete Directory / Fix This?

Jul 9, 2011

Ubuntu server recently had issues with a disk. fsck seemed to correct everything, but I have one directory that I can't delete, chown, chgrp, chmod, etc.

Here's the listing for the directory
dr-x-wxrwt 2 16709 25134 8192 2020-08-23 22:34 UDLEDATB.DBF

Note the sticky bit is set and the uid is a number that does not appear in /etc/passwd.

Even as root, any attempt to delete, chmod, chown, etc. gives "Operation not permitted".

Since sticky bit on a directory restricts delete to the owner and the owner is invalid, I am stuck. I need to delete this directory.

How can I fix this?

View 4 Replies View Related

General :: Stale NFS File Handle - How To Delete File

Jan 21, 2010

How do I delete a file if it happens like this.
-????????? ? ? ? ? ? temp.cgi

View 5 Replies View Related

General :: Rename A File Say Old.txt To New.txt Using Commands?

May 19, 2010

How would I rename a file say old.txt to new.txt in Linux using commands?

would it be...?

rename old.txt new.txt

View 2 Replies View Related

Ubuntu :: Delete File - No Right Click Delete Option?

Feb 18, 2010

Why is there no Delete when I right click like there is with Windows in ubuntu? Pretty much everything else is there like new folder and so on Is there some way to add it? Also why when i delete something does it not ask me if I am sure that i want to delete that file?

View 6 Replies View Related

General :: Execute Commands Over SSH In A Batch File?

Feb 17, 2011

I'm looking to, all in the course of one batch file:

ssh into a remote computer execute commands (per the batch file) on the remote host.

What options do I need to add to the ssh invocation so that the batch file executes the lines following the ssh invocation over the connection?

e.g., with sftp it's simply adding a -b /dev/stdin and then << EOF at the end; how do I do this with SSH?

View 1 Replies View Related

General :: Joining Two Commands In The .bashrc File?

Apr 15, 2011

attending class in the Redhat Academy Website. I was wondering how can you join the two commands of cd/usr & ls successfully in the .bashrc file?

View 10 Replies View Related

General :: Commands To Remove Particular Few Lines In History File?

Jun 16, 2010

Is there any commands or scripts to remove only selected line in the history file.

View 1 Replies View Related

General :: Delete A File From Different Dir Without Using Cd?

Nov 30, 2010

we assume that we have 2 folders with the name 1 and 2 . The folder 2 is inside 1 . Also, in folder 2 we have file with name "file.txt". And we are in folder 1 . How can we delete the file.txt in one command line ? I mean without using the code below:

Code:

cd 2
rm -f file.txt
cd ..

View 3 Replies View Related







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