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

learn more… | top users | synonyms (1)

1
vote
2answers
114 views

How linux know the type of the file it is dealing with? [duplicate]

In windows the OS know the type of file by using extension: exe,doc,ppt,pdf .... etc In Linux as we know that the extension is useless. My question is how can Linux know the type of file it is ...
0
votes
1answer
43 views

Partition is out of space

When I was trying to resolve the issue as seen in this question, I figured out that a specific partition is out of space. I have a specified folder which I allow all ftp uploading of multimedia files ...
2
votes
0answers
25 views

Image set compression

Is there a good open source (not exclusive to Linux) for compression of a set of similar images? I have thousands of documents scanned but I do not access them often. The documents are forms, with ...
-2
votes
2answers
38 views

Clarification on permissions with GID & UID in UNIX

If Test1 & Test2 are users, then Test1 : UID : 501, GID :501, groups=501,100 Test2 : UID : 502, GID :502, groups=502,100 What will be the correct option from below and explain how? Test1 ...
3
votes
1answer
105 views

Automatically detect when a file has reached a size limit

I would like to send an email when a file reach a certain size limit. The only way I thought of doing this is by doing a cronjob which will check the file size and send the email if the file is ...
1
vote
1answer
47 views

How to Test if a file has characters in it?

So i have a part of this code and U want it to output "No such player" if only the names file is empty, i've tried using the test -s command but it gives an output of 0 even if the file is empty or ...
1
vote
1answer
52 views

How to install a .bin file that gives the error that it needs more space in /tmp?

Here is the error: ~]$ ./jdev_suite_121200_linux64.bin 0%....................................................................................................100% Not enough disk space in dir ...
3
votes
1answer
69 views

How unique are checksums?

I have a lot of files I need sorting; and sadly there are many files with the same name but different content, and there are the same content with different filenames. I'm thinking about using md5sum ...
0
votes
1answer
30 views

Why does “file foo.css” and “file bar.css” have different outputs?

For example, executing file styles.css outputs: styles.css: asssembler source text whereas file bar.css outputs: bar.css: ASCII text Even better, is there a way to convert my file styles.css to ...
1
vote
1answer
52 views

linux command stuck

I have strange problem on my Linux machine When I do the following simple command chmod +x /tmp/file chmod is stuck and not returned the prompt what could be the problem? the same issue when ...
1
vote
1answer
41 views

With mv, possible to put a time dependence on files mv'ed?

Let's say there's a specific time and date I have in mind. All files last edited before this date I want to keep in the directory but all files that have been edited since this date I want to mv ...
3
votes
1answer
64 views

Two users with different permissions on same directory

Is it possible to give two users different permissions on the same directory? I want to use it for ftp: userFull gets R+W and userLim gets only Read, depending on who logs on. Im getting stuck on the ...
1
vote
1answer
113 views

Unreadable backup directory on a USB drive

The title pretty much sums it up. I was editing a script I wrote some time ago to automatically backup the contents of my Raspberry Pi SD card, and in the course of editing, I missed a "/", and so ...
1
vote
1answer
38 views

Is there a command which creates a temporary file containing the arguments passed to it?

