Questions tagged [directory]

A file system structure in which to store computer files.

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

Take similarly named fastq files on a folder and amke them input for an script(on pairs)

I have a set of files named like this inside a folder: AM11_BW415_R1.fastq.gz NAM13_BW968_R2.fastq.gz NAM17_AC_Barrie_R1.fastq.gz NAM3_PI648600_R2.fastq.gz NAM7_Glenlea_R1.fastq.gz ...
1
vote
0answers
14 views

How to move files with a particular timestamp in linux?

I want to move some files from /usr/local/packageA directory to /usr/local/packageB directory. I accidentally installed both the packages in the same directory and want to move the files which were ...
-1
votes
1answer
59 views

How to copy files one by one to different folders?

In a directory I have files with the names: 01.txt 02.txt 03.txt In the same directory are folders with the names: 01.abc 02.def 03.ghi I need a command to copy the files to the folders one by one,...
0
votes
0answers
5 views

Window minimizing when ROS checking log directory for disk usage

I would like to have a window maximized 24/7 but it is minimizing every time when the ROS log directory is checked for disk usage. Getting message Checking log directory for disk usage. This may ...
0
votes
1answer
32 views

to apply counters on directories inside a folder

I've a folder structure like this: drwxr-xr-x 2 root root 4096 Jun 30 21:34 dir_0.0.1_2 drwxr-xr-x 2 root root 4096 Jul 2 23:45 dir_0.0.1_1 -rw-r--r-- 1 root root 24 Jul 3 00:03 a.sh drwxr-xr-x 2 ...
2
votes
1answer
35 views

Can we preserve the timestamp of parent directory after modifying the files inside it?

I have a folder structure: /home/us3r/scripts I've some scripts inside the scripts folder. Now, i want to preserve the timestamp of the scripts folder even if someone does a vim and saves any of the ...
6
votes
1answer
313 views

Why can't you move another user's directory when you can move their file?

Following on from another user's question I've bumped into a quirk of Linux filesystem permissions that I can't easily rationalize: sudo mkdir ~/foo ~/foo/bar sudo touch ~/baz mkdir ~/my_dir chown ...
0
votes
1answer
38 views

Move files to specific folders based on name

