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

learn more… | top users | synonyms (1)

2
votes
2answers
15 views

Network drives in the cloud?

Is there such a service that allows Linux servers to access remote cloud storage as if it were a file on a local network? I'm running a very small server, 512 MB RAM and 20 GB hard drive space, but do ...
4
votes
5answers
241 views

How do I grep recursively through .gz files?

I am using a script to regularly download my gmail messages that compresses the raw .eml into .gz files. The script creates a folder for each day, and then compresses every message into its own file. ...
3
votes
1answer
42 views

Edit a file via a script yet maintain the osx tags

On OSX you can have tags which allows you to identify different categories of files. Here are two text files with different tags when viewed in Finder: I have a large number of these files and have ...
1
vote
1answer
35 views

pass all files in directory as one argument to perl script

linux beginner here I have a directory with 50 files in it and I want to simultaneously pass them all to a perl script with just a space between names , as in... ./perl_script.pl file1 file2 file3 ...
1
vote
1answer
79 views

Swap two files in bash [duplicate]

How do I swap two files in Linux console with minimum typing? Boring approach: $ mv file1.dat fileX.dat $ mv file2.dat file1.dat $ mv fileX.dat file2.dat
3
votes
2answers
60 views

Use lines in a file to produce string and file name

I have a file, foo.txt, that has a folder name on each line: folder_1 folder_2 folder_3 And I'd like to do something like this: cat foo.txt | xargs -I {} echo 'function {}() { return stuff; }' ...
0
votes
0answers
33 views

getting ? in permissions when running ll/ls command

I am trying to remove a folder and I am getting rm: cannot remove ‘...' when running the ll command I am getting : > ll ./folder/ ls: cannot access ./folder: Input/output error total 64 ...
0
votes
1answer
16 views

Relationship between file properties and user and group

There is something not clear on relationship between file properties and user and group. root@debian:/home/debian# ls -l /home/linuxsir total 4 -rw-r--r-- 1 linuxsir root 1549 Feb 23 19:16 ...
4
votes
2answers
58 views

How to delete part of a binary file without copying

I need to delete the first 2 bytes of a 6MB file. However, this is an embedded Linux with only 32 Mbytes RAM and less than 1 MB free flash memory. I tried using dd, as: 1 - # dd bs=1 skip=2 ...
-3
votes
1answer
36 views

find all .sh files then copy to <date>scriptbackup

Locate all the .sh scripts you have created in your Linux installation (searching recursively if needed – excluding existing backup folders) It will then copy them all into a folder called ...
-1
votes
0answers
13 views

only onefile in the directory why display 4? [duplicate]

There is a only one file t2.txt in the /home/linuxsir,why total is 4 here? root@debian:/home/debian# ls -l /home/linuxsir total 4 -rw-r--r-- 1 linuxsir root 1549 Feb 23 19:16 t2.txt
1
vote
1answer
16 views

Rename command with non-existing target directory

I'm trying to group files automatically into subdirectories using a command like this: $ rename 's/(.)(.)(.+)/$1\/$2\/$1$2$3/' *.* A dry run with the -n parameter shows me what I want: test.jpg ...
0
votes
2answers
24 views

How to specify the file type in a hard link [closed]

Does anyone know how to specify the file type of a hard link? Is this even possible? For example, I want to link to an HTML file (with content type text/html) in my website directory, so I used ln ...
1
vote
2answers
20 views

move content from a folder with unknown name up one directory

I have data arranged as follows: --parent_dir | --4Bz27go1c | -- foo.md -- bar.tar.gz -- baz.c .. I have a parent directory with a known name and a child ...
0
votes
1answer
15 views

unix2dos not recogonizing outfile

I typed unix2dos /path/to/filename_unix.txt /path/to/filename_dos.txt in the CentOS 7 terminal, but I got the following in response: unix2dos: converting file /path/to/filename_unix.txt to DOS format ...
3
votes
2answers
72 views

What is nobody nobody user and group?

On my server (Synology DS212) some files and folders have nobody nobody users and groups. What are the characteristics of this user and group? Who can write of read this file? How can I change it ? ...
0
votes
1answer
22 views

moving binaries from bin to specific folder

