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

learn more… | top users | synonyms (1)

0
votes
1answer
12 views

Have to transform some bunch of csv in req format and store it in some other location with same name

I am having some input CSV files INPUT_FILE: A_B_C_NFM001_20150729.csv A_B_C_NFM002_20150729.csv A_B_C_NFM003_20150730.csv I want output file also with the same name as input after performing below ...
0
votes
4answers
57 views

piping commands not working as expected I need explanation

I am trying to do the below touch ~/scratches/scr6.txt | cat ~/scr.txt > ~/scratches/scr6.txt | cat /dev/null > ~/scr.txt I don't know why scr6.txt is always empty, however doing the below ...
0
votes
2answers
35 views

Rename specific level of sub folders

I have list of sub folders inside a parent folder as follow: Parent folder folder1 foldera folder2 folderb folder3 folderc I want to rename the subfolders only in ...
0
votes
0answers
10 views

Failed to change last modified date of the file after do some edit in /var/www

on ubuntu server (14.04) I have a virtual host which is in /var/www and my linux user is group of www-data. But I noticed that, if I change something on a file in /var/www last modified date does not ...
1
vote
0answers
6 views

Get “recent files” in global file manager (Dolphin?)

I just switched to OpenSUSE (KDE) from my Fedora 20 KDE setup,and I find myself greatly missing a feature that was a default in Fedora: a "Recently Used" option in the file manager when saving and ...
0
votes
1answer
30 views

find and replace with the value in another file

I have two files with different formats with columns tab spaced. I have to compare the columns column1, column2 of file1 with file2. If they matches, I need to replace the value in column6 of file1 ...
0
votes
3answers
44 views

How do I create a directory for every file in a parent directory

I have parent folder and inside this folder I have 4 files ParentFolder File1.txt File2.txt File3.txt File4.txt I wanted to create subfolders inside the parent folder and ...
-3
votes
0answers
21 views

File layer (want to get requested filename) [on hold]

Imagine that there is running application that wants to read a file from working directory. When it happens I want to get a name of requested file and check if it is existing in specified directory, ...
0
votes
3answers
61 views

Get recursive file count (like `du`, but number of files instead of size) [duplicate]

Since I'm having performance problems with rsnapshot, I'd like to identify directories with great number of files recursively. I think the problem is not the size of the files, but the file count in ...
1
vote
2answers
14 views

Getting a list of files modified after an apt-get upgrade or intstall?

I would like to run AIDE or tripwire to make sure executables/configuration files/... do not get modified by malware. Or at least notify me if they do get modified. I would like to get a list of ...
4
votes
4answers
247 views

Remove a directory from inside using the command line interface [duplicate]

Imaging the next simple file structure within the /home/user/ directory: /home/user |--dir0 |--dir1 |--file1 My current directory is 'dir1' and I remove the ...
0
votes
1answer
30 views

Scanning user directories for specified file [closed]

i want to find all files in /etc/passwd called cat.sh and then outputs the timestamp and * of entries. I was thinking of using grep -l "cat.sh" * | wc -l
1
vote
0answers
20 views

Can I make cross-computer sharing compatible with tinfoil-hat security (password managers, email, etc.)

Preface: I realize the following is asking for tinfoil-hat type security, but I'm really curious for answers to my questions -- not suggestions to enable two-factor logons on gmail, etc. and call it a ...
2
votes
2answers
311 views

unix file is corrupted [closed]

I discovered that one of my logs consumes lots of space which comes from a running process. I wanted to clean this file, so I can run logadm to rotate it after. but I don't know how # ...
0
votes
0answers
12 views

What permissions apply if specific user's permission on file or directory differ from user's group to which this user belong to in Linux? [duplicate]

