3
votes
1answer
42 views

How does `stdin` of linux work?

I know that stdin refers to standard input in linux, usually the keyboard. It can also be referred by file descriptor 0. So, which file descriptor does the (standard input) mouse refer to? Or is it a ...
5
votes
2answers
125 views

File handles and filenames

I read this post. Are file descriptors the same as file handle? While trying to configure the linux kernel, it asks open by fhandle syscalls (FHANDLE) [Y/n/?]. Why is this option provided? Does ...
1
vote
0answers
19 views

Recover deleted files on Raspberry Pi? [duplicate]

So I just rm -rf'ed a folder with a few files I need. Yes I know I should've had a backup, but it's just a Pi. It's designed to be played around with! Is there anything I can do to recover that ...
4
votes
1answer
115 views

FILE size limitation according to Robert Love's textbook

From Robert Love's Linux System Programming (2007, O'Reilly), this is what is given in the first paragraph (Chapter 1, Page 10): The file position’s maximum value is bounded only by the size of ...
3
votes
1answer
54 views

Monitoring filesystem activity

Say, I have a program, and I want to monitor its filesystem activity (what files/directories are created/modified/deleted etc.) This program may be capable of spawning further processes, and thus, I ...
0
votes
1answer
27 views

setfacl remove all write access

I want to remove all write access to files & directories for any user or group while preserving other permissions. Is this possible?
0
votes
1answer
62 views

How do I create a RAM disk on Linux Mint?

I am running a package that adds data to the end of 140–300 files each time through the process. I'm thinking of moving the process to a RAM disk, and using rsync to copy it back when done. My goal ...
3
votes
1answer
106 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 ...
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: ...
14
votes
3answers
541 views

Move files and change ownership at the sametime

On Linux (Debian, Ubuntu Mint...), Is there any option command or something that I can use to transfer files to another user without having to do : sudo mv /home/poney/folderfulloffiles ...
1
vote
1answer
106 views

File has bytes - appears to be empty

I'm having the following problem: Some text files (also some binary files) on my system are listed with the correct file size but when I open them, they appear empty. >ls -la -rw-rw-r-- 1 user ...
2
votes
2answers
153 views

How to edit /etc/inittab?

I want to edit /etc/inittab in order to get a login prompt on the serial console once the system boots. By default, inittab file complains to be ro. I tried both gksudo gedit /etc/inittab and sudo vi ...
2
votes
3answers
297 views

How to recover from recursive 'chmod -x' on my home folder

I pressed ENTER after typing the following stupid command on my home directory: find . -type f -exec chmod -x '{}' ';' What do you advise as a fix for this. My guess is that I can't do anything but ...
5
votes
2answers
204 views

Difference between xattr and chattr

What is the relation and the difference between xattr and chattr? I want to know when I set a chattr attribute in Linux what is happening inside the Linux kernel and inode metadata.
4
votes
3answers
215 views

Hidden Files&Directories in user's home directory [closed]

I am in my user's home directory, I do: ls -a Then it shows me large number of hidden files and directories in my user's directory. Which of them I am allowed to remove? Which ones are necessary ...
4
votes
1answer
827 views

Changing a file's “Date Created” and “Last Modified” attributes to another file's

I'm using merge cap to create a merge pcap file from 15 files. For the merged file, I have changed the name to that of the first of the 15 files. But I would also like to change the merged file's ...
3
votes
4answers
140 views

Removing file which doesn't have any permissions and attributes

I have a file on my external hard disk named ._Icon^M.I ended up with this after using my hard disk on old Mac platform machine. I want to delete this file but unable to. For the command 'ls -al' it ...
3
votes
3answers
80 views

Why are file handles a scarce resource?

I feel like every tutorial I read on resource management in server settings starts by asserting that file handles are a scarce resource, and we should therefore aim to keep the list of open files to a ...
3
votes
3answers
246 views

Transform a directory into file or a file into directory