I can paste the contents of a file into a command using cat and backticks: ls `cat filenames` Is there a way to do the reverse - to turn a string into a (temporary) filename? gcc -o cpuburn `uncat ...
2
votes
2answers
113 views

find the single largest file

We host a share of size 4 TB. How efficient is it to find a file with highest size. Usually we use: du -ak | sort -k1 -bn | tail -1 and it is not easy to scan through a share of such huge size and ...
7
votes
6answers
490 views

How can I get a specific line from a file? [duplicate]

I want to extract an exact line from a very big file. For example, line 8000 would be gotten like this: command -line 8000 > output_line_8000.txt
4
votes
2answers
123 views

Is it possible to prevent files created being world-readable?

Assume a user uid=1000 and guids=1000,33,277 is allowed to create a file in the folder /files/. Is there any way I can prevent that the this user allows others to read the file (which are not at least ...
1
vote
2answers
78 views

Create file with specific formatting from directory contents

I am using Solaris and csh. In $home/test there are five files: a.txt, b.txt, c.txt, d.txt and e.txt. If I run % find $home/test/ -type f -print > ../filenames.txt that file will look like: ...
1
vote
7answers
696 views

Can grep be used for searching files with some string in their names?

I understand that grep can only be used for searching for files which contain a string in their content. Can it be used for searching for files with a string in their names? I read the manpage, and ...
0
votes
0answers
42 views

How to mount multiple iSCSI images too loop

I have to mount iscsi images to loop. Yesterday someone with a similar problem asked that already. The difference is, my iscsi image is splitted into 5 parts. ls -la insgesamt 4718592004 -rw-rw-rw- ...
4
votes
1answer
64 views

mapping a split file to /dev/loop0

I have a iscsi disk 2TB large. I make backup of that disk every week. The backup script copies the image of the whole iscsi disk into a file on my NFS. Unfortunately, it does not copy the image in one ...
4
votes
2answers
62 views

setting default permissions with setfacl

I am trying to set default permissions on my directory structure using acl. I would like to have following default permissions for directories and for files respectively: drwx--x--- -rw-r----- but ...
0
votes
1answer
54 views

Move Data from Partition to Partition on Same Drive

Moving data from one drive to another is slow. Copying data on a drive to it's self is slow. Moving data from one drive to it's self is fast. If I'm moving data on the SAME drive but a different ...
1
vote
2answers
142 views

Find when the file was closed in Unix

I know ls -l will give the modified time of file, but it is giving the time when the file was opened, not closed (using Ctrl+D or something) Please tell me how to find the time of file closed ...
0
votes
0answers
57 views

Strange issue with xml_split in Linux

I am using the code xml_split from https://metacpan.org/pod/distribution/XML-Twig/tools/xml_split/xml_split to split a huge XML file. I am facing a strange issue with this. First, I tried the ...
1
vote
0answers
43 views

How do I make get-iplayer produce watchable quality without huge filesize?

Summary findings: I'm using get-iplayer v2.82. The files I produce on hard drive are all mp4. I've discovered the following (downloading same TV program in both cases): Using --modes=flashstd and ...
2
votes
1answer
116 views

allow user access via ssh to /var/www/

Context: I am creating a gitolite3 hook for a specific repo, which contains some logic and css foo of my website. so what essentailly happens is Content under /var/www/nginx/ looks like: ...
3
votes
1answer
75 views

Help with giving group permissions to other user's files

I'm a linux beginner using Debian 7 and have created a new user (a website) with an htdocs directory like this: $ sudo adduser website $ sudo mkdir -p /home/website/htdocs $ sudo chown -R website ...
2
votes
1answer
73 views

Can one directory be owned by two groups?

Can one directory be owned by two groups (RHEL 6.2)? I have created one directory: mkdir /opt/shared, then I created two groups: groupadd sales groupadd marketing I added manually to each of ...
3
votes
1answer
44 views

Does du or df perform caching?

I was wondering if there is any caching done with these utilities. I assume not, but not positive. Are there any typical similar utilities that do use caching to speed up results on subsequent runs? ...
1
vote
2answers
31 views

Store a file for all users within a group

If user A is member of group foo, is it then possible for A to share a file for all members within foo without root permissions? chown foo:foo file Is not permitted without privileges. A can say ...
5
votes
6answers
575 views

About the .file and ./directory confusion

This is a dumb question, but I recently moved from windows to linux, and I see one strange thing: ./configure or nano /something/something2 Is this something2 a file? It looks like a directory, ...
6
votes
2answers
245 views

Copying one file to multiple directories

I have a file that I want to copy to another 60 directories. The best way I can think of doing this is by making a bash script that has instructions to every folder like this: cp script.sh ...
2
votes
1answer
77 views

Move extension-less files with mv

I have a folder with images(png, bmp, jpg) and extension-less files. I cant figure out how to move only the extension-less files. They are all random numbered files.
1
vote
1answer
57 views

grep file from file

What is the fastest way to grep -v a file against another one, both line by line. does grep support this ? Or should I use it on two for loops ?
0
votes
0answers
69 views

Editing metadata with bash

I have a bunch of photos(jpeg, bmp, png) that I have arranged in such a manner that the metadata is in html form in a separate file. I would like create some script to read this html file and edit ...
4
votes
4answers
217 views

Delete all files in a directory whose name do not match a line in a file list

I have a directory with 1000+ files. In a text file, I have about 50 filenames, one per line. I'd like to delete all the files in the directory whose filenames don't correspond with an entry on the ...
0
votes
0answers
40 views

Unable to make file system writtable no matter what

I have a flash card SanDisk of a camera which I plug in into my computer: $ lsblk mmcblk0 179:0 0 3.7G 1 disk └─mmcblk0p1 179:1 0 3.7G 1 part $ mount /dev/mmcblk0p1 on ...
2
votes
2answers
227 views

Unable to remove the files from an usb drive (neither by dd /dev/zero nor by rm -r)

I have a flash usb drive and up till now it has worked well. Recently I recorded iso to it using dd. Now I want to delete it. $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT ....... sdb ...
3
votes
3answers
80 views

stout can not append to large files

I have Ubuntu 13.10. I have a keylogger to help me remember what I did. Running keylogger prints output to the terminal when I run it like this: keylogger I added it to startup like this: ...
5
votes
3answers
277 views

tail -f, Determine if a file is no longer being written to [closed]

I am using tail -f to follow the growth of a log file. I am having trouble finding a way to detect if the process that is writing to the log file (when it crashes or is otherwise terminated) is no ...
1
vote
1answer
87 views

temporarily disabling one's own filesystem write permission

I can't believe there is no simple solution to this (because it seems potentially a very useful feature to me), but so far I couldn't find any. I'd like to be able to (temporarily) turn off my own ...
5
votes
2answers
103 views

Why does a grep reboot the machine?

On a RHEL 6.5 Desktop, if I use: sudo grep -r foo /* my desktop reboots. Q: Why?? How to debug this? It's the third time my Desktop reboots because of this :D
-1
votes
2answers
61 views

Split files and rename the files

I need to split a large file into 5 pieces and rename them. For Example, file Test needs to be split into Test1, Test2 & Test3. However, the split command splits as xaa,xab,xbc.
-1
votes
2answers
161 views

FTP clients only showing 9998 folders in a directory with many more

How can I increase the limit of files or folder in linux? Right now when I use any ftp software it shows that there are only 9998 folder in that directory. But I ran a simple php script that would ...
1
vote
1answer
93 views

How do I `avconv` every m4a in a dir to mp3s?

So I'm trying to convert lots of m4as to mp3s, and I think the best way to do that is using avconv. The problem is, I can't seem to find any solid examples on how to use avconv. Looking at the man ...
1
vote
1answer
120 views

Difference between cat * and cat * >>

To merge multiple files in a dir I have tried: cat * myfile.log but this seems to just merge line and line and is thus very slow So using instead: cat * >> bigfile merges the files much ...
3
votes
1answer
59 views

How does the system know when a file has been modified? In particular memory mapped files

If I am looking at a process from outside the process how can I tell which files it modifies? One thing I can do is track calls to write, but a process can map a file to memory and write to the ...
4
votes
2answers
88 views

modify file ownership for files inside tar archive

I am working as user, and I would like to create a tar archive, which when unpacked (by root) will extract its files with root ownership (otherwise root would have to change the ownership manually for ...
5
votes
2answers
128 views

Remove Linux directories containing ONLY old files

We have numerous directories that each contain 2 files, one of which is a hidden file. We want to remove all those directories and their contents that contain ONLY files that have a modification date ...