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

learn more… | top users | synonyms (1)

3
votes
1answer
25 views

How to find the file corresponding to a pipe opened by a process? [duplicate]

I created this script, which listens for characters received on a hardcoded pipe, and tries to eval those characters. I call my script loop_executor.sh This is all it contains: !/bin/bash while : do ...
2
votes
1answer
37 views

How can I encrypt a file?

I would like to download some files from my server into my laptop, and the thing is that I want this communication to be as stealth and secure as it can be. So, far I came up using VPN, in that way I ...
0
votes
0answers
27 views

Delete a file in GSX Trade Guide

I have HP-UX System as a Backend and Trade guide from Gxs.com as Front end. I'm able to delete a .byp file in the back end. However deleted files are not reflected in the Front end Trade Guide. By ...
6
votes
2answers
986 views

What is the result of running `chmod 7` on a file?

I know chmod 777 allows read, write, and execute for user, group, and others but what if I just do chmod 7? Is that only rwx for the user?
0
votes
1answer
24 views

What has priority - owner/user vs group permission? [duplicate]

I have just run into the case in which the owner-group of a file has more permissions than the owner-user of a file. user1@pc:/tmp$ ls testfile -l ----rw---- 1 user1 user1 9 Okt 16 13:16 testfile ...
0
votes
1answer
17 views

file command to show “for GNU/LINUX 2.x.x” also for shared libraries

Using the command file my_executable_binary I get information like this: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.34, dynamically linked (uses shared libs), stripped ...
1
vote
0answers
16 views

Configuring group access across a LAN

I have created a group called engineers on two VMs on the same 192.168.56.0/24 LAN. Is there any way the members from VM1 in engineers can view files created by engineers from VM2? I was thinking of ...
1
vote
0answers
28 views

Can Linux be configured to wait for USB storage to be reattached instead of returning I/O error

If a usb_storage device is physically detached from an Ubuntu machine while it is still mounted, any attempt to access the file system will produce an I/O error. Is there some way to configure Linux ...
1
vote
1answer
21 views

Noip “Can't locate configuration file”, but the file is there

I installed Noip and ran the command which created the config file /usr/local/bin/noip2 -C and then I ran the run command /usr/local/bin/noip2 and it returned Can't locate configuration file ...
1
vote
1answer
44 views

Understanding grep and pipes in linux

I came across this post which explains my problem. Suppose there is a file called file.txt which contains "foo World". The answer posted by Tyler explains a lot however I am confused as to how cat ...
1
vote
1answer
71 views

Linux split separate files on disk but see as one

Is there is a functionality in Linux that allows you to reference multiple files as one? For example: linux.txt.0, linux.txt.1, linux.txt.2, linux.txt.3 can be seen as separate files or as linux.txt ...
5
votes
3answers
193 views

Is there any way to tell exactly what files a command is accessing?

I'm working on a piece of software that requires me to know what files and resources any certain launched process are accessing. I'm not planning on attempting to track what every single script, ...
3
votes
1answer
16 views

Check for missing files in two directories and their respective subdirectories

Folder alpha has one subfolder, and files in both root and in subfolder. Folder beta has 25 subfolders with files in them. How would I compare the file contents of alpha and beta, checking for ...
3
votes
2answers
46 views

ack/grep search and sort by modification date

Is there any way to have ack sort the results found by date of modification? (ideally showing the date next to the result?). It doesn't look like ack has a date option, but just in case. If this ...
0
votes
1answer
40 views

File tranfer from the server

I want move (not copy with scp) my file from the server to the local repository and finally delete it on the server after transfer. I use next command from the repository, where I want have the file: ...
4
votes
2answers
585 views

How do I delete all of a set of files in a random order?

I have a set of files, all that are named with the convention file_[number]_[abcd].bin (where [number] is a number in the range 0-size of drive in MB). i.e there is file_0_a.bin, file_0_b.bin, ...
1
vote
0answers
13 views

File path in audit log instead of inode number

