2
votes
1answer
42 views

Linux Unzip with exclusions from .txt file

I have an unzipping script on Linux. It attempts to unzip with the command: unzip file.zip This is obviously successful. I now wish to exclude some files. The manual tells me of the -x option. I ...
1
vote
1answer
22 views

Is there a method of pre-pending one text file to another much larger text file without cat?

I have a 330 Gb file and 10 lines of text I'd like to pre-pend to the file. I don't particularly want to write out all 330 Gb again, just for 10 lines of text. Is there some low level command that ...
1
vote
1answer
28 views

Show one folder's content in other folder

My question is about Linux. I have 2 folders - /home/user/first and /home/user/second. In the /home/user/first there are some files. The second folder is empty. What I want to do is to have ...
0
votes
0answers
14 views

Is it safe to truncate a TC file volume when I need more space from it?

Unless there's something important at the end of them, I plan on writing a script that extends/shrinks these files as I need them. So could I be wrong to try to extend/shorten a perfectly good ...
1
vote
1answer
55 views

Linux Bash Shell - File globbing specific range?

I have a bunch of files in a folder: spreadsheet700.xls spreadsheet800.xls spreadsheet850.xls spreadsheet1005.xls spreadsheet2400.xls how can I use file globbing to select files that numbers end in ...
1
vote
1answer
186 views

How to create destination directory structure dynamically when using mv with wildcards in bash?

I'm pretty new to BASH scripting and I'm looking for an elegant way to solve my task: In a given directory certain files regularly have to be sorted into subfolders. The name of the files has a fixed ...
1
vote
2answers
204 views

How to open files with colons in their names in Windows?

I have some files on my C drive with colons in their names. I'm pretty sure they were created in some Linux distro I used before. I know Linux supports colons in file names, while Windows does not. ...
2
votes
1answer
40 views

Hex of filesize

I am following a tutorial on few kernel dev. I encountered an operation where I have to use dd like dd ... if=PBL.bin of=... count=block_number The block_number variable is defined to be as The ...
0
votes
0answers
13 views

Accidental broken file transfer - merge separated directories?

I'm using an online service which is transferring files (TBs) between two servers. I accidentally moved one of the directories on the destination drive, and a new one was created with the continuing ...
0
votes
1answer
66 views

Capture logrotated files on change

This is something rather special, but I bet you can help me out. I'm working in an environment where many logfiles are generated and rotated, mainly from java-services runnning. As we are performing ...
1
vote
2answers
52 views

Using wc on a file while it is used by other program

I am generating a text file that in the end will contain roughly a billion entries. The file is generated by a program that writes to it every couple of seconds. For this it always opens the file and ...
1
vote
1answer
44 views

Does “everything is a file” apply to network printers?

I asked this question on AskUbuntu and I didn't get any answers or comments, so I thought I'd try here. If "everything is a file" in Linux, can I access network printers (IPP) like USB printers ...
0
votes
2answers
448 views

How to create a random .txt(Human readable text like ascii) file in linux

I need to create a text file which should contain random text data that can be read by human. I know that we can use /dev/urandom and /dev/random for getting random data. But it is not readable by ...
0
votes
1answer
60 views

List permissions all parent directories of a single file [duplicate]

Say I have a file located at /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/java. I want to list all its parent directories in order to view their permissions in order to get something like ...
0
votes
2answers
35 views

ls -lrt showing file which is not present

When I do ls -lart in my current working directory it shows lrwxrwxrwx 1 root 10004 36 Dec 16 17:59 index.html ->/home/moviebeam/assets/ui/index.html But I cannot see contents of the ...
0
votes
2answers
52 views

Is there a Windows file format with <CR>-separated records (without <LF> characters)?

Today a file was extracted on a Windows system, Windows 7 to be exact, and ftp'd to a Unix system. The application that processes the file deliberately failed, because the file had one line in it, ...
3
votes
1answer
308 views

How to find a file whose size is less than 10 MB?

