Use this tag for questions about file management and operations on files.

learn more… | top users | synonyms (1)

1
vote
1answer
5 views

How would an administrator of a system prevent himself access to a file for 24 hours?

How would a single administrator go about locking himself out of a file for 24 hours? Rules: The file cannot be renamed or moved. Root access has to be maintained. A sufficiently complicated lock ...
2
votes
1answer
25 views

Merge text files with 1st column and difference in output file

File 1: (text1.txt) Row_Added_Ts Count 01/01/14 2022448 02/01/14 8345155 03/01/14 8663852 04/01/14 6785739 05/01/14 5279913 File 2: ...
1
vote
3answers
65 views

Is there a way to undo a terminal command?

I just copied a whole directory into another one using cp ~/local/* ./ and actually wanted to type cp ~/local/srl* ./ so I'm founding myself with a lot of unnecessary files. I can suppress them ...
2
votes
3answers
35 views

Difference between files in directory

I have two directories with same files but with some difference in their contents. I want to list down those files which are differing. For example There are two folders Folder1 and Folder2 with ...
-1
votes
1answer
10 views

save output into a file from sqlplus query in ksh script

The thing is that it overwrites in Result.txt and I only get the last query. How can I fix this? #!/bin/sh while read -r line do echo "'$line'" sqlplus -s whatever/whatever <<-EOF SPOOL ...
0
votes
2answers
26 views

Wrong zip command messed up my project directory

I've issued a command gzip -r project.zip project/* in projects home directory and I've messed things up; every file in project directory and all other subdirectories have .gz extension. How do I undo ...
1
vote
2answers
22 views

No option of creating new file in centos 7 gui [duplicate]

I have recently installed centos 7 and was trying to create a new file through right click and selecting create a new file option as I have done in centos 6 but there is no option of create new file ...
1
vote
1answer
24 views

Detecting file size and do operation conditionally

In my main_dir, I have a lot of sub-folders say DFT1 to DFT150, and in each directory, there is a file named OSZICAR. However, some of this would have file size 0. So I would like to have a script, ...
3
votes
2answers
97 views

tar command - skip symlinks

I use the tar command as, tar -cvf protTests.tar protTests/* to tar all files inside the folder, protTests. But this is including the symbolic links inside the folder, which is not a desired one. ...
-1
votes
0answers
15 views

Can't locate Vim folder anywhere on linux mint system

I'll try to keep this short. I've been trying to install YouCompleteMe and have had a bunch of trouble, so consequently I have installed and uninstalled vim a few times. Now my problem originated ...
0
votes
3answers
32 views

Backing up files [duplicate]

I would like to backup all files older than 90 days and greater plus gzip them. I could execute: find /path/to/files -type f -mtime 90 -exec gzip "{}" \; Problem with this command is it includes ...
36
votes
2answers
3k views

why is rm allowed to delete a file under ownership of a different user?

From the post Why can rm remove read-only files? I understand that rm just needs write permission on directory to remove the file. But I find it hard to digest the behaviour where we can easily delete ...
0
votes
0answers
20 views

how to exclude specific subfolder when creating zip file via command line linux

I do want to exclude subfolder like uploads/2015/OtherSubfolderName through command line. I have tried with below command, its working fine. zip -r zipfile.zip public_html -x *uploads* but can we ...
0
votes
0answers
19 views

Lubuntu won't let me change a file's permission

Yesterday I installed Lubuntu, and it works great. Today I've been messing around with my files (don't worry they aren't system files) and I came across file settings (keep in mind that I am the Admin ...
1
vote
1answer
62 views

How to know which programs support streaming I/O

As I understand it, programs that support streaming I/O can work with files more than the size of the memory. Is this correct? Is there a way to know which programs support streaming I/O?
3
votes
1answer
30 views

Using File Date/Time as Metadata: Reliable?

Background: I have groups of files in their own directory which I merge into one file in order of their filename. I call them t1.txt, t2.txt, t3.txt... I merge them in order of the integer. ...
0
votes
3answers
46 views

Rename files in directory according to name of directory

I am trying to rename a bunch of files according to the names of their directory in Linux, SSH. I have a directory called XYZ01smith. In it are four files called smith_5*.I need to add prefix XYZ01 ...
-4
votes
1answer
26 views

How can I show the size of all cache files in my home directory? [closed]

I want to get the size of all cache files in the home directory.
2
votes
3answers
93 views

FNR and NR variables problem

I have two files, one of them has 10 records, and the other one with 15 record, the problem is when I cat them together, always FNR=NR. For example, consider below files: File1: 1,boo 2,foo 3,boo ...
1
vote
1answer
28 views

Check if multiple files exist in directory

How to find multiple files present in a directory in ksh (on AIX) I am trying below one: if [ $# -lt 1 ];then echo "Please enter the path" exit fi path=$1 if [ [ ! f $path/cc*.csv ] ...
2
votes
3answers
85 views

List transient files by numerical value having number greater than a given constantly varying filename

I've a directory having constantly changing filenames (by numerical value) listed as: -rw-rw----. 1 root root 10493952 May 7 10:39 A0000000.LOG -rw-rw----. 1 root root 10493952 May 7 08:38 ...
-1
votes
0answers
11 views

How to downgrade a package in Xubuntu 15.04

I want to install Skype in Xubuntu 15.04 and it does not work. Someone suggested that: Here is the fix: Downgrade. Enter the following into terminal. sudo pacman -U ...
0
votes
1answer
57 views

SED - Find and replace with special characters (#, , % )

I'm aware that this is a really simple question, but I'm struggling to find a solution to this . I need to automatically find and replace in the /etc/aliases file the following section: # Person ...
3
votes
1answer
31 views

How to limit speed of file copy?

I am copying huge file from NFS mount using dd: dd if=/mnt/nfs/image.img of=/dev/sda I need to limit the speed of reading from NFS. How can I achieve it? The only precondition is to use some easy ...
1
vote
1answer
41 views

Batch renaming of files with ascending number

I have a batch of files: $ ls Li1Fe1O2_11 Li1Fe2O3_8 Li1Fe3O4_2 Li1Fe3O4_5 Li2Fe1O3_16 Li2Fe2O4_12 Li3Fe1O4_19 Li3Fe1O4_22 Li1Fe1O2_14 Li1Fe2O3_9 Li1Fe3O4_3 Li1Fe3O4_6 Li2Fe1O3_17 Li2Fe2O4_13 ...
0
votes
1answer
13 views

How to use tune2fs?

I want to adjust the time interval between ext2, ext3 and ext4 filesystem checks to 180 days? I know that I have to use tune2fs -i 180 but I am not sure about the arguments
4
votes
1answer
37 views

Reason for change in ctime when the file content is modified

I understand that ctime changes when the file metadata or the file content is changed and mtime on file content modification. I would like to know the reason for updating ctime when the content of ...
0
votes
1answer
19 views

How do I check whether audio file samples are clipped without playing the file?

I have a big MP3 audio file, about 170 MB, which I'd like to check for clipping. In details I need to increase the audio volume but I don't want to push the volume too high and clip audio samples. I ...
1
vote
0answers
29 views

What exactly files whose names' prefix is “AT.postflight.” are needed for?

I am not sure if this question should be asked here, since I am on an OS X, but since I am using bash, and I am asking about the meaning and the purposes of some files. I am trying to understand why ...
9
votes
3answers
519 views

Find all animated gif files in a directory and its subdirectories

let's say that i've done a find for .gif files and got a bunch of files back. I now want to test them to see if they are animated gifs. Can i do this via the command line? I have uploaded a couple ...
5
votes
1answer
278 views

How to create files named 'a to z' - any trick? [duplicate]

I need to create 26 files named a to z in single command. I thought touch command would be sufficient with the regex, but it doesn't expand [a-z] instead it creates a single file with name "[a-z]". $ ...
0
votes
0answers
24 views

Light file copy with diff

Is there a way to copy a file by creating another instance of it that is no created as a hard copy but by a link with the difference that any edit to that file will be saved in an diff file? Like ...
1
vote
3answers
54 views

Find lines in (muliple) files that contain the given line in an input file

So, if I have a number of files like the following: file1: 123 456 789 012 file2: line1 922 line2 392 line3 456 line5 291 line6 201 ... file3: line1 111 line2 123 line3 19 line5 542 ...
5
votes
1answer
38 views

Is it possible to make ls ignore Windows hidden files?

I'm using the GnuWin32 libraries on a Windows 7 machine. Everything is working fine except that the ls command is showing all of the NTFS hidden files. The solutions I've found for this so far all use ...
-2
votes
3answers
49 views

Delete subdirectory folder while saving contents

Lets say I have the directory /Users/admin/Documents/Folder1/file1.txt and would like to delete Folder1 without also deleting file1.txt. In the end it should look like ...
1
vote
2answers
189 views

What files does the Linux kernel access?

/init during early userspace, /sbin/init, and /sbin/request-key are three files that the Linux kernel accesses (and they are all executables). Are there any other files, possibly non-executable ones, ...
1
vote
0answers
18 views

Write shrunken .img file to device file

I have a backup image of a device file /dev/sda3 that I created using: dd if=/dev/sda3 of=~/sda3.img. The image is very large, so I have re-sized it to remove empty space. My question is can I ...
2
votes
0answers
45 views

Can file handles be translated to filenames?

Is there a tool for translating file handles to file names on Solaris 10? I've looked around and found several scripts including the one at: http://heim.ifi.uio.no/kjetilho/hacks/fhfind.perl ...
1
vote
0answers
36 views

Detect and remove unused files to save space [closed]

I want to save disk space by removing files I don't need. BleachBit crashed systematically when running in my Ubuntu 14.10 machine. However, what can I run as command to clear temporary files, broken ...
1
vote
1answer
49 views

Does linux have file locking protection when trying to rename/deleting files

I have a cron job that kicks off a new process every day. The process runs every 5 minutes and appends to a log file. Another cron job runs every 60 minutes. It takes some of the data in the log ...
0
votes
2answers
38 views

Why do compiled programs create a copy with ~?

Why is it that when I run programs for the first time it creates a copy of that file with a ~ at the end? For example, a file like HelloWorld.lua when run would create 2 files: HelloWorld.lua and ...
0
votes
2answers
56 views

Rename the bunch of files with a specific pattern

I have number of files with following name details.. 2007-07-22-2300-11S.NAN___024_ABI___HH_E_SAC Where: 2007-07-22 is date. 2300-11S is hhmm-sec. NAN___024 is network same for each file (not ...
1
vote
3answers
55 views

Merge several files on the basis of the md5sum

I have a file data.txt, which was divided into fragments. I need to properly combine fragments of files so that the original file was created data.txt. I do not know what kolejoności do this, because ...
7
votes
2answers
544 views

How to replace spaces in all file names with underscore in Linux using shell script?

I tried following shell script which should replace spaces from all xml files for xml_file in $(find $1 -name "* .xml" -type f); do echo "removing spaces from XML file:" $xml_file mv "$xml_file" ...
2
votes
3answers
46 views

Duplicate a file with random probability

I have a directly full of images and I am trying to put together a script/command that will randomly copy (with some probability) the image to a location with a random name at that destination ...
1
vote
4answers
65 views

Bash Command Get Data from multiple files and append the file name

I have in a folder (eg /tmp) the following files 1.id 2.id 3.id 4.id so on... In these files, there is one number inside. For example in 1.id it can be the 1000, in 2.id it can be the 2000 etc. I ...
0
votes
1answer
23 views

Get total size of a list (containing HTTP links)

I have a file containing a list of files on the web, and I would like to know the total files' size (in human-readable format) and check their availability. Is there a command/solution to do so? P.S. ...
4
votes
2answers
96 views

Adding column based on matching of second column

I have two files. The first file has the following format: 10D0325 2465 0 0 -9 -9 10D0598 2567 0 0 -9 -9 10D0562 2673 0 0 -9 -9 10D0175 2457 0 0 -9 -9 10D0241 2209 0 0 -9 -9 10D0954 2312 0 0 -9 -9 ...
5
votes
2answers
85 views

Allow owner to create & read files, but not modify or delete

I would like to give a user permissions to create and read files in a particular directory, but not to modify or delete files. If the user can append to files that is ok, but I'd rather not. This is ...
1
vote
3answers
193 views

How to add an attribute in a tag in XML file by command-line?

I am trying to add field at the end of tag using sed script. Suppose I have a tag in XML file: <book name="Sed tutorial" price="250"/> Now I want to add field as Book_Width="A" after end of ...