Use this tag for questions about file management and operations on files.
0
votes
0answers
5 views
Is there a way to see the dimensions of a jpeg file in linux using the command line?
I have some .jpeg images saved in a file in a cluster at school. I am at home using PuTTY to access one of the Debian nodes. I'm able to get to the folder with all the images but I need to see the ...
0
votes
3answers
16 views
How to apply dos2unix recursively to all the contents of a folder?
Is there a way to apply the dos2unix command so that it runs against all of the files in a folder and it's subfolders?
man dos2unix doesn't show any -r or similar options that would make this ...
0
votes
2answers
30 views
How to see information inside inode data structure
I can do an ls -li to see a file's inode number, but how can I list information inside a particular inode by using that inode number.
1
vote
2answers
29 views
Are all files outside of /home/userabc owned by root?
I'm writing a tar implementation for a package manager, and I wonder if I can skip the permission setting of the user in the tar headers and keep what is there by default, the user who wrote the ...
0
votes
0answers
11 views
Import Windows file into Linux Ubuntu VM [duplicate]
I have a Ubuntu/Gnome VM using Virtual box installed on an external usb drive. I have been emailed a ubuntu script recorded session from another user to my Windows PC. I want to be able to import ...
0
votes
1answer
24 views
How “Max open files” soft and hard limit are set for specific process?
I used the cat /proc/<pid>/limits command to check the Max open file hard and soft limit, but I want to know how this value will be set and can it be increased or decreased?
Is this value is ...
-1
votes
1answer
17 views
adding date to beginning of file name using script
I have multiple files that need to be renamed with a date added to the beginning of the file name that I am trying to script.
I'm using the cp command because I need to keep the original file
I need ...
5
votes
1answer
17 views
Clear recent open file history on Linux Mint
Sometimes others in my household briefly use my computer, when they do I sometimes don't want them to see my file history. I know how to prevent Bash from writing entries to the ~/.bash_history file ...
4
votes
1answer
41 views
File permissions on Linux?
I am surprised that /mnt, /media or even /opt are not writable by myself on my own system (Linux-Ubuntu). Should I always use sudo for any action on these paths?
Or would it be better to add myself ...
1
vote
2answers
30 views
How to apply an awk script to multiple files in one folder using a loop
I am trying to apply one awk script to all the files in one folder, I am using:
for %%i in (*.txt) do (awk -f NormalizeFiles.awk "%%i" > new\"%%i")
but then I get the message:
Syntactic error ...
3
votes
2answers
62 views
Changing a file's modified date based on date in file name
I have a directory full of photos with file names in this format:
IMG-20160305-WA0001.jpg. The date taken is obviously in the file title.
Unfortunately the date modified on all files is today. I ...
1
vote
2answers
44 views
Why does SCP fail when “RequestTTY force” option is enabled?
In my SSH config file, I have to enable the RequestTTY force for some important reasons. And currently my config file looks like this:
Host x.x.x.x
HostName yyyy
StrictHostKeyChecking no
...
1
vote
0answers
29 views
Deleted file being written to by running process, can I recreate it? [duplicate]
I've started a long running process with nohup and redirected it's output to a log file
Example:
nohup ./bin/zkServer.sh start-foreground > /usr/local/myuser/logs/zkout.log 2>&1 &
I ...
1
vote
1answer
23 views
How to clear data from all files present in a directory?
I have a folder which has some text files and other folders in it which in turn have more text files in them. I need a command which will recursively loop over the folder and clear all the contents ...
4
votes
1answer
27 views
Document Management System for Linux
So I got a problem and I hope someone knows the answer.
Basically I am looking for a DMS (document management system) for my music and movies. I have a huge amount of files, currently in folders but ...
4
votes
3answers
341 views
What's the quickest way to find duplicated files? [duplicate]
I found this command used to find duplicated files but it was quite long and made me confused. For example, If i remove -printf "%s\n", nothing came out. Why was that? Besides, why they used xargs ...
0
votes
1answer
27 views
Picking a set of files from a directory [closed]
I have some files in directory like below
333_XXX_<Timestamp>
333_YYY_<Timestamp>
444_XXX_<Timestamp>
444_YYY_<Timestamp>
where 333 & 444 are Account-Id's and XXX ...
-1
votes
0answers
32 views
I busted my ssl.conf file and when I do a recovery I can't overwrite the file with new settings
So, I thought I would be super smart and figure out how to disable the older SSL v2 and v3 on the web server. Turns out I messed something up.
So, I tried to open the file and then make the changes, ...
3
votes
3answers
92 views
How can I test if a file in /root exists without su to root?
My OS is Ubuntu 14.04 LTS.
I got a file /root/1.txt, and logged in with 'yu', who doesn't have read permission on this file.
When I use the code if [ -e /root/1.txt ] , it returns false.
I know I can ...
1
vote
0answers
39 views
how to limit file manager access based on users on Ajenti
I installed Ajenti-v on my ubuntu server 15.10 and I want to create multiple users with specific access to their home directory.
currently, whenever I create a new ajenti user (which is synced with ...
0
votes
1answer
12 views
linux + sysctl.conf configuration
Is it right to comment line with # in the file sysctl.conf?
I ask because I am not sure if the comment lines would be read or not.
more /etc/sysctl.conf
#net.core.rmem_default = 1048576
...
0
votes
0answers
19 views
What does @ indicate in long file format? [duplicate]
NOTE: Don't know if this matters, but I'm running commands on OS X Terminal.
What does the @ indicate about a file when it is listed in long format, ala:
-rw-r--r--@ 1 <user> <group> ...
0
votes
1answer
24 views
Change last edited date [duplicate]
How can I change the last edited date of a file?
There doesn't seem to be anything like:
chlastediteddate 12/7/12 file
What command can do this? Is there a way to do this without changing what the ...
2
votes
1answer
60 views
Create a file of fixed size with specific contents
I want to create a file of fixed size (1G, 10G, 100G etc) with a single random word of length within the specified limit on every line. I basically want this to run a benchmark which will sort the ...
4
votes
3answers
50 views
Split file by number of lines including header in each one
I need to split a .txt file into smaller ones containing 100 lines each, including the header. I don't know if this is relevant, but the original file is delimited like this:
COLUMN1 | COLUMN2 | ...
2
votes
2answers
63 views
find: delete folder and sub folders but add exception to two files
I am trying to use the find command to do the following:
Delete a whole folder with files, folders and subfolders except for 2 files, here is an example of what I need:
test/folder1/file1.txt
...
0
votes
1answer
40 views
How can I execute any command as a normal user without sudo?
Is it possible to assign the sticky bit to sudo in order to execute any command as a normal user?
Let's suppose that we have the user test and then:
test@test$ apt-get update
But I don't wanna use ...
3
votes
2answers
80 views
Restrictive “group” permissions but open “world” permissions?
I understand that with Unix file permissions, there's "user", "group", and "world" octets. For the sake of this discussion, let's assume that setuid/sticky bits don't exist.
Consider the following ...
3
votes
3answers
43 views
Get lines between two timestamps from a file
I have this large file that I need to go through using date and time.
Every line in this file has a date and time in it.
I need to search through the lines and get the lines that lie between two ...
3
votes
1answer
25 views
reserve disk space before copying files
I would like to reserve (or is the keyword "claim"?) some amount of disk space before an rsync occurs so other programs will believe a disk has less space (because after the rsync, the disk will have ...
1
vote
1answer
38 views
Creating a virtual file whose contents are determined programmatically [duplicate]
Is it possible to create a virtual file in unix, whose contents are determined programmatically when the file is accessed, a bit like the files in /proc?
For example, I have a program that retrieves ...
1
vote
3answers
54 views
Is there a faster way to find specific files than using find?
I have to find in a folder the files not having certain permissions (755). The sub-directory has other sub-directories containing in total millions of files, and the find ./ -not -perm 755 command it ...
0
votes
1answer
43 views
Copy last n-lines from one file to another
In the context of adding the same lines at end of the .bashrc or .vimrc files of several user accounts on the same machine, what would be an easy way to copy the last n-lines from one shell script to ...
25
votes
8answers
3k views
Is there a convenient way to classify files as “binary” or “text”?
Standard Unix utilities like grep and diff use some heuristic to classify files as "text" or "binary". (E.g. grep's output may include lines like Binary file frobozz matches.)
Is there a convenient ...
0
votes
2answers
31 views
Create a list of files in a directory with a certain char
I would like to be able to list all files within a folder which have a certain character as the third character. For each file, I then want to be able to perform an action, maybe delete or move. ...
1
vote
1answer
36 views
How to organize files in Linux/Unix shell?
I would like to try to organize my documents, and I was told that I can do this using the linux/unix cygwin terminal. I searched for the command in google but all I ever did find was organizing the ...
1
vote
1answer
29 views
How to search recursively within several levels of embedded tar tgz files? [duplicate]
Can somebody help me to figure out a command to find a file recursively that is embedded in a tgz file which is within another tgz files recursively:
MainFile.tgz → SubFile1.tgz → SubFile2.tgz → ...
1
vote
2answers
31 views
How to know the path of a running executable?
I am working on a Linux server, and I running different jobs on different node.
However, when compiling my program, I didn't set their specific name, so they are all a.out
Now I found one of the ...
0
votes
1answer
23 views
Broken files after moving them back and forth [closed]
I have different partitions for / and ~, both with ext4 filesystems. In ~, I have a folder with many files, I tried to move the complete folder to the root partition
mv ~/folder /folder/
In the ...
2
votes
1answer
28 views
According to what does GNOME purge the trash “30 days later”?
In GNOME 3.18 Settings > Privacy > Purge Trash & Temporary Files, one can configure the desktop environment to automatically empty Trash "after 30 days".
The description here isn't very clear. ...
1
vote
3answers
33 views
Rename only one file in each directory, based on condition
I have 100 folders inside every folder I have one or two files named as the following:
XXX_001_014_max.jpg
XXX_001_024_max.jpg
I saved the folders names in a file "list.txt"
I ran the following ...
1
vote
0answers
22 views
How to remove a single quote from a file name? [duplicate]
I have some podcasts on my radio server which contain a timestamp when they should be played. I noticed one of them is put into single quotes 'filename.mp3', and I'm unable to remove them. Check this:
...
1
vote
1answer
33 views
Creating if/than statement to move files to another location based on value of 1 column?
I have thousands of xyz (latitude,longitude,elevation) text files that I want to separate by latitude or longitude. How and what commands could I use to create an "if latitude(column1) is greater than ...
0
votes
1answer
25 views
Delete files between two dates
I have a folder in which there are very old files. It contains files since 2009 and they are dump files with error log.
What I want to know is if it is possible to delete the files between let's say ...
0
votes
2answers
28 views
File Size Limit
What is the maximum file size limit in rhel 32 bit OS, is there any OS limitation for the file size , if there is any limitation set then please tell me what will be for root & oaa.
6
votes
1answer
225 views
Have a 'file' generate its content on demand? [duplicate]
Is there a way that I can have something which appears as a file, but when being read some code executes which fills the content of the file "on the fly"?
Like FIFO/ named pipe, but without the need ...
3
votes
3answers
118 views
Add mtime to grep -c output and sort the output by mtime
I have a directory full of logs named in the following style:
info.log00001
info.log00002
info.log00003
...
info.log09999
info.log
My current output (using grep -c)
I need to analyze the ...
-1
votes
1answer
51 views
Organize a file [closed]
I want to thank the great help and support. Well, I have the following file:
name id alello chr pos snp
s1 215 a 1 11 a215
s1 216 a 1 11 a216
s1 217 ...
-2
votes
1answer
63 views
When a particular file arrives then execute a procedure using Shell Script [closed]
When a particular file for eg: "abc.csv" file arrives into a directory for eg: "mydir", I need to execute a procedure using shell script.
"There was a procedure which will load data from csv to table ...
1
vote
1answer
34 views
Interactive remove files listed with paths in text file
I am trying to interactively remove files listed with their paths in a text file.
The command I am trying is:
xargs rm -i <filelist.txt
The error I get is:
rm cannot remove ...