I need to find a file in my current directory whose size should be less than or equal to 10 MB. ls -lh gives me the file size of each file but not sure how to find the files whose size are less than ...
4
votes
2answers
79 views

What is file ']' ? How is it created?

I wonder how this file got in my directory? When I run ls -lrt it shows -rw-r--r-- 1 and size 117562 . Can I get any directions for this?
1
vote
0answers
38 views

VMware Virtual Machine recover files without mounting

I transferred the directory with my VMWare Virtual Machine Linux Mint to a new harddisk. I didn't know that I had to change the directory path in the VMware settings, so I couldn't mount my Virtual ...
2
votes
2answers
625 views

Unable to write files on CentOS

I have a VPS running on CentOS 6 and apache2 as webserver. I have several PHP scripts running in my server, and everything goes smooth, except to file writing. For some reason, my PHP scripts are ...
1
vote
2answers
103 views

Are there any issues of have huge files in HD in a 32 bit system?

I know that in 32 bit systems the largest memory we can have is 4GB (2^32). But I am not clear what is the implication of this in terms of files. I think that we can have files of arbitrary size in ...
1
vote
1answer
4k views

How to interpret and fix a Input/output error in Linux?

I am running a daily backup with rsync. Starting some days ago, one of the files has been throwing this error during the backup: rsync: read errors mapping "/home/folder/file.ext": Input/output error ...
0
votes
1answer
41 views

Reading a file from an alternate location

I have a certain file (data.abc) located in, say, my home folder. I make a copy of it to another location (for example, "/mnt/ramtemp/"). Whenever the file in my home folder is accessed by any ...
0
votes
1answer
36 views

How can I know what subfolders rm -rf attempted to delete first?

I mistakenly run rm -rf on a wrong folder and than cancel the operation after two seconds. The folder is quite big with many subfolders and maybe 1% was deleted. How can I know what subfolders rm ...
2
votes
2answers
159 views

How can I copy a folder from the Linux command line (ssh)?

Say I'm in the / folder in a remote Linux machine I connect to over ssh. There's a folder called testapp. /testapp I want to create an exact copy of this called: /testapp-staging Using a GUI I ...
1
vote
1answer
49 views

Multiple File Splitting in Windows or Linux

We have a 21TB LUN full of images that are approx 600K in size in multiple sub folders on the disk. We are trying to split the 21TB LUN into 8 smaller LUNs that are about 2.6TB a piece in order to ...
0
votes
1answer
22 views

Nano usablely open second file

Is it possible to open second file into Nano text editor not by browsing files in program interface (it's not so usable because you can't do nothing like search etc in it) but in command line or in mc ...
1
vote
4answers
1k views

How to rename files and replace characters?

I have a group of files that have : (colon) within the name. I need to replace the : with - (dash). Is there an easy way to do this in a script? Sample FileName: ...
1
vote
2answers
2k views

Renaming multiple files at once with a pattern on Ubuntu

I have around 300 files named some_name_123456789.zip another-name2_987654321.zip something(1)_123454321.zip [2]something_987656789.zip I need to rename them all to ds_123456789.zip ...
0
votes
1answer
51 views

Is it possible to have dynamic files with the contents being at some internet resource? [closed]

Maybe this is a stupid question, because, if this was trivial, Dropbox and other similar tools would have made use of the functionality. And if it was trivial it would create horrible security holes. ...
0
votes
2answers
89 views

Why do linux kernels include files for all devices?

The kernel for my device includes so many files for other devices and situations that my device cannot use. The kernel carries around the files for everything and is much bigger than just the files ...
-2
votes
1answer
96 views

Bash- how to select a directory based on the number of files it contains

I want to select all the subdirectories in a given folder that have a certain number (in this case, 75) files within them. Then I want to take the name of each of these subdirectories and assign it a ...
3
votes
1answer
1k views

How to extract text from a large file, starting at first occurrence of string?

I have a large log file I want to review. All the bad stuff starts at the certain occurence of an error string. I want to then look at the last x lines from that point and see what might have caused ...
3
votes
2answers
111 views