I wanted to create a file named test. Accidentally I run mkdir test instead of touch test. Is it possible to convert test directory in a file named test? What about converting a file named test into ...
0
votes
2answers
91 views

Make file in linux readonly

Is there a way to make a file readonly permanently in linux. Or can I put a password to a file to make it readonly, then apply that password again to change its permission, or before they can alter ...
5
votes
1answer
336 views

Cannot delete broken symbolic link

I have a symbolic link formerly pointing to a Dropbox directory. I don't know what I did wrong, but apparently now it points to itself. hyper@mypi:/home/hyper/test$ ls -l total 1024 lrwxrwxrwx 1 ...
3
votes
1answer
510 views

File inheriting permission of directory it is copied in?

I have files created into my home directory with only user read permission (r-- --- ---). I want to copy this file to another directory /etc/test/ which has the folder permission of 744 (rwx r-- r--). ...
4
votes
2answers
97 views

In Linux Fedora, How can I select files to move by time interval

How can I select and move files that were written in a specified time interval, such as 1530 to 1730 local time on a recent date? Background: I use Linux Fedora 12, and I have made my first, and long ...
1
vote
2answers
61 views

Something like a symbolically linked file, but with change details attached?

Is there a file type or method for using files in which certain files look and behave like symbolically linked files, but contain extra meta information for changing the data when they are read? ...
1
vote
1answer
90 views

Monitor file access count by user

I have written a script which is deployed just by putting it in a globally accessible location for all users. I want to log the usage of this script. Is there a way in Linux to find out how many ...
1
vote
1answer
72 views

How to FILTER the files with filename and then DELETE the OLDEST file from there? [duplicate]

I create and keep the following automated backup files e.g.: fruits_29-12-2013.gz fruits_30-12-2013.gz fruits_31-12-2013.gz sweets_01-12-2013.gz sweets_02-12-2013.gz sweets_03-12-2013.gz .. ...
2
votes
2answers
68 views

Why can users delete each others files in this case

I have two users : bob and sally, who resepctively own two files : bob100 and sally100: > ls -altrh /path/to/dir : -rw-r--r--. 1 bob test 0 Jan 7 12:59 bob100 -rw-r--r--. 1 sally test 0 ...
3
votes
1answer
156 views

file corresponds to /proc/locks

$ cat /proc/locks 1: POSIX ADVISORY WRITE 458 03:07:133880 0 EOF 2: FLOCK ADVISORY WRITE 404 03:07:133879 0 EOF The fields are: ordinal number(1), type(2), mode(3), type(4), pid(5), ...
2
votes
1answer
407 views

Error: permission denied on key 'fs.file-nr'

# sysctl -w fs.file-nr=131072 error: permission denied on key 'fs.file-nr' Same issue when I edit /etc/sysctl.conf and try sysctl -p. Any reason why I cannot edit this value? I am on CentOS 6.5
-3
votes
1answer
36 views

Blacked out html folder in root directory [closed]

Just looking through my system's directories and wondering about some of the contents. There is a blacked out (inaccessible) directory called html. I'm thinkging this is a bad link? I'm guessing and ...
4
votes
2answers
214 views

File access time not updating in ubuntu 12.04

After using the cat command to read a file, I used the stat command to view it's changed access time, but it's not getting updated. I checked /etc/fstab file and there is no noatime on any of my ...
1
vote
0answers
85 views

Map invalid file paths to valid file paths

I am running a program on linux which access an invalid location, say: /home/area/file. I know the valid location is /home/area/something_else/file. The problem is the input file for this program is ...
3
votes
2answers
81 views

Is there any mitigation against touch date/time forgery?

I have been using touch -t to change time of a file when I started using Linux, is there any mitigation against touch date/time forgery? Like, echoing original created date and time, even after using ...
3
votes
2answers
96 views

How to figure out what changes to which files a given command does, or even intercept them?