I want to install RNAhybrid tool so I downloaded it and configured it. I wanted to keep in a directory called programs, so I downloaded the tar.gz in that directory, extracted it and then used ...
0
votes
1answer
27 views

Solaris 11.2 extended permissions shown by ls

I have a file that shows up as having extended file permissions. ls -V /usr/share/X11/app-defaults/XScreenSaver rwx------ 1 root root 53 Dec 2 21:52 ...
4
votes
3answers
257 views

Run command automatically when files are copied into a directory

I have two folders called: A and B, in different paths on the same computer. When I add any new file(s) into folder A, I want to copy it to folder B automatically. My folders: /auto/std1/nat1/A ...
1
vote
4answers
77 views

Script to delete files that don't match certain filenames

I have a folder with 500,000 images, sorted in subfolders by year and month. I'd like to create a script that does this: If the filename does not match any of the filenames in names.log then delete ...
0
votes
0answers
39 views

fopen problem when mounting ecryptfs filesystem

After an unrecoverable fsck problem the mount of my encrypted /home/me filesystem isn't possible any more. The visible effects are: a) logging in though most of the selectable GUI window managers ...
3
votes
1answer
57 views

Deleted folder keeps coming back

I have a directory at /opt/splunk that I cannot seem to get rid of. root@alpha:/opt# ls -la total 87156 drwxr-xr-x 4 root root 4096 Feb 20 15:44 . drwxr-xr-x 23 root root 4096 Feb 19 13:29 ...
1
vote
1answer
15 views

How to display metainformation for different kinds of time of a file ?

As far as I know each name within a path, e.g. /name1/name2/name3, is allocated to one inode. This inode is a collection of meta information for each name (file or directory). Some of these ...
1
vote
1answer
44 views

Single record of a file getting splitted over multiple lines

We are using flat text files to store in teradata table after transformations from Informatica. The file contains 14 fields (~ separated). But as the records are getting scattered over multiple lines ...
2
votes
1answer
31 views

Creating symlinks in the etc directory without root access

What I would like to create if I had root access would be a symlink from some file or folder in the /etc to another file or folder in the /etc. However, I do not have root access. Is there any way to ...
2
votes
2answers
36 views

Set default permissions by file type (at least in Vim) [duplicate]

When I create a new script, I always have to manually add executable permissions with chmod +x foo.sh. My default permissions are set to 644, and but I'd like any file with extensions like .sh .py to ...
1
vote
1answer
43 views

Very slow file operation

I recently rebuild a machine with Centos 5.8 with a brand new disk. This machine is old and has been running 5.8 for a long period with no issues so the only thing which changed recently is the new ...
1
vote
1answer
88 views

How to delete file called “-C” [duplicate]

I need to delete the following file which I managed to create with bunzip2: -rw-r--r-- 1 beginner group 67493376 Feb 17 17:30 -C The following don't work rm -rf '-C' rm -rf "-C" My OS is ...
1
vote
3answers
104 views

how to set up permissions of “download” dir to prevent execution of exploit program

There is a host with a local service that receives data from a remote location (via e.g. http) and saves it locally under /var/log/data/ in some mydir. $ ls -al /var/log/data drwxr-sr-x+ 4 root ...
1
vote
2answers
95 views

How do I wait for a file in the shell script?

I'm trying to write a shell script that will wait for a file to appear in the /tmp directory called sleep.txt and once it is found the program will cease, otherwise I want the program to be in a sleep ...
3
votes
0answers
34 views

Look at the bytes in a directory? [duplicate]

I would like to see what the actual contents of a directory file are (not the files that are contained within that directory). Specifically I would like to be able to do something like: od -c . ...
0
votes
1answer
29 views

Command to to restart Pantheon files manager (elemenaryOS)?

After editing context menu entries (by editing files in /usr/share/contractor) I have to restart the file manager to see the changes. How to restart Pantheon Files with a command so that I don't have ...
3
votes
1answer
45 views

How do you get the first file in each subdirectory matching a list of file extensions?

How do you get the first file in each subdirectory matching a list of file extensions? My goal is to run a program on just any one of the files in a series of subdirectories. For example, below ...
0
votes
0answers
19 views

