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

learn more… | top users | synonyms (1)

3
votes
3answers
25 views

Move unique files from a folder with duplicates files

Well to put it simply, I have duplicate files in a folder, with this form: file.ext file(1).ext file(2).ext file(3).ext otherfile.ext otherfile(1).ext otherfile(2).ext ... I want to move only ...
0
votes
2answers
18 views

Creating a character device file

How to create the character device files? I have tried cat > xxx^c But I can't create a character device file
1
vote
1answer
25 views

Why different UIs display different size of the same file?

Here's what Finder displays: QuickTime 7: Terminal: Why?
-1
votes
1answer
29 views

How to copy files that are very large

I would like to copy files which are nearly 50GB and 75GB of each to external drive. Please suggest best and fastest way to do that.
0
votes
1answer
18 views

Permission check on profile file in home directory: should it be done?

Say I'm implementing a programming language which has an interactive mode, and that interactive mode reads some ~/.foo_rc file in the user's home directory. The file contains code in that language ...
1
vote
1answer
15 views

Linux Mint: make a “public clickable launcher” from a sh root only?

I made a shell script to install packages, configure them, etc. Usually I run it via Terminal sudo sh gizmo.sh Now I aim to put it in a double-clickable file to run it, for any user (no sudo, so su ...
1
vote
1answer
47 views

What characters are valid to use in filenames? [duplicate]

I seems like it is possible to create filenames in unix with just about any valid character. touch \; && touch \\ && touch \" && touch $'\n' && touch $'\t' && ...
2
votes
2answers
35 views

Why can't I apply this script to files not in my current directory?

I got this script ~/bin/align-tables from emacs stackexchange #!/bin/sh # -*- mode: shell-script -*- # # tangle files with org-mode # DIR=`pwd` FILES="" # wrap each argument in the code required to ...
-1
votes
0answers
36 views

Couldn't read file even with 777 permission [on hold]

I am not able to do any activity,copy/read, on a particular file in a folder. The file and the parent directories have 777 permission. Other than this file all the other files in that folder are ...
4
votes
4answers
135 views

Delete several lines from a file using grep

I have a file with multiple lines which looks like that : brand,model,inches,price dell xps 13 9000 macbook pro 13 13000 asus zenbook 13 10500 I want to ...
0
votes
1answer
84 views

What's the fastest way of writing 1s to a hard disk? [duplicate]

I'm currently writing 1s to a file using the following: tr '\0' '\377' < /dev/zero > /dev/sdb But this is a really slow method when I want to fill a 500GB disk. Is there a quicker way?
1
vote
2answers
24 views

Saving data between names in terminal to new files?

I have the following text file: (Employee Ashley) insert text here (Employee Bob) insert text here (Employee Joseph) insert text here I would like to take the text for each "employee" and ...
5
votes
5answers
192 views

Renaming files using list

I have files available in a directory as: filename15_1 filename15_2 filename15_3 filename15_4 And so on. I have another file that contains mapping information for how I want to rename the files. ...
1
vote
1answer
30 views

Terminal: Write in file, out of content?

I aim to hide data into .txt and .xml files, from Linux OS, aand keep it readable on any OS. With Apple OS (OS X), I used to write 'secrete' data into files (actually in the Resource Fork of the ...
7
votes
5answers
324 views

How to remove a file that start with “>” or other unusual characters [closed]

I've accidentally created a file called > option[value='2016'] How can I delete it? My attempts: $ rm "> option[value='2016']" rm: cannot remove ‘> option[value='2016']’: No such file or ...
0
votes
2answers
73 views

How to find all files matching (or not matching) a specific pattern in a folder?

How do I find all files in a folder and its subfolders terminated with 3 digits and move them to a new place while keeping the directory structure? Alternatively, how can I find all files whose ...
1
vote
3answers
61 views

Get checksum of directory on bash

I was wondering: Is it possible to create a checksum of a directory (using something like md5sum) Is it possible to recursively create checksum for each file inside the dir (and then print it out)? ...
1
vote
1answer
31 views

Command argument completion of `~/bin/*` filenames from any directory in bash

A basic bash feature is the completion of commands stored in the various bin directories, regardless of the current working directory. This allows users to keep commands and binaries organized without ...
-1
votes
1answer
51 views

Grep command to output in file

grep -irm 1 "some_pattern" . | wc -l > myfile.txt I used this command to find out the number of files having the given pattern. I want to output it in file. But I couldn't... what to add or ...
1
vote
1answer
33 views

How are permissions in linux implemented?

It is in my knowledge that Linux implements a DAC-based model for file access control, however I recently came across the fact that ACL's have to manually be enabled in Linux. My question is: How ...
0
votes
1answer
11 views

How can I check the ruby format for a bunch of files and/or 1 single file?

Most of them have a common pattern that is a filename of ..._rspec.rb One of them is a filename without that ending (but does end in .rb) How can I run ruby -wc (or in fact any operations such as ...
0
votes
2answers
30 views

File size after cut

I am trying to verify if I split large file correctly into multiple pieces. As an toy example, I have a file out_sample: 123456789012 123456789012 123456789012 123456789012 123456789012 This has 64 ...
3
votes
5answers
51 views

How do I exchange names for a large amount of files in a folder?

I want to randomize the names for about 350 files in a folder, but I want to have all the names that the files had originally. What I mean is I want All of the names in my folder randomized from the ...
2
votes
6answers
70 views

checking the largest number of a specific folder

Inside one of my folder I have a lot of files looks like enum-* $ ls PRIM enum-00020 enum-00040 enum-00059 enum-00078 enum-00101 enum-00122 enum-00141 enum-00160 enum-00179 ...
0
votes
2answers
27 views

mv files into folders based on numbering in names

I have 30 folders: s-01 s-02 ... s-30 And, I have 30 files: txtFile-001 txtFile-002 ... txtFile-030 How can I perform the following operation in one shot mv txtFile-001 s-01/txtFile mv ...
0
votes
0answers
12 views

ntfs issue with rsync: read errors mapping permission denied (13)

I have an issue when I want to rsync folders from my external backup hard disk to my NAS. I get this error : read errors mapping permission denied (13) I have root rights; if I want to change ...
1
vote
2answers
31 views

Select file based on number of lines and manipulate the result

I have a large number of files, all with the same format. line 1: Gene ID line 2: chromosomal position line 3 - x: names of genetic variants) I want to select only files containing at least 5 ...
1
vote
1answer
33 views

How to pass arguments to command through Desktop shortcut without having to open a terminal?

I'm using a LXDE desktop. I created a shortcut in the desktop to a python program, which can be passed files to, which are then opened in the GUI. I mean passing files (file absolute paths) to the ...
2
votes
4answers
34 views

How to link a log file to /dev/null and restore the space used automatically

I have a logfile which grows huge. The information that I can get from it is negligible. I want to link it to /dev/null. However, even if it is "deleted" (see below the output of lsof), it consumes ...
3
votes
2answers
44 views

Move a file and replace it by a symlink

Can someone give me a command that would: move a file towards a new directory and leave a symlink in its old location towards its new one
1
vote
2answers
50 views

paste files without delimiter

How do I join two files vertically without any separator? I tried to use paste -d"" a b, but this just gives me a. Sample file: 000 0 0 0 0001000200030004 10 20 30 40 2000 4000 ...
1
vote
2answers
34 views

Is there a command line spell to save specific columns by name in a CSV-file?

Suppose I have a crazy data set in CSV: ...
0
votes
1answer
15 views

Generating files of varying variability?

I have used /dev/zero and /dev/random to generate files of certain size. However, is there a way to control variability of generated files? I would like to create few files that would have same ...
0
votes
1answer
24 views

Cannot use NTFS drive as non-root user

I have an NTFS partition which I am trying to mount as Read Write in Fedora 22. Using Nautilus as root allows me to create folders, files etc. However when I use my non root account, I get an "Error ...
0
votes
3answers
116 views

How would an administrator of a system prevent himself access to a file for 24 hours?

How would a single administrator go about locking himself out of a file for 24 hours? By "lock" I mean prevent access. I have removed the 'rules' placed on the original post, as it is clear that the ...
2
votes
1answer
30 views

Merge text files with 1st column and difference in output file

File 1: (text1.txt) Row_Added_Ts Count 01/01/14 2022448 02/01/14 8345155 03/01/14 8663852 04/01/14 6785739 05/01/14 5279913 File 2: ...
1
vote
3answers
83 views

Is there a way to undo a terminal command?

I just copied a whole directory into another one using cp ~/local/* ./ and actually wanted to type cp ~/local/srl* ./ so I'm founding myself with a lot of unnecessary files. I can suppress them ...
2
votes
3answers
54 views

Difference between files in directory

I have two directories with same files but with some difference in their contents. I want to list down those files which are differing. For example There are two folders Folder1 and Folder2 with ...
-1
votes
1answer
32 views

save output into a file from sqlplus query in ksh script

The thing is that it overwrites in Result.txt and I only get the last query. How can I fix this? #!/bin/sh while read -r line do echo "'$line'" sqlplus -s whatever/whatever <<-EOF SPOOL ...
0
votes
2answers
28 views

Wrong zip command messed up my project directory

I've issued a command gzip -r project.zip project/* in projects home directory and I've messed things up; every file in project directory and all other subdirectories have .gz extension. How do I undo ...
1
vote
2answers
23 views

No option of creating new file in centos 7 gui [duplicate]

I have recently installed centos 7 and was trying to create a new file through right click and selecting create a new file option as I have done in centos 6 but there is no option of create new file ...
1
vote
1answer
24 views

Detecting file size and do operation conditionally

In my main_dir, I have a lot of sub-folders say DFT1 to DFT150, and in each directory, there is a file named OSZICAR. However, some of this would have file size 0. So I would like to have a script, ...
3
votes
2answers
117 views

tar command - skip symlinks

I use the tar command as, tar -cvf protTests.tar protTests/* to tar all files inside the folder, protTests. But this is including the symbolic links inside the folder, which is not a desired one. ...
-1
votes
0answers
27 views

Can't locate Vim folder anywhere on linux mint system

I'll try to keep this short. I've been trying to install YouCompleteMe and have had a bunch of trouble, so consequently I have installed and uninstalled vim a few times. Now my problem originated ...
0
votes
3answers
32 views

Backing up files [duplicate]

I would like to backup all files older than 90 days and greater plus gzip them. I could execute: find /path/to/files -type f -mtime 90 -exec gzip "{}" \; Problem with this command is it includes ...
42
votes
2answers
3k views

why is rm allowed to delete a file under ownership of a different user?

From the post Why can rm remove read-only files? I understand that rm just needs write permission on directory to remove the file. But I find it hard to digest the behaviour where we can easily delete ...
0
votes
0answers
25 views

how to exclude specific subfolder when creating zip file via command line linux

I do want to exclude subfolder like uploads/2015/OtherSubfolderName through command line. I have tried with below command, its working fine. zip -r zipfile.zip public_html -x *uploads* but can we ...
0
votes
0answers
23 views

Lubuntu won't let me change a file's permission

Yesterday I installed Lubuntu, and it works great. Today I've been messing around with my files (don't worry they aren't system files) and I came across file settings (keep in mind that I am the Admin ...
1
vote
1answer
69 views

How to know which programs support streaming I/O

As I understand it, programs that support streaming I/O can work with files more than the size of the memory. Is this correct? Is there a way to know which programs support streaming I/O?
3
votes
1answer
31 views

Using File Date/Time as Metadata: Reliable?

Background: I have groups of files in their own directory which I merge into one file in order of their filename. I call them t1.txt, t2.txt, t3.txt... I merge them in order of the integer. ...