Say I've got a program mysterion the execution of which will probably modify some files. In order to figure out whether this is harmful or not I'd like to run it in such a way that I can at the very ...
5
votes
1answer
105 views

How do I find the full history of a file?

I need to know the full history of a file, like if someone changed or moved it to some other places since the time when it is created.
3
votes
3answers
76 views

Disallow File IO for a process except for FIFOs

How do you start a process that cannot do any file IO (opening / closing files, creating / deleting files, reading / writing files, etc.), except to read and write to pre-created FIFOs? (chroot will ...
4
votes
1answer
57 views

Map file to URL

I'm looking for a way to do something like this: some_tool --go-to-background http://server.com/~me/uber_vimrc ~/.vimrc After which, reading ~/.vimrc would give the data downloaded from that URL. ...
2
votes
1answer
829 views

Zabbix-agent: cannot stat 'filename.log': [13] Permission denied

I have installed Zabbix-server and zabbix-agent and trying to add trigger to check log file. But in /var/log/zabbix/zabbix_agentd.log I got the same error every time: 10832:20131008:125634.180 ...
18
votes
5answers
12k views

How to find creation date of file?

I want to find out the creation date of particular file, not modification date or access date. I have tried with ls -ltrh and stat filename.
3
votes
3answers
147 views

Transforming text to tabular form

I have a text file with the following structure: aaa bbb ccc ddd eee fff 1 2 3 4 5 6 1.1 1.2 1.3 1.4 1.5 1.6 ggg hhh iii jjj kkk lll 7 8 9 10 11 12 2.1 2.2 2.3 2.4 2.5 2.6 and I want the ...
3
votes
3answers
1k views

How to determine how many files are within a directory without counting?

I've been having a fairly serious issue on a high traffic web server. PHP pages are slowing down considerably, and it only seems to be an issue on pages where sessions are accessed, or a certain table ...
3
votes
1answer
87 views

Files have the same inode but they don't link to each other

I have a bash script in two places and I can't remember how I created them. they have the same inode but none of them seem to link to another. is there a hard link but should not Links count for that ...
3
votes
1answer
423 views

viewing dll and exe file properties/attributes vi command line

I have a need to see some additional file properties for exe and dll files. If I open windows explorer and add the additional columns to my view, I can see things like Company, Copyright, Product ...
2
votes
1answer
70 views

Why do I get one more number of bytes reported in a file?

Why do I get one byte more reported? I do not have a newline at the end. I tested other files with similar result. Using linux 3.2. $ cat testfile.txt aabbcd $ wc -c testfile.txt 7 testfile.txt ...
3
votes
2answers
122 views

How to make directory modication date change when files from that dir change?

For example, if a file has been changed in that directory, then directory modification date should be updated. Basically any changes that happen in that directory should trigger a "touch" on the ...
3
votes
3answers
1k views

How can I revert a chmod on the etc directory?

I accidentally executed the following command on the etc directory: sudo chmod -R 700 /etc I know that I have done something very wrong. My terminal now prints: I have no name!@ubuntu: /$ How ...
2
votes
2answers
157 views

Understaning of diff output

I have file1.txt this is the original text line2 line3 line4 happy hacking ! and file2.txt this is the original text line2 line4 happy hacking ! GNU is not UNIX if I do: ...
5
votes
3answers
258 views

How can I get rid of this invisible file?

Background I have a folder named akorg✽. That Unicode character causes headaches for me when software makes incorrect assumptions about the text encoding of my file paths, so I'd like to remove it ...
3
votes
1answer
3k views

NFS permission denied

When I configure NFS and create a file on the client NFS shared dir, I get the following message: permission denied. My configuration: configuration nfs server ...
5
votes
3answers
277 views

Dynamic file content generation: Satisfying a 'file open' by a 'process execution'

I have a read-only file, F. A program, P, that I'm not the author of, needs to read F. I want the content of F to come from another 'generator' program, G, whenever P tries to read F (taking F to ...