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

learn more… | top users | synonyms (1)

1
vote
3answers
23 views

How to can I make Filename Sequencing with the help of Loops

my intention is to keep the code as simple as possible.Here there are 5 files namely A_1.CSV, A_2.CSV, A_3.CSV, A_4.CSV, A_5.CSV The below code retrieves the first row in a CSV file. Code : ...
0
votes
1answer
23 views

Which way is safer to read data from /sys

I am attempting to write a program that will monitor the temperature of various hardware components. The language I chose for it is Java. Now there are two ways I could read the temperatures: a) Do ...
0
votes
2answers
67 views

How do I move a line in a text file up or down by one line?

I have some text files, and I'd like to be able to move an arbitrary line in any of the files up or down one line (lines at the beginning or end of the file would stay where they are). I have some ...
2
votes
0answers
27 views

Random file showing up in various directories. How to trace its creator?

I am finding a 0 byte file named ^- (that is a caret and a dash) in various directories on my file system. I use zsh with oh-my-zsh and I am pretty sure something in there is creating it but I really ...
1
vote
1answer
20 views

Batch rename “case duplicates”

I have a folder on my Linux system that is cross-synchronized with other computers, some of them with Windows. The problem is that in that folder there are files that are "case duplicates", i.e. their ...
-6
votes
0answers
30 views

Script for compare two file permissions

create dir, create two files with diff permission. Now write a script to test the permisiion of these two files. If its same then display the filename with its permission. if not display the ...
1
vote
0answers
15 views

FS on NFS share responding slow

We have two server ex name app1 and app2.Both server have a nfs mount from same server as below:- nfsserver:/prlocal 249G 190G 46G 81% /prlocal Now the problem is when we try to access the FS ...
2
votes
2answers
19 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
6answers
281 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
47 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
40 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
82 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
4
votes
2answers
70 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
17 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
62 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
38 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
25 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
17 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
75 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
28 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
262 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
78 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
42 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
59 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
46 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
32 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
38 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
44 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
89 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
105 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
96 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
31 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
47 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
20 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
22 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
39 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
53 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
23 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
45 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
33 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? ...