I have this file/folder scheme: /Aula /Aula01 /Aula02 aula-01.1.mp4 aula-01.2.mp4 aula-01.3.mp4 aula-02.1.mp4 aula-02.2.mp4 aula-02.3.mp4 All the mp4 files are located in the root directory (...
2
votes
4answers
71 views

Delete folders but keep 20 newest, 7 days old

I am looking for a way to delete folders that are older than 7 days, but always have 20 newest folders. similar named folders with _SAME_NAME_@tmp should be deleted as well. I'm stuck with making ...
-4
votes
2answers
48 views

Forgot to put a slash before download path, where were these files downloaded to?

I forgot to put a slash before my home folder when downloading some files and it seems that they downloaded successfully but I can't seem to navigate before / within my thunar explorer so I can't get ...
0
votes
1answer
72 views

How do I write a shell script to flatten directories?

I wrote a simple script to delete useless files from a directory using the find command. Now I'm wondering if I can add lines to the script to flatten directories, but not completely flattened. e.g.,...
0
votes
2answers
21 views

User for group able to delete file even though the user has only read access to the file through group

I have a directory with the below permissions: drwxrwsr-x 3 john ro 20K Jun 20 14:48 logs I logged in as john and touched a new file inside logs: -rw-r--r-- 1 john ro 0 Jun 20 14:48 d From my ...
0
votes
0answers
29 views

Can tmpfiles.d remove only files but not directories based on time?

I want to empty /scandir/ of all files including files in sub directories but I don't want any directories themselves removed, which is what happening with the following in /etc/tmpfiles.d/test.conf: ...
2
votes
2answers
37 views

authorize wheel group to rm in specific folder

I would like to authorize wheel group to rm in a specific folder (in this case my folder is "CT"). I've tried to add this line in visudo: %wheel All=(ALL) /bin/rm /CT/ I have a test files "test1" ...
2
votes
4answers
37 views

how to cut first 3 folders from this echo “/home/test/var/opt” ? i need the result “/home/test/var”

How to cut first 3 folders from a string? For example: echo "/home/source/Oracle/test" |cut -d'/' -f4 gives only one folder name, but I need up to the 3rd folder, like below: echo "/home/test/...
1
vote
1answer
51 views

Tools to lock/encrypt folder in debian

Is there any tools to encrypt folder except encfs for debian?
1
vote
2answers
51 views

Command for getting path to mount point of current partition/drive?

Is there an alternative command that does the same thing as findmnt -T . -o TARGET |tail -n 1? Example: If my current working directory is /media/username/HDD/subdir1/subdir2, that command would ...
0
votes
1answer
16 views

Explaining xargs output from two find commands

I have a directory structure of folder1 folder2 folder2a folder2b folder3 folder3a folder3b I am confused by the xargs output of the below command: XXXXXX:folder1 user$ find . -type d -...
0
votes
2answers
29 views

Copying diff results files

I have two folders - Folder A and Folder B. I compared the files from both folders using diff command. Now after finding that certain files are only available in Folder A and Certain files in Folder ...
1
vote
2answers
58 views

Why does `find -type d -exec rmdir {} \;` command produce “No such file or directory message”

For testing purposes, I created the following directories. user@linux:~$ mkdir dir0{1..3} user@linux:~$ ls -l total 12K drwxr-xr-x 2 user user 4.0K Mei 31 10:45 dir01 drwxr-xr-x 2 user user 4.0K ...
1
vote
1answer
42 views

What does it mean to open a directory in vim?

I did vim myDirectory, and got weird output that I don't know how to interpret.
0
votes
1answer
27 views

Default Directories Not Working In OpenSSL Configuration File

I have set the directory in the /etc/ssl/openssl.cnf file but every time I issue the command openssl req -x509 -newkey rsa:4096 -keyout cakey.pem -out cacert.pem -days 3650 it places the files in ...
0
votes
2answers
58 views

Compare two directories for a certain extension and then move the missing ones to a new directory [closed]

Editing and changing the verbiage to make it more clear - I have .dm4 files in both dirA and dirB. My reference folder is dirA and I want to list all the .dm4 files which are missing in dirA which are ...
3
votes
0answers
56 views

When coding for Unix/Linux is it convention to use a trailing slash on path names, or to omit it? [duplicate]

When programming for Unix/Linux, is it best practice to use a trailing slash, or to omit it? For example: Trailing slash baseDir="/path/to/dir/" #code# outPath=${baseDir}addition/to/path/ No ...
0
votes
1answer
59 views

Restore function in unix

I have a script to recover files back to their original location. I am missing the options for the script to as "Do you want to recover this file?" Yes or No. How will I implement it into this code ...
0
votes
1answer
40 views

How to find duplicate directory paths even if the contents are different?

I've searched high and low but it seems all but one (Find and list duplicate directories) topic I've found actually deals with my situation, and the result isn't quite what I need. Edit: Here's some ...
1
vote
1answer
42 views

Shell script to test ls output for directories

I am trying to make a BASH script to test the files in the working directory and return the files that are directory files. One approach that I can think of is, starting with ls and feeding the ...
0
votes
2answers
58 views

Copy every 10 files from source into a target directory using cp

I have 110 large files inside a directory. But I cannot copy them at once since the system gets timed out after 50 min. I want to copy files 1 to 10, next 11 to 20, next 21 to 30, and so on. The order ...
1
vote
0answers
32 views

I have a directory of 110 large files. I want to copy them in the batch of n (e.g., 10) to aws s3 [closed]

I have 110 large files inside a directory. But I cannot copy them at once since the system gets timed out after 50 min. I want to copy files 1 to 10, next 11 to 20, next 21 to 30, and so on. The order ...
1
vote
0answers
29 views

Folders and files permissions for SDKMAN tool on Ubuntu

I am Java developer trying to set up my local CI server using Linux Mint. One of the crucial tools I would like to use is SDKMAN - the tool that allowes easy installation and management of different ...
1
vote
1answer
47 views

Makefile - How to install a bash script into user's bin directory?

I need to make a Makefile to install a bash script into a user's bin directory, but I'm not sure what the best way of doing this would be. Should I be using a variable that accepts user input to ...
1
vote
0answers
33 views

How to restrict autocomplete for the files found from PATH?

What I would like to be able to do is to have a list of words that are allowed to be autocompleted when typing the first word in the command line. Say, I have PATH=/dir, and the directory /dir has ...
0
votes
2answers
15 views

.tar archive files EACH to its own directory?

I have an archive that contains files from various directories (created with -T option, so I used file with list of files to archive). Files preserve owners and rights. Content is like: var/lib/...
0
votes
0answers
34 views

Add trailing slash in csh

How do I get csh to add a trailing slash at the end of tab autocompletion? eg: \stuff \otherstuff now if I type cd s and press tab, I get: \stuff and not \stuff\
0
votes
3answers
35 views

How to list all directory paths including a text?

I need to list all directory paths including a text which is part of thier sub-directories. For example, the text is "tpcc" and I have two paths including tpcc as following: /home/arghy/sampledir1/**...
0
votes
0answers
23 views

A way to see your location history within the command line?

Similar to git's reflog, I'm looking for a way to see the directories I have moved through. I have lost something and I'm not sure exactly what happened, and something like the reflog is exactly what ...
0
votes
2answers
29 views

List lastest modified or newly created files in linux

How to list modified or newly created files or directories in linux. So that I can trigger another command or shell script for another task. for eg. A file a.txt and test.txt are modified and I ...
0
votes
0answers
40 views

How to map / mount a directory to another

I have two directories: /volume1/photos/ /volume1/shared_photos/ In shared_photos I have several sub-directories with pictures. What I want to do now is to "mount" or all the files from ../...
0
votes
0answers
27 views

What's causing folder to change ownership?

I have something funky going on with a few folders I'm hosting on a parallel filesystem. Every so often, the group ownership on the folders will revert to root:root Instead of an appropriate service ...
1
vote
1answer
82 views

Git init in wrong directory? How to recover? (theoretical situation)

This is completely theoretical, but I'm new to Git and Linux so I want to know. If I accidentally manage to do git init inside e.g Desktop or Home directory, how to prevent any possible disaster from ...
2
votes
3answers
283 views

How can I make rm -rf ask for confirmation just once at the directory level?

If I use rm -rfi, this asks me every time each file is deleted. If I have a list of rm -rf commands, how can I make it so that the machine asks me for confirmation just once (when trying to delete the ...
1
vote
1answer
67 views

Creating directory tree based on file name

I have a large number of files with the following structure: [Lion] 2015 Africa Book.pdf [Lion] 2015 Africa Magazine.pdf [Lion] 2016 Africa Book.pdf [Lion] 2016 Africa Magazine.pdf [Lion] 2015 Asia ...
0
votes
2answers
62 views

Is it possible to “add” a second folder to the current folder file contents? symlink?

question: Is it possible to "add" the contents of a 2nd folder to the current folder file contents? (In essence I was asking from a full Unix is perspective but may be nginx would work too as the goal ...
-1
votes
1answer
37 views

file -b command return on sticky bit files

I am trying to understand why the file -b command is returning a certain value(s) when the sticky bit is set. When I run file -b <dir> where dir has its group set to g+wrs, file -b returns ...
1
vote
1answer
38 views

How to reference a child directory, that is part of cwd's path?

Is there a generic way to reference a path that is nested an arbitrary level deep along the cwd? This is almost like a reverse relative path lookup. For example: $ pwd /Users/somebody/foo/bar/baz $...
0
votes
1answer
19 views

How can I predefine a path for a user logged in via SSH?

I'm looking for a way to set something like a default path for a user on my server. So for example I've the user XYZ. When I login now with this user on my server, I want to be directly in a defined ...
2
votes
1answer
465 views

“Cannot create directory … no such file or directory”

When executing the dockerfile, the command RUN cp -rf roundcubemail-1.2.3/. /var/www/html/ is executed and I'm getting the following error: cp: cannot create directory '/var/www/html/': No such file ...
0
votes
0answers
215 views

VSFTPD refuses to list directory when PASV is enabled

I'm configuring VSFTPD on Ubuntu 18.04 and have followed all the guidelines. It's working OK for plain FTP (insecure), however as soon as I enable SSL/TLS and Passive mode, it connects, but I am ...
0
votes
0answers
18 views

Copy specific named directories, where content changed the last 24 hours

I can recursively find and copy all my test-directories (with content) of the current directory: find . -name test ! -path "./my_dest/*" -exec cp -r --parents {} /path/to/my_dest \; But now I want ...
1
vote
1answer
110 views

Nemo file manager is completely ignoring `_` at the beginning of directory name, when sorting

Ex. suppose some directories are named absorbing appreciate arrive connect depend drop few fold littlel popcorn shrill sticky In Windows, if I put _ before the directories, it would be at the top, ...