When I do: echo "#TEST" >> /etc/passwd I get the following in audit logging: node=kayak.office.local type=SYSCALL msg=audit(1412687666.054:62033): arch=c000003e syscall=2 success=yes ...
3
votes
5answers
171 views

How to create a simple .txt (text) file using terminal? [closed]

I'm just trying to review basic terminal commands. Having said that, how do I create a text file using the terminal only?
1
vote
1answer
54 views

Open file over ssh in local X window [duplicate]

How can I open html file in local internet browser? I am connected under /ssh://user@server.... I'm thinking about something like firefox file_from_remote_server.
2
votes
1answer
67 views

How to let a user create a directory although not create a sub directory

I'm trying to create a Bash shell script that allows for the transfer of files from a flash device to a archive in which the user will specify. Although I'd like to restrict this user from not being ...
1
vote
0answers
22 views

Files associated with Thunderbird - Security mechanism for local storage

I am trying to know how Thunderbird stores the mails, associated files in the local machine. I use Ubuntu 13.10 and Thunderbird 24.6.0. When I see in the local profile folder in the location in ...
8
votes
2answers
493 views

How to non-invasively test for write access to a file?

In a shell script, how do I easily and non-invasively test for write access to a file without actually attempting to modify the file? I could parse the output of stat, but that seems really complex, ...
2
votes
2answers
50 views

How to make system file partitions larger without reinstalling

I'm a complete beginner with any Linux distro and I recently picked up SteamOS. SteamOS I believe is Debian based. I wiped the laptop and got it installed nicely. When I started moving my music over ...
1
vote
0answers
27 views

Copying files to a directory shared via ACL doesn't get default mask

I'm trying to setup a simple shared directory on an ext4 filesystem for a group of users to work on. Let's say i just need to give all permissions to all users belonging to the group "workgroup" to ...
1
vote
1answer
30 views

Find files belonging to a group

Actually I want to find all the files and folders that are under the same group, for example I have this : [test] user1/sam a.txt user9/sam b.txt user4/sam I'm looking for a command ...
0
votes
3answers
75 views

Unable to delete a file without permissions etc

I have a file in Windows XP left over after deleting Google Chrome. Its location is C:\Documents and Settings\Admin\Local Settings\Application Data\Google\Chrome\User Data\Default\old_Cache_000 The ...
2
votes
2answers
85 views

Shell script to merge files with same names

I have a directory of files such as: file.1111111_1.pdf file.1111111_2.pdf file.2222222_1.pdf file.2222222_2.pdf … file.1234567_1.pdf file.1234567_2.pdf … file.aaaaaaa_1.pdf file.aaaaaaa_2.pdf … ...
9
votes
2answers
498 views

Tool in unix to subtract text files? [duplicate]

I have a large file composed of text fields separated by semicolons in the form of a large table. It has been sorted. I have a smaller file composed of the same text fields. At some point, someone ...
2
votes
2answers
62 views

Change file timestamp and display hour instead of year with ls

I want to change a file's date to tomorrow 21:00. I used touch, but when I type ls -l the year of the file is displayed instead of the hour. -rw-r--r-- 1 ABCD DEF 0 sept. 30 2014 test01 -r-xr-xr-x ...
0
votes
2answers
41 views

check two partitions by selecting random files and running sha1 hashes on two files of each partition

A previous answer to a post mentions to run sha1 hashes on an images of a dd drive clone image. Another answer to that post suggests mounting the dd image an then compare if the sha1 hashes of ...
-10
votes
1answer
63 views

unix command to search for a file whose name starts with letter g

What unix command can I use to search for a file whose name starts with the letter g?
8
votes
2answers
270 views

How can I tell when a process has finished writing to a file?

I have a process which has been spawned from a shell. It is running as a background process and exporting a DB to a CSV file in /tmp. How can I tell when the background process has completed ...
13
votes
3answers
1k views

Why are TCP/IP sockets considered “open files”?

I need some assistance grasping what I'm sure is a fundamental concept in Linux: the limit for open files. Specifically, I'm confused on why open sockets can count towards the total number of "open ...
2
votes
1answer
42 views

