0
votes
0answers
50 views

Question. How to write a Shell script? [on hold]

I need to write a script which could read information from txt file. In that txt file should be 3 words. When Script has to make 3 different directories with those words and two of them should be ...
14
votes
3answers
447 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
80 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
47 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
239 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
112 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
118 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
207 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
114 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
64 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
218 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
54 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
113 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
88 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
72 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
50 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
62 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 ...
2
votes
2answers
66 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
71 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), ...
1
vote
1answer
223 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
35 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
117 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
74 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
74 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
92 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
70 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
51 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. ...
0
votes
1answer
527 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 ...
16
votes
4answers
6k 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
138 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
858 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
80 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
275 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
50 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
102 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
673 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 ...
1
vote
2answers
103 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: ...
4
votes
3answers
209 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
2k 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
211 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 ...
3
votes
1answer
656 views

how to keep file owner same for newly created files

This question is regarding samba file access. I have created a folder A, and under folder A created two folders B and C. And also created three users A, B and C. User A has access to all three ...
26
votes
2answers
1k views

Why does a software package run just fine even when it is being upgraded?

Say I am running a software, and then I run package manager to upgrade the software, I notice that Linux does not bring down the running process for package upgrade - it is still running fine. How ...
2
votes
2answers
307 views

Delete whitespace in filenames in directory

I have a directory where some filenames have been wrongly named something .pdf rather than something.pdf. Is there a quick one liner I can use to delete the whitespace in the filenames. I have tried ...
1
vote
4answers
71 views

Is there a robust way to cache contents of usb on local hd?

I'd like to switch between working on a laptop with a debian vm and a desktop pc running debian while carrying all my work files in a usb. Is there a robust way to automatically start caching the ...
8
votes
2answers
293 views

Cleaner way to delete files on Linux which include a datestamp as part of file name

I have a new requirement to purge MySQL dump files that are older than 30 days. The files use a naming convention of "all-mysql-YYYYMMDD-HHMM.dump". The files are located on SAN mounted file system, ...
1
vote
2answers
279 views

Cannot access any files Manjaro Linux

I cannot open any files on my Manjaro Linux laptop. I really can't remember why it happened but I restarted my computer and now I dont have read/write access to any folder or file even though I've ...
19
votes
2answers
1k views

How do I make a file NOT modifiable?

While logged in, I can do the following: mkdir foo touch foo/bar chmod 400 foo/bar chmod 500 foo Then I can open vim (not as root), edit bar, force a write with w!, and the file is modified! How ...
-1
votes
2answers
292 views

What is sources.list?

I know sources.list is a file that contains a list of HTTP links pointing to some software downloads. I would like to know more detailed explanations and various conventions followed in the ...
0
votes
1answer
138 views

How hardlink and softlink works in background?

I am looking for an explanation of the following: what happens in Linux when we create soft link and hardlink how are they accessible why do symlinks always display 777 permissions