Case 1: User has "rwx" permissions to certain file or directory. But has no permissions "---" in group it belongs to. Question: who wins - Does user have "rwx" or "---", effectively (not what's ...
6
votes
4answers
565 views

How to print the name of missing files in a folder?

I have 2000+ files in a folder, but there are few files missing from the folder. Name of the files are like GLDAS_NOAH025SUBP_3H.A2003001.0000.001.2015210044609.pss.grb ...
-6
votes
1answer
52 views

Delete Huge file in linux

I would like to delete a large file in my server. It's very large nearly more than TB's. What is the best way to delete that huge file ???
0
votes
0answers
16 views

Is there a way to change file/folder ownership on a server in Ubuntu/Kali-Linux? [migrated]

I accidentally changed file ownership of a folder in Windows 7 and now nobody can edit, copy, view, move it, etc. Not even the administrator account account can change it back. I tried icacls and ...
0
votes
1answer
52 views

find files in a folder

I'm trying to make a FIFO script that keeps deleting files when disk usages reaches a limit. I have used the find command so that number of files wont be a limit to run the script. But I get an error ...
0
votes
0answers
31 views

why this file not modifying? [closed]

sed -i "s/'${line[*]}'/'${newlinem[*]}'/" test2.txt I'm trying to replace whole line of my text file with new modified line. but my file not modifying with sed -i Both the above arrays are working ...
4
votes
1answer
117 views

Undeletable directory

Everything I've tried (always with superuser privileges) has failed: # rm -rf /path/to/undeletable rm: cannot remove ‘/path/to/undeletable’: Is a directory # rmdir /path/to/undeletable rmdir: failed ...
2
votes
3answers
75 views

Modify multiple files in different folders with one command?

I have a file abc.txt in the folder /etc/zyz/ and also in a few sub folders /etc/zyz-1/ /etc/zyz-2/ How can I modify all of those files with a echo command for example (all named abc.txt) in every ...
1
vote
2answers
35 views

Piping contents of multiple files between programs while keeping contents separate

I would like to read in a number of files and pipe their output to subsequent programs while still maintaining them as individual pipelines of data. program1 *.txt | program2 | program3 folder I ...
0
votes
0answers
18 views

Get mutt to open files >2G

According to the very likely sounding answer to How to access and manage a large mailbox (11 GB) I need to use mutt to open the large mailbox. However the 2G limit was supposed to have been removed ...
2
votes
1answer
45 views

How to create gcov files for a project in a different dir?

I want to analyze code coverage datas. I want to create gcov files from OpenSSL (and from other projects), but I can only create them in the same directory of the project, and only for the files in ...
2
votes
3answers
86 views

Monitor processes trying to access non-existent file or directory

We're moving websites from one server configuration to a new configuration and the websites will live in different paths than previously. We're planning to diligently go through and replace old paths ...
3
votes
1answer
45 views

How does `lsof` keep track of open file descriptors' filenames?

I've noticed, if a file is renamed, lsof displays the new name. To test it out, created a python script: #!/bin/python import time f = open('foo.txt', 'w') while True: time.sleep(1) Saw that ...
1
vote
1answer
33 views

How do I find directories where none of the files inside have been accessed in a year?

I have a tools directory /tools/tool_name that has hundreds of releases of the tool inside. I am trying to find an easy way of knowing what releases can be archived. Is there an easy way of finding ...
-5
votes
1answer
65 views

Find the number of files with sizes

Find the number of files with sizes > 100KB in /, /bin, /usr, /usr/bin and /usr/sbin directories and output them in a two column format with the name of the directory and the number of files.
2
votes
5answers
91 views

Change strings in multiple files to current subdirectory name

I have several directories each containing a file containing this line: ../a_a_q1.out ../a_a_q2.out ../a_a_q3.out I would like to loop through all the subdirectories, and change the a_a part to the ...
-1
votes
1answer
16 views

Daemon opens a file in RO mode only

I am trying to write a kind of keylogger myself. I don't know if my logic of developing a keylogger is good or not but I have thought of doing it the following way. First a daemon is created, and to ...
2
votes
1answer
52 views

Continously writing terminal output to text file

I am running a small cli python app in terminal. It loops infinitely and outputs text to the terminal. I want to output the text to a file, and I can do that with the following command python [my cli ...
4
votes
3answers
123 views

How to copy recursively and change file names to be unique

I have a large tree containing a lot of photos on an external drive that was formatted with one of the linux filesystem types (don't remember which one). It's mounted on my mac and I'm trying to copy ...
1
vote
2answers
68 views

What is the file permission of /etc/shadow in CentOS?

What is the default file permission of /etc/shadow in CentOS? Is there any difference in the default file permission of /etc/shadow in previous versions of CentOS?
5
votes
2answers
59 views

`sudo cp -a` changes ownership to root (instead of preserving the original user)

I was trying to backup some directories and some of the copies made by sudo cp -av resulted in being owned by root while others preserved their attributes. Is this a known issue or am I missing ...
2
votes
1answer
29 views

How to create a zip of directories -mtime -150

I want to zip the directories, sub directories, files in main and sub directories from today till 150 days ago. I only consider the date of the directories where I am running the command, no matter ...
2
votes
4answers
268 views

Replace regex match with string containing match

I have a file with text as Afghanistan=+93 Albania=+355 Algeria=+213 American Samoa=+1 Andorra=+376 Angola=+244 It has all the country list and its dialing code. I want to replace: ...
1
vote
4answers
51 views

How to move all files (excluding sub-directories) from one directory to another?

How do you move all the files (excluding sub-directories) from one directory to another. I'd prefer if the solution used just basic shell scripting.
0
votes
1answer
21 views

Using imagemagick to crop video

I want to crop a video that I have in yuv format using imagemagick. I am using the following command: convert -size 1280x720 my_clip_1280_720s.yuv -verbose -crop 352x288 +repage my_clip_352_288.yuv ...
3
votes
0answers
10 views

Get consistent encoding for all files in directory

I have a directory containing lots of csv files from various vendors with two different encodings: ASCII Text / UTF-8 UCS2 / UTF-16 little endian I'd like to use grep, awk, sed and other utilities ...
0
votes
3answers
63 views

What is the difference between a directory name that ends with a slash and one that does not? [duplicate]

Is there any difference between a directory name such as mydirectory and mydirectory/ I noticed this happens when I execute ls in some directories - some of the directory names have a slash and ...
2
votes
2answers
89 views

How to remove a file that can be seen but no program can seem to touch?

I'm trying to remove some obsolete backups, and deep inside one I've found a file 'cifs3bee' that I can find no way of removing. (And since I can't remove it, it's preventing the removal of the entire ...
0
votes
2answers
52 views

Merging large data set in fastest possible way

I have a large data set ~100 GBs having smaller csv files ~ 100,000. I wish to merge all .csv files together in the fastest possible way. Files are located in two different folders. Someone ...
1
vote
1answer
32 views

What are the default file permissions in CentOS?

What are the default file permissions in CentOS 5, CentOS 6 and CentOS 7? Is there any difference in the default file permissions between these OSs?
1
vote
4answers
190 views

change last 10 characters of the base (not extension) of multiple files

I have many files of different lengths but the same extension and I have tried many commands to rename all of them at once. Is it possible to change only the last 10 characters of the base of all ...
0
votes
0answers
62 views

extract text to csv file from output of reading multiple files into specific rows

I am trying to write a bash script to generate a csv file from text within multiple pdf documents. I have a script for converting pdf to text, but not for generating the csv file. Each text document ...
18
votes
7answers
2k views

Why compute checksums of downloaded files?

I often see a checksum given next to a file available for download. The purpose of this practice eludes me. It is obviously to detect corrupt files, but what could be the cause of this corruption and ...
0
votes
1answer
60 views

Operation of “mv” described in “Advanced Programming in the UNIX Environment”

In Advanced Programming in the UNIX Environment (book) Section 4.14, interpret the i-node and directory, there is a paragraph: When renaming a file without changing file systems, the actual ...
3
votes
7answers
156 views

for loop in bash lists dot and double dot folders [duplicate]

for f in ~/common/.*; do echo $f done The entries listed are, /home/sk/common/. #undesired /home/sk/common/.. #undesired /home/sk/common/.aliasrc And i am putting a ugly ...
-3
votes
1answer
41 views

Create five copies of file with the same inode number

How can I create five copies of /etc/profile with the same inode number?