Folder keeps vanishing/showing up in finder, terminal says it doesn't exist

Upon a standard find routine I noticed a folder kept returning errors, even tough it didn't contain any of the arguments in the search query. Ilha-VB2-leo:FESTIVAIS_01-16 ilhavb2$ find . -iname ...
0
votes
1answer
20 views

linux (general) file/directory rename/delete operations under os permission scheme

In linux, do file/directory rename/delete operations belong to write permission?
0
votes
4answers
49 views

What is the command to find the read/write permissions for a single file?

I know that ls -l lists the permissions of every file in a directory but what is the command if I want to see the permissions of just a specific file?
0
votes
1answer
36 views

How do I transfer images from Fedora 20 computer to iphone?

I have a laptop running Fedora20. I have an iPhone4S. I have installed the software suggested here which allows my laptop to read the iPhone. I connect my phone to the laptop using a USB cable. I ...
1
vote
4answers
51 views

Dynamically reference a file's name

In a single directory, I'd like to replace the first line of each file with the file's name. Each file has as the first line "TestRelation." I'd like to replace it with the file's name. I know I can ...
3
votes
1answer
27 views

“Ghost” files in ext4? (ktorrent allocated disk space)

I'm downloading with KTorrent, and have noticed that when I select "allocate disk space before starting torrent", it creates all the files at start, presumably empty, to avoid fragmentation. When I'm ...
1
vote
1answer
22 views

find's - cnewer broken on NTFS-3g?

After extracting an archive to the wrong place, I thought I'd erase everything created after it, but find . -cnewer archive.7z gave the wrong results. So I made a controlled test by touching three ...
2
votes
2answers
40 views

Mailx with multiple uuencode attachments and body

I am sending multiple files using following line in my script find . -type f -name "Sum*pdf*"|while read name; do uuencode "$name" "${name##*/}"; done | mailx -s "North Bus Correction" $RECIP Now I ...
0
votes
4answers
32 views

adding programs to path [duplicate]

I have a load of tools that are kept in the /opt directory. The tools are organised like this: /opt/toolname/tool.sh. My question is, how can I add the tools in my /opt folder to my path, so i can run ...
-4
votes
0answers
21 views

Rename file extensions [duplicate]

I have below file in one directory of linux now I want to short like ls -ltr *secu*.meta then I want to rename those shorted files from .meta to .xml how can I do that with loop through all files? ...
1
vote
1answer
41 views

Find which file contain a particular keyword using `grep`

Suppose I know I have to change myhostname = abc.domain.lcl to myhostname = abc.domain.glbl directive but I don't know in which file exactly the directive myhostname is in (i.e., say I have never ...
0
votes
2answers
42 views

Rename file by it is folder name

I have a sort of folders (A,B,C,D,E,F,G,H) and I have one file in every folder has the same name in all the folders (file.txt) but the size of this file is different from folder to folder. I wanted to ...
0
votes
1answer
51 views

Ambigous redirect done >$2

I have finished my bash script but I am still getting two errors. I've also searched for related issues but none worked: #!/bin/bash avem_element () { local e for e in "${@:2}"; do [[ "$e" == ...
0
votes
1answer
21 views

Allow inclusion of file in php but forbid reading/editing by user

I have a file.php that needs the be kept in secrecy, so its permissions are 700. What I'd like to do is maintain these permissions 700 but allow the inclusion of the file in other files. How can I ...
3
votes
6answers
111 views

redirect output to specific line number

I want to grep certain lines by keyword and redirect the output to specific line number of an existing file. Command grep "key" temp_file >> desired.txt What I need is that I can append the ...
1
vote
1answer
37 views

How to import videos/pictures/documents from my Samsung smartphone to my Linux system?

I imported most of last year's videos and pictures from my Samsung Galaxy Note 3 to my Fedora 20 laptop through Gwenview import. Now I want to import the last month's but I'm having difficulty ...
3
votes
1answer
54 views

Filename expansion from date ranges

Consider dates in the ISO 8601 format i.e. ‘YYYY-MM-DD’, e.g. 2015-01-28, and say we have a folder with files of the form: AAAA_<date>_BBBB I am looking for a glob pattern in zsh (or Bash) ...