How can I tell how long a particular file has been in a directory?

I want to find (and delete) all files from a directory that have been in the directory longer than X days. I know that I can find files that haven't been modified in an hour with find /directory/* ...
0
votes
0answers
79 views

I can't answer my Windows drive from PCManFM

I have a Windows installation and a Windows installation. I'd like to get onto my windows drive and copy some files over to linux without rebooting, but when I open up my file manager (PCManFM), and ...
4
votes
2answers
202 views

Linux command line / Move files filtered by lexicographic order

I have some files in a directory that are named IMG_0001.jpg ... IMG_9999.jpg. I want to move to another directory the files that lexicographically have a name greater than IMG_9431.jpg How can I do ...
2
votes
3answers
203 views

How can I find all files on a folder tree that have a none alpha numeric characters in it

I have taken over from someone else a lot of historic data. However the file names are totaly random and badly formatted IMHO. To start with I want to get a list of all files that contain spaces, or ...
0
votes
1answer
57 views

Copying File From One User To Another

So I have this file stored in my account. It's postgres dump. To be able to use postgres it seems that I have to execute the following command 'sudo su - postgres'. Once I do this I am now working as ...
0
votes
1answer
65 views

Difference between 'du' and 'du -b'?

root@host:/var/log/apache2# du access.log -bh 753M access.log root@host:/var/log/apache2# du access.log -h 1.2G access.log Why is there such a huge difference in size for the same file?
0
votes
0answers
19 views

How to transfer files between drives? CentOS [duplicate]

I'm basically going to get an SSD for my Dedicated server. All my current files are on the SATA drive. If I were to make the SSD my primary drive, how would I transfer over all the SATA files to it?
0
votes
2answers
435 views

Tar - Remove Common Prefix When Creating Archive

I am attempting to tar up the contents of a root file system, located at $rootfs. The problem is, when I try to tar -c $rootfs > $dest, the directories between my current directory and the actual ...
9
votes
2answers
647 views

Shrinking file size under Linux

I want to shrink a file's size by brute-force, that is, I don't care about the rest, I just want to cut the file, say by half, and discard the rest. The first thing that comes to mind is Perl's ...
7
votes
1answer
3k views

What is the file “libpeerconnection.log”?

I never had before the file called libpeerconnection.log. If I delete it, next time that I begin a new linux session, immediately appears. I found it in my :~$ home folder. I open it and the file is ...
0
votes
1answer
64 views

How to delete files carved by Scalpel?

Scalpel is a Linux utility which is traditionally used to recover files on the basis of file signatures, that is in a manner that is unaware of the file system. Can we also use it for doing the ...
0
votes
2answers
380 views

Using a file input as stdin for a shell script does not work

I have the following script code: test.sh echo "BEGIN" while read CMD <&1; do [ -z "$CMD" ] && continue case "$CMD" in start) echo "get_start" ;; ...
2
votes
1answer
93 views

Unable to delete file via quoting, escaping or using inode

I wrote a Perl script and fat-fingered the name of my output file inserting a space in the file name, so now I have my_file .txt I have tried the following with no success (and no errors reported): ...
1
vote
2answers
165 views

Linux, Unix, Windows… Is access/modify time relative to system time?

I have searched, but can't find the right terminology. For example, if today was Friday, and a file was modified on Wednesday, then when I change the system time to Saturday, does the file's mtime ...
0
votes
0answers
20 views

Log what processes accessed to a file [duplicate]

I am searching for a program to log pid of any process that access to a file. I think such program may be a kernel module.
0
votes
1answer
122 views

Folder invisible in file manager, but shows up in terminal with Ubuntu 13.04

I'm running Ubuntu 13.04 64-bit and I have a directory with 2 folders and a file in it. The problem is that only one of these folders is actually visible in the visual file manager: You can see ...
0
votes
2answers
161 views

Copy file from my local machine to itself using network

Is it possible to send a file from my local computer to my local computer through the network? (Linux prefered) It must use the network because my goal is to check the transfer speed. I don't use two ...