How to gather byte occurance statistics in binary file?

I'd like to know the equivalent of cat inputfile | sed 's/\(.\)/\1\n/g' | sort | uniq -c presented in ...
3
votes
1answer
47 views

Monitoring files continuously with lsof

Is there a way to make lsof work continuously to monitor every file that is being opened in real time? I don't know the name of the process. I want lsof to work continuously for a period of time ...
2
votes
2answers
46 views

List of subdirectories that contains a particular file name

I am wondering if i can do this in a single shell command. I am in home directory and want to find a list of subdirectories that contains a particular file. The file name and the depth is always ...
1
vote
1answer
54 views

Change file ownership, based on previous owner

I am a moderately new linux user. I changed my PC, and started using CentOS 7 from CentOS 6. So I attached my previous hard disk to my new pc to take backup of my files. Now, copying the files (and ...
3
votes
1answer
41 views

read only symlink or something similar? [duplicate]

I created myself a NAT for home use (Ubuntu+Samba+Greyhole+Apache+MySQL+other web server related stuff). 90% of files I store there are pictures that i really don't wanna loose (that's why Greyhole). ...
2
votes
3answers
51 views

Password protect a single folder ( not a web folder )

I run debian and I'm looking to limit a folder to only be accessible by one user. How do I set the permissions up so only that one specific user can enter it, and no other user. The folder I'm talking ...
2
votes
1answer
124 views

write() system call ignores file permissions

I made a very simple program in C which writes "Test string" into file named "file.txt": root@3:~# cat test.c #include "unistd.h" #include "string.h" #include "stdio.h" main() { FILE *fp; int ...
5
votes
1answer
94 views

Ability to add files to a directory but not remove existing files

Is there some permissions setup that would allow a user, say, john, to add a file to a directory d, but not be able to remove an existing file owned by another user, say, root? My understanding is ...
1
vote
2answers
157 views

I accidentally GZIPed a whole bunch of files, one by one, instead of using tar(1). How can I undo this mess?

I'm new to the gzip command, so I googled some commands to run so I can gzip an entire directory recursively. Now while it did that, it converted each of my files to the gzip format and added .gz to ...
3
votes
1answer
60 views

Find Stale NFS Files

I've been pondering about an efficient way to locate stale NFS files for a few days with out much success and was wondering if there are better approaches to the problem. Problem: every once in a ...
6
votes
3answers
445 views

How can I make a special file that executes code when read from

Most files on a Linux system are normal files, i.e. they are saved on disk and reading from them just reads from a specified chunk of memory on the disk. How can I make something that behaves like a ...
1
vote
2answers
64 views

finding latest date and date modified file and using sed

I have a series of files that contain a date and I need to get the file which has the latest date, and the latest date modification and pipe it to sed. I have tried various approaches and I cannot ...
8
votes
2answers
274 views

Reindexing a large CSV file

I went through the answers in this helpful thread, but my problem seems to be different enough that I can't think of good answer (at least with sed). I have a large CSV file (200+ GB) with rows that ...
6
votes
1answer
44 views

Linux: Locating text file from a string input

I have started to use Linux and I'm practicing using/making codes to locate and do things. I need help with code that locates any file from a string of input. I don't know where to start?
4
votes
5answers
296 views

Clone directory tree structure and copy files to the corresponding directories modified after a specific date

I have a folder with more than 30 sub directories and I want to get the list of the files which was modified after a specified date(say sep 8 which is the real case) and to be copied with the same ...
2
votes
2answers
49 views

Run grep or other commands on files on a web server

I have files on another domain. What's the best way to use commands on them like grep? wget http://path/to/file.txt | grep search However this doesn't work. I guess I can use curl but is there a ...
3
votes
2answers
49 views

zsh solutions to “the argument list is too long”

I read in this answer from @Gilles the following: In zsh, you can load the mv builtin: setopt extended_glob zmodload -Fm zsh/files b:zf_\* mv -- ^*.(jpg|png|bmp) targetdir/ as a solution to ...