Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [files]

Manipulating files: copying, renaming, searching, analyzing, archiving, etc. For operating on text in a file, see /text-processing. For questions about the Files file manager (formerly Nautilus), see /nautilus.

0
votes
0answers
6 views

How to use “netatalk” to share files between my Mac and AWS EC2?

When I use the ubuntu machine at the office, a very nice feature is that I can share files in my finder just by drag & drop between my laptop and the ubuntu machine. But it doesn't work when I try ...
0
votes
1answer
21 views

find and move files without overwriting and with output

I'm trying to find and move some files from /home/user/fol1 to /home/user/fol2. Generally I would use find . -type f -name "abc*" -exec mv -t "/path/to/foo/bar" {} + but this overwrites files with ...
0
votes
1answer
30 views

Change file name while copying based on source path

I have a large number of files in directories of the format */*/*/*/*.txt and I would like to copy them into a different place while replacing the forward-slashes in the path with underscores. For ...
2
votes
1answer
51 views

Prepend line that contains {} in files recursively using find and sed

I want to prepend recursively all files ending with .ts with this text: export {}; and I need to exclude at least the folder node_modules. I tried: find . f ! -path '*/node_modules/*' -iname "*.ts" -...
0
votes
1answer
87 views

is it possible to avoid open files? [on hold]

when we run lsof to capture deleted files , we see the following: ( example ) lsof +L1 java 193699 yarn 1760r REG 8,16 719 0 93696130 /grid/sdb/hadoop/hdfs/data/current/PLP-...
0
votes
1answer
37 views

List files that are not H264 encoded

I want to convert any files in a large media collection that are not encoded with H264. In order to do that I need a tool to list all the files, I need to convert. There are a lot of files to go ...
0
votes
0answers
30 views

opening editors on files with invalid characters in them

In my use case, I have a lot of text files containing invalid characters. When I search through those files, e.g. grep "some text" /home/bla/blubb/* | xargs editor_of_your_choise I'm getting the ...
2
votes
2answers
224 views

I'm not getting cube of the number

while [ "$c" = y -o "$c" = Y -o -z $c ] do echo enter a number; read n; if [ $n -ge 0 -a $n -le 50 ];then echo "cube= `expr $n * $n * $n`"; fi; echo y to continue or any to exit; ...
1
vote
4answers
51 views

Using an if statement to see if files are in a folder using a wildcard [duplicate]

I have to process multiple files that I dont have the entire name for. I am running an if statement using a wildcard. for example... if [ "ESGSN_*.SMS.EDR" ]; then echo "There are files to ...
0
votes
2answers
26 views

Renaming part of name of all files in a directory tree if match

I have a directory tree like this . |-- players | |-- red_alice.plr | |-- red_bob.plr |-- resources | |-- red_cash.rsc | |-- red_food.rsc I want to go through all directories and rename any ...
1
vote
1answer
37 views

Checking the number of files in a specific folder

I have 100 folders (called "Folder_1", "Folder_2", "Folder_3", ...) containing several files. From a loop over each folder, I would like to run commands (i.e., display the folder name) depending on ...
5
votes
0answers
93 views

Why does one kernel work, but the other doesn't, when they are identical to the byte? [closed]

I have a couple of scripts, that build Linux live CDs for me. I have a couple of kernels, that I built myself to use for these. Having built one such Live CD a couple of weeks back with a kernel, ...
0
votes
2answers
34 views

Check if any file exist in a folder when traversing through it

I have this script: local_dir="/some/dir1/" cd $local_dir for i in *.* do # do something ........ # [...........] rm $i done It throws an error when the folder is empty. *:...
2
votes
0answers
136 views

How to edit a 100GB file in Linux?

I have a file that has several times my RAM capacity and I need to edit it, search for some expressions, etc. I've tried Vim (with LargeFiles plugin and CTRL + C trick), joe, shed all without luck. ...
0
votes
2answers
33 views

How should I merge two folders on the same filesystem?

I have two directories that look something like the following but with many more files. folder1/pic1.png folder1/test/readme.txt folder2/guest.html folder2/backup/notes.txt I want to "merge" these ...
2
votes
4answers
235 views

Parse all strings of specific length?

I've exported my email archive of 10 years which is very large. I want to parse all the text for any string that is 64 characters long in search of a bitcoin private key. How can I parse strings of ...
2
votes
1answer
52 views

xxd with 64 bit addresses

I find xxd to be nice and convenient for simple manipulation of binary data in the terminal. However it has a limitation in that all addresses outputted by the program is limited to 32 bits. E.g. ...
1
vote
0answers
74 views

Higher privilege level than root on macOS [closed]

MY version of the macOS is 10.13.6 What I want to do is get a privilege that is higher than the root privilege. The reason I want this is because I would like to create a completely undeletable file/...
2
votes
0answers
63 views

Linux access windows share without loading to RAM

I have a laptop running an Arch-based Linux system and frequently need to access a windows share at my workplace. This is really annoying since it takes ages to load. Particularly, one folder is ...
-1
votes
0answers
27 views

Deletion of a line in a file using perl on solaris

I am trying to delete a particular line in a file using a perl program on solaris. I tried sed but it is not working. I tried sed /pattern/d filename but it failed. Then I realized that I was ...
2
votes
0answers
20 views

how to output html to a file with xmllint?

How do I get xmllint to output to a file? thufir@dur:~/xmllint$ thufir@dur:~/xmllint$ xmllint --html http://www.skynet.be/nieuws-sport/weer/mijn-weer?cityId=6450 --xpath '//div[@class = "tides"]' - ...
0
votes
1answer
34 views

join all text files in subfolders in ubuntu into a single file

I have many folders/subfolders with text files in them. Is there any way to iterate all of the subfolders and join all the files into a single large file?
0
votes
2answers
53 views

Folder group ownership permissions and problems

I have created a folder called /home/projects, to do this I had to use sudo mkdir /home/projects because it's inside the home folder. Initially the folder had these permissions: drwxr-xr-x 4 root ...
0
votes
1answer
56 views

Identify the file type if ls -l shows ? (question mark)

I am getting question marks and not able to identify the type of file displayed using ls -l. File types are always displayed as ???. Can you suggest a solution here?
1
vote
3answers
48 views

Create text files from each link in a list?

I have a file with links like this: http://domain.com/file_name1.mkv http://domain.com/file_name2.mkv http://domain.com/file_name3.mkv ... and so on. I want to create a file for each link with ...
0
votes
3answers
63 views

Move line that matches pattern to top of file (multiple files)

I've got a folder containing roughly 4000 text files, each of which contains an email and its headers. I want to convert all the files in the folder to one .mbox file, but to do that I need every ...
2
votes
1answer
53 views

How to zip directory excluding symbolic links and the files they point to?

I have a directory with files, subdirectories and symlinks How to zip only files and folders from that directory without symlinks or files referred to by the symlink?
-6
votes
1answer
49 views

binary file decrypt [closed]

I want to see the message inside this binary file: ]�$�r�ux����f��aY64QH���K�z{������y�ߗ��y�m����Ǖ�} ��cy@^��+|�%E(H��*�I�P�����7��8�=$�.�`ïc� ...
1
vote
2answers
202 views

ls -I myExecutable is listing the rest of the dir files instead of showing info about the file

Working on Raspian, after compiling using make, I do a ls -I myFile in order to see the permissions of the file and if it is marked as executable as it should and instead of getting something like ...
0
votes
0answers
58 views

Input/Output error after moving files on external hard-drive

I have an external hard-drive for saving all my photos/memories. I put all the pictures to the folder INTENSO/Handy-Backup/IPhone/DCIM/. Because I resetted my iPhone, I wanted to move all the old ...
0
votes
0answers
24 views

What are the contents in /sys/block when ubuntu is a virtual machine?

I am very confused to how /dev/dm-1 was being used as a swapspace by my Ubuntu guest Virtualbox VM. gparted doesn't show these drives. What is going on here? How does the same drive dm-1 have ...
0
votes
2answers
88 views

How do I make a file in a user's home directory uneditable to that user but leave the home directory editable?

I've tried a LOT of stuff with chmod and chown, and combinations thereof. I still want the files in the home directory of this user to be readable to the user, just not writable or executable. ...
0
votes
1answer
46 views

Linux mint files color changed in terminal

I am using Linux Minter 19.0 on two machines. I have a src and destination folder. My src folder is on my local machine, and the dest folder is on a remote machine. I ran rsync to move files from ...
3
votes
2answers
93 views

print the first line of those files in current directory which are having last line with a pattern

I have multiple log files in a directory and want to print first line of those files which are having pattern vanished on last line. Could it be done with awk for *.logs having also printed name of ...
1
vote
2answers
72 views

How to split a large folder into smaller folders of equal size [closed]

I have one big folder with many file types in it (e.g .txt, .sh). It's about 40Gb. I would like to split it into four parts of 10Gb each. How can I achieve this?
0
votes
0answers
36 views

Open file manager as root resulting in repeated password requests.. why? Any solution?

With the new Ubuntu 18.04 base of the Linux Mint 19, I had to change my Bash function in .bashrc in order for it to work as follows... I am running the following as a user, it is supposed to ask for ...
2
votes
0answers
16 views

Macs unable to open shared files hosted on FreeNas because of temp files

We have a nfs share server (running FreeNas 11.2) mounted trough automount on which we store multiple *.xls files. Since a few days, two MacBooks refuse to open those files with the following error ...
0
votes
3answers
60 views

Demonstrate file encoding

I am developing some training and would like to demonstrate file encoding. What I am trying to accomplish is create a text file with one type of encoding that show up as nonsense when read by Linux. ...
2
votes
1answer
27 views

Writing to /root/workspace doesn't break the files inside encrypted partition

I have made full disk encryption on my hard disk exactly as in this guide https://web.archive.org/web/20180428191153/http://thesimplecomputer.info/full-disk-encryption-with-ubuntu Partition table: ...
-1
votes
0answers
15 views

Choosing a tool for two-way syncing folders over internet on CentOS [duplicate]

I'm looking for a tool which can sync files and folders over internet on CentOS 7. It better run as a daemon in real-time or short delay when files/ folders changes. I need to sync multiple folders. I ...
-1
votes
0answers
18 views

Static Tomcat Site on Ubuntu - unable to reach files/directory with white space in url?

I am migrating a legacy image hosting server from Windows with weblogic to Ubuntu with tomcat. the server provides images directly from the file system with URLs mapping to the physical. I have ...
1
vote
1answer
89 views

I want to find if a word exists in a file

I have a directory with some files. I want to know if a word exists in each file. $1 is my directory that I give it as a parameter e.g. ./myscript.sh /mnt/c/User/er/Desktop/shows I have written ...
0
votes
1answer
39 views

Creating text files in every sub-directory

I have a directory hierarchy named, for example, abc and a text file names.txt. I need to choose several lines from the text file and then create new files with sample text, say "Hello world", in ...
1
vote
2answers
30 views

Search recursively each row on a file to another file and print the output to new file [closed]

I need to get a listing of thousand of servers living on virtualized environment. On a file I have something like this: Name Host sysserver0012 btesxid432.eu.domain.com sysserver0015 ...
0
votes
2answers
42 views

Would a forked child always get same File ID as parent's file ID?

This might be a naive question, but given in parent open call returned me File ID 4. Is it guaranteed that child process will always get a File ID of 4 as well ?
0
votes
1answer
49 views

Searching files in $PATH

I have some folders specified in my PATH environment variable. How do I list all the files in these folders?
0
votes
1answer
84 views

Does constant writing to “files” in `/proc` or `/sys` reduce the life of my SSD due to its limited number of writing cycles?

My laptop has a SSD drive and I run a script which writes every other second to /sys/class/thermal/cooling_device4/cur_state. I don't think this would count as writing to the SSD and thus reducing its ...
-1
votes
3answers
94 views

How to prevent “rm -rf ~” from being executed by mistake?

Is there any way to completely prevent this command from being executed, by mistake, in the terminal? I know that bash, for instance, has aliases. Is there a way to use them?
1
vote
0answers
42 views

Installing software in home partition instead of root partition?

/home (the rest) / (100GiB) /swap (6GiB) /boot (200MiB there are vital basic operating system packages like the coreutils and binutils, then there's the "optional" like virtualbox or okular thing ...
0
votes
1answer
33 views

What happens if we, recursively, change folder permissions after changing files in it?

What will these below commands actually do? chmod 777 /yoda/htdocs/cups/logs/* chmod -R -f 777 /yoda/htdocs/cups/logs/ When I check the file permissions in ..../logs folder, they are showing as -...