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

learn more… | top users | synonyms (1)

1
vote
3answers
127 views

Finding and removing words beginning / ending with numbers

I have a large file (>10000 lines) that contains one word per line, with a newline character after each word. The words contain no spaces. I'd like to list (or even better, output to a new file) any ...
0
votes
1answer
61 views

linux compare text file [duplicate]

I have file1.txt and file2.txt, both contain URLs, I want to create a new file with the unique URLS present in file2.txt and not in file1.txt. Example urls file: aspencabinets.com.au iiatca.org ...
0
votes
0answers
20 views

meaning of !(something) in shell [duplicate]

While searching for a way to move all files in a dir to one of its sub-folders, i came across mv !(something) something which should do the job - but only in bash. However i could not find why. in ...
2
votes
1answer
51 views

Information leaks out of encrypted file system

If I only encrypt the home directory, what are some common ways for information to leak out to the unencrypted part of the file system? Aside from the obvious problems like swap space files in /tmp ...
1
vote
2answers
54 views

How to remove prefixes and suffixes from filenames in a given directory?

I have many files with the same prefix and the same suffix. I want to remove both from filenames. Both contain spaces. So foo bar XXX doo par.jpg, foo bar YY YY doo par.jpg would become XXX.jpg and ...
1
vote
3answers
39 views

Run a command over directories with name recursively

I have the following directory structure in AIX. codeRepo/REPO1/AREA1/objects codeRepo/REPO1/AREA2/SUBAREA1/objects codeRepo/REPO1/AREA2/SUBAREA2/objects From codeRepo I want to run chown myUser * ...
3
votes
1answer
35 views

Locate and manage files on extern hard drive through FileZilla over SSH

I have installed Debian Server on one of my servers and plugged in a extern hard drive to it through USB (sdb1, 2, and 5 on the image below) where I have all my files on right now. Before I used this ...
3
votes
2answers
37 views

How do I transfer (to a usb drive) or read a .odt file in the command-line?

Currently my computer is not allowing me to start it up properly (guessing my hard drive is malfunctional), but I've figured out that Ctrl+Alt+(F1,F2,F3,F4,F5,F6,OR F7) allows me to access ...
2
votes
2answers
120 views

Lost Folders and Files in the directory /home/ubuntu/ in Ubuntu

I have uploaded a .tar file in /home/ubuntu/ and un-zipped the file in the folder name 'analytics'. After reboot, I couldn't found the directory and the tar files. I have checked it through SSH ...
1
vote
2answers
73 views

Save file after using sed command

I am using following command to replace yyyymmdd to YYYYMMDDHH24MISS in my file: sed -e 's/\('yyyymmdd'\)/\('YYYYMMDDHH24MISS'\)/g' filename After I run the command in PuTTY, it displays the file ...
0
votes
1answer
25 views

File -> ../../archive/folder/file restore

Hi i'm new to Linux and I need to use it temporary to set up LetsEncrypt. Once complete, I needed to move the /etc/letsencrypt/live/fullchain.pem file into the root dir but i moved the file ...
5
votes
2answers
77 views

Search directories for multi line string

Looking for a way to recursively search a repository for all files containing a multi line string and return the file names that contain it. The paragraph is just a header approx 30 lines. So I know ...
2
votes
2answers
42 views

Renaming a file the moment it appears in a folder

Here's the context : on a samba server, I have some folders (that we'll call A,B,C,D ) which are supposed to receive files from a network scanner. The scanner renders a PDF file named like this : ...
0
votes
1answer
44 views

How can I upload my .cpp file online while logged into schools Linux server through SSH?

I am currently in a basic programming class, and I finished my first project and it is a .cpp file. I am logged into the Linux server but I do not know how to upload a .cpp file online when I can only ...
1
vote
1answer
33 views

Symlink to same directory

I've set up a ftp server for using ftp push on a tv recording page. I've created an extra user for this, who has only access to one directory, which the user is chroot-ed in. But the page does not ...
0
votes
1answer
28 views

How to safely delete a regular directory that contains several btrfs snapshots inside it?

I have a regular directory than contains directly underneath it several btrfs snapshots. Is it safe to do an rm -rf on the parent directory, or do I need to first do a btrfs subvolume delete SUBVOL on ...
0
votes
1answer
109 views

limit of open files: Debian Jessies´ MySQL vs Community Oracle MySQL

I have just upgraded from MySQL Jessie 5.5 to MySQL Oracle Community Edition v5.6. I have a particular MySQL server, that has around 230 DBs, and > 32k files/tables. Whilst for two or three years, I ...
1
vote
3answers
54 views

How to join two files by matching a column with an irregular number of columns?

file1: 0000002|SLM DEV CORP |PO 857 0000003|S TOPPING |APT 19 0000004|JD BROS LTD ...
0
votes
0answers
54 views

Files mysteriously disappearing

Today, I opened my music player to play a particular song, and couldn't find it. So I check the filesystem - the entire folder for that album is missing. I did a count of the entire contents of the ...
1
vote
1answer
54 views

Allow file to be read by only system command in a C Program

I have a C program program.c that contains a system("/bin/cat file.txt") command, where file.txt is a file in the same directory as the C program. Now I would like to prevent users to read file.txt by ...
1
vote
1answer
14 views

File for assigned inet addresses

I am using Lubuntu 14.04 with kernel 3.19 and can't find file where are inet addresses stored (etc. 192.168.1.11). Man page for ifconfig state files: /proc/net/socket #can't find at all /proc/net/dev ...
-2
votes
1answer
55 views

What does the -p option do exactly with the cp command?

So I am trying to understand what is the significance of the -p option for the cp command. I opened the manual of the cp command and it says -p same as --preserve=mode,ownership,time stamps. But ...
0
votes
2answers
38 views

How to count how many files belong to each user/group combination?

How to count how many files belong to each user/group combination? I need to do this for each user/group combination that exists, in each of the directory trees /etc, /usr, and /var.
0
votes
2answers
87 views

How to merge files with same names

I want to know how to merge files with same names For example I have following files in one folder: 1081713FHN-NA.one_.txt 1081713FHN-NA.second_.txt 1081713UEN-NA.one_.txt 1081713UEN-NA.second_.txt ...
3
votes
2answers
203 views

How to write contents of a file to new file removing repeated lines [duplicate]

For example, a file file1.txt contains Hi how are you hello today is monday hello I am fine Hi how are you After the processing of file1.txt it should write to file2.txt and contents ...
0
votes
4answers
94 views

grep all the lines in a file and write line to a file from the pattern matching point

For example, a temp.txt file contains information like below: adsf on line jhkjhvjdbvjvbvbdjkvn qerwtt on line fdgdgdgdd qwqertg on line safffasffaf wrt on line adaddsd I want to grep for ...
3
votes
1answer
29 views

Head Script output explanation

So this shell script: #!/bin/bash head >/dev/null; head; almost always gives the same output when called with sequential numbers (e.g. seq 10000 | ./sscript) OUPUT: //blank line 1861 1862 ...
0
votes
1answer
35 views

How to move (image) files to other directories based on files' dates

I have a directory (currdir) with 24000 images on a centos/cpanel server. I want to split this directory by moving images from this directory into other directories (or sub-directories inside currdir) ...
1
vote
1answer
28 views

What does when the file's status was last changed mean?

I'm reading about find and for one of the tests (-cnewer file) it reads: File's status was last changed more recently than file was modified. What is the file's status? It's obviously a date, ...
0
votes
2answers
55 views

How to concatenate files using initial part of filename

I have many files with names in the form username_pattern_suffix.ext where "pattern" is fixed, but there are very many usernames, each with several files (i.e. values of 'suffix'). I'd like ...
0
votes
2answers
57 views

How can I filter out current directory ('.') in bash?

I'm currently trying to write a little script to convert all the flac files to mp3 files. However, I ran into a bit of a problem when trying to set up recursion down into all my music folders - the ...
10
votes
1answer
235 views

How to sort a file based on a section of a field

I would like to sort a file : D104HN-D104HA 8.320 4.521 1.69e+05 -- D104HN-D104HB* 8.320 2.823 2.93e+05 -- A90HB#-A90HA 1.655 4.207 7.12e+05 -- ...
0
votes
4answers
92 views

Transferring executable files from Windows to Linux via WinSCP

Why file lose execute permission on Windows when it is transferred from Linux to Windows and vice versa?
1
vote
1answer
36 views

Ways to consolidate music folder

Having used iTunes for a long time, my iPod Classic finally started showing signs of dying. I bought a FiiO X5II and put all my music onto it's microSD XC card(s) using rsync to ensure the same folder ...
0
votes
2answers
26 views

search the most latest's file name

I am writing a bash script to look for a file which's file name is most recently and file name like: ... Wed_Dec_30_16:47:41_PHT_2015.zip Wed_Dec_30_16:00:41_PHT_2015.zip ...
1
vote
2answers
32 views

Extract a particular substring from filename

I am quite novice in bash scripting. The task I need to solve is extract a particular substring from each filename in a directory. Example file names: Bob Marley - I Shot The Sheriff-2XiYUYcpsT4.mp3 ...
2
votes
2answers
84 views

How to copy image files whose names don't end with their resolution size?

I have a folder with images in it and it is organized by year and month folders (ie. /2015/08/image.jpg). Whenever an image is added, it is also copied and resized like so: image-1024x768.jpg ...
3
votes
4answers
166 views

Why does mknod require root privileges?

I noticed that the mknod command required root privileges when a creating a node other than a regular file, FIFO or a Unix socket. Why is that? How can a regular user harm a system or compromise ...
2
votes
2answers
235 views

What are the use cases for write-only and write-execute files? [duplicate]

I understand use cases for r-- and r-x permissions, but not for the -w- and -wx ones.
1
vote
1answer
65 views

ls -lu does not give last access time

The manpage of ls says: -u with -lt: sort by, and show, access time; with -l: show access time and sort by name; otherwise: sort by access time but that doesn't seem to work: ...
0
votes
1answer
31 views

Sort words from n rows

i need to print all the unique words and their occurences from first n rows in a give file. I have to sorted by their number of occurences and then alphabetically.(the only separator is " ") ex: for ...
0
votes
0answers
42 views

mount directory cannot be seen from within apps

I have successfully mounted a local network location on my Android device to /sdcard/routersd with permission set drwxrwxrwx; I can successfully browse within this mounted directory and do copy/delete ...
0
votes
2answers
56 views

Sort words in file

i've got some problems i'm not capable to overcome. I need to count the first let's say N words in a txt file. Then , i have to print them in decresing order, followed by the number of occurences.The ...
0
votes
2answers
34 views

Insert path in file

I have the a file.dat and would like to insert the path of this file as first line. Can anyone help me with this please ? Thanks in advance
2
votes
4answers
143 views

Moving and renaming hundreds of .jpg files, all named 5003.jpg

So here's the deal, my girlfriend wants me to transfer all of her photos off from her iPhone onto her laptop (on which we are running Ubuntu 14.04). All of the dedicated programs I tried to do this ...
4
votes
1answer
73 views

Prevent processing file until SCP transfer is finished

Large files are transferred to a server for processing. The server monitors a specific directory using incrond and when a new file is received the processing script is executed for that file. Because ...
0
votes
0answers
50 views

Incorrect file creation/modification time

So I run a backup script on a home server running Fedora 23. I also run a prune script that removes files older than 30 days. This fresh backup file keeps getting deleted because it's creation or ...
3
votes
0answers
51 views

Reason for security software to not scan directories with more than 10,000 resources in them?

We have a security software on Linux which scans for exploits in files that exist in directories on the server (such as if websites had hack scripts uploaded to them). It defaults to a limit of ...
4
votes
2answers
365 views

Is there an inode for a directory?

Each file has an inode. Is there an inode for every directory ? If not, how does Linux manage directories.
1
vote
1answer
37 views

How to convert file from one format to another with file attributes?

I have an audio file named with attributes: BreakingNews.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz I wanted to convert it to in below format: BreakingNews.wav: ...