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

learn more… | top users | synonyms (1)

-2
votes
1answer
71 views

Undo a mass rename of files in a directory?

So I tried to use this script to get rid of a username in a bunch of files #!/bin/bash ls | while read -r FILE do mv -v "$FILE" `echo $FILE | tr '[DarkDream]' '.' ` done Instead, all of the ...
1
vote
1answer
23 views

How to share a file over “Windows Share” protocol from scientific linux?

I have a file on my linux. I want to share it via "Windows Share" (IPMI can understand only one way of remote large files mounting). How to share my file over "Windows Share" from my scientific linux? ...
0
votes
1answer
18 views

Special file descriptors

In shell scripting, are any file descriptors other than 0, 1 and 2 special in any way? The flock manpage has the following example code: ( flock -n 9 || exit 1 # ... commands executed ...
2
votes
5answers
70 views

Extract a single file from a zip file only knowning the extension

Hi my first part of the requirement: I like to extract a single file from ex1234.zip. The structure and contents of ex1234.zip: ex1234 (directory) directory1 ex1234 (directory) ...
0
votes
1answer
27 views

ls displays files copied from an external drive with a yellow background

I copied some files from an external drive and now they appear with a yellow background under my ZSH shell on OSX. I believe that its a permissions thing as the normal ones display "drwxr-xr-x" and ...
1
vote
1answer
30 views

How to keep the file in RAM

I have a laptop with Linux Slackware. When it's working on battery saving a file to hard drive takes around a second. When I'm writing code I waste a lot of time saving the files. I have about 2 GB ...
1
vote
1answer
32 views

Form a output by combining multiple lines

I have a log file as below: /export/home/got/logs/o2877612.01:job_1432787863184_159408 Message: org.apache.pig.backend.executionengine.ExecException: ERROR 2118: Input path does not exist: ...
0
votes
1answer
19 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
71 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
40 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
17 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
1answer
23 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
69 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
46 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 ...
0
votes
3answers
80 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
21 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
275 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 ...
2
votes
0answers
25 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
324 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
594 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
71 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
1answer
57 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 ...
4
votes
1answer
129 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
84 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
38 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
21 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
73 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
95 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
56 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
35 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
68 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
95 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
19 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
61 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
144 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
91 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
67 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
32 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
280 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
56 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
34 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
18 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
68 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
96 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
54 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
38 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
199 